Skip to content

Commit 22a08c4

Browse files
authored
Merge pull request #165 from JuliaParallel/eschnett/ref
Use Ref instead of Array
2 parents cb0ffc5 + 195c4cd commit 22a08c4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/mpi-base.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,12 @@ end
402402
function Testall!(reqs::Array{Request,1})
403403
count = length(reqs)
404404
reqvals = [reqs[i].val for i in 1:count]
405-
flag = Array(Cint, 1)
405+
flag = Ref{Cint}()
406406
statvals = Array(Cint, MPI_STATUS_SIZE, count)
407407
ccall(MPI_TESTALL, Void,
408408
(Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
409409
&count, reqvals, flag, statvals, &0)
410-
if flag[1] == 0
410+
if flag[] == 0
411411
return (false, nothing)
412412
end
413413
stats = Array(Status, count)
@@ -587,10 +587,9 @@ end
587587

588588
function Allreduce!{T}(sendbuf::MPIBuffertype{T}, recvbuf::MPIBuffertype{T},
589589
count::Integer, op::Op, comm::Comm)
590-
flag = Ref{Cint}()
591590
ccall(MPI_ALLREDUCE, Void, (Ptr{T}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint},
592591
Ptr{Cint}, Ptr{Cint}), sendbuf, recvbuf, &count, &mpitype(T),
593-
&op.val, &comm.val, flag)
592+
&op.val, &comm.val, &0)
594593

595594
recvbuf
596595
end

0 commit comments

Comments
 (0)