Skip to content

Commit

Permalink
Add tests for AND, OR, and XOR reductions (#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt authored Oct 10, 2023
1 parent 6e58be2 commit 7d709c3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test_reduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7d709c3

Please sign in to comment.