Skip to content

Commit 7d709c3

Browse files
authored
Add tests for AND, OR, and XOR reductions (#777)
1 parent 6e58be2 commit 7d709c3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/test_reduce.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ val = isroot ? 0 : nothing
3232
@test MPI.Reduce(rank, MPI.MIN, comm; root=root) == val
3333
@test MPI.Reduce(rank, min, comm; root=root) == val
3434

35+
val = isroot ? 1 : nothing
36+
input = isroot ? 1 : 0
37+
@test MPI.Reduce(input, MPI.BOR, comm; root=root) == val
38+
@test MPI.Reduce(input, |, comm; root=root) == val
39+
40+
val = isroot ? 1 : nothing
41+
input = isroot ? 1 : 0
42+
@test MPI.Reduce(input, MPI.BXOR, comm; root=root) == val
43+
@test MPI.Reduce(input, , comm; root=root) == val
44+
45+
val = isroot ? 0 : nothing
46+
input = isroot ? 0 : 1
47+
@test MPI.Reduce(input, MPI.BAND, comm; root=root) == val
48+
@test MPI.Reduce(input, &, comm; root=root) == val
49+
50+
3551
val = isroot ? sz : nothing
3652
@test MPI.Reduce(1, +, root, comm) == val
3753

0 commit comments

Comments
 (0)