From 1c4544e4830e89298cedb5898ebe00fdda73bb2c Mon Sep 17 00:00:00 2001 From: Katharine Hyatt Date: Tue, 10 Oct 2023 18:59:23 -0400 Subject: [PATCH] Add tests for AND, OR, and XOR reductions --- test/test_reduce.jl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/test_reduce.jl b/test/test_reduce.jl index 8c64a601e..dbf0c6e79 100644 --- a/test/test_reduce.jl +++ b/test/test_reduce.jl @@ -32,6 +32,22 @@ val = isroot ? 0 : nothing @test MPI.Reduce(rank, MPI.MIN, comm; root=root) == val @test MPI.Reduce(rank, min, comm; root=root) == val +val = isroot ? 1 : nothing +input = isroot ? 1 : 0 +@test MPI.Reduce(input, MPI.BOR, comm; root=root) == val +@test MPI.Reduce(input, |, comm; root=root) == val + +val = isroot ? 1 : nothing +input = isroot ? 1 : 0 +@test MPI.Reduce(input, MPI.BXOR, comm; root=root) == val +@test MPI.Reduce(input, ⊻, comm; root=root) == val + +val = isroot ? 0 : nothing +input = isroot ? 0 : 1 +@test MPI.Reduce(input, MPI.BAND, comm; root=root) == val +@test MPI.Reduce(input, &, comm; root=root) == val + + val = isroot ? sz : nothing @test MPI.Reduce(1, +, root, comm) == val