Skip to content

Commit 818b3ef

Browse files
authored
Merge pull request #170 from tkonolige/master
Pass opfunc correctly to Reduce
2 parents 556e428 + 1c58739 commit 818b3ef

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/mpi-op.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ Allreduce!{T}(sendbuf::MPIBuffertype{T}, recvbuf::MPIBuffertype{T},
6666
Allreduce!(sendbuf, recvbuf, count, user_op(opfunc), comm)
6767

6868
Reduce{T}(sendbuf::MPIBuffertype{T}, count::Integer,
69-
op::Function, root::Integer, comm::Comm) =
69+
opfunc::Function, root::Integer, comm::Comm) =
7070
Reduce(sendbuf, count, user_op(opfunc), root, comm)

test/test_reduce.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ val = rank == root ? size-1 : nothing
1818
val = rank == root ? 0 : nothing
1919
@test MPI.Reduce(rank, MPI.MIN, root, comm) == val
2020

21+
val = rank == root ? size : nothing
22+
@test MPI.Reduce(1, +, root, comm) == val
23+
2124
mesg = collect(1.0:5.0)
2225
sum_mesg = MPI.Reduce(mesg, MPI.SUM, root, comm)
2326
sum_mesg = rank == root ? sum_mesg : size*mesg

0 commit comments

Comments
 (0)