Skip to content

Commit f2bd4c9

Browse files
committed
Merge pull request #142 from JuliaParallel/ksh/cancel
Fix bug and add test for Cancel
2 parents 5d24cc9 + 075f554 commit f2bd4c9

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/mpi-base.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,8 @@ function Testsome!(reqs::Array{Request,1})
456456
(indices, stats)
457457
end
458458

459-
function Cancel!(res::Request)
460-
ccall(MPI_CANCEL, Void, (Ptr{Cint},), &req.val, &0)
459+
function Cancel!(req::Request)
460+
ccall(MPI_CANCEL, Void, (Ptr{Cint},Ptr{Cint}), &req.val, &0)
461461
req.buffer = nothing
462462
nothing
463463
end

src/win_mpiconstants.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,6 @@ const MPI_TYPE_COMMIT = (:MPI_TYPE_COMMIT, "msmpi.dll")
8585
const MPI_WAIT = (:MPI_WAIT, "msmpi.dll")
8686
const MPI_WAITSOME = (:MPI_WAITSOME, "msmpi.dll")
8787
const MPI_WAITANY = (:MPI_WAITANY, "msmpi.dll")
88+
const MPI_CANCEL = (:MPI_CANCEL, "msmpi.dll")
8889

8990
bitstype 32 CComm

test/test_sendrecv.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,10 @@ rreq = nothing
106106
sreq = nothing
107107
gc()
108108

109+
recv_mesg = Array(Float64, N)
110+
sreq = MPI.Isend(send_mesg, dst, rank+32, comm)
111+
MPI.Cancel!(sreq)
112+
@test sreq.buffer == nothing
113+
gc()
114+
109115
MPI.Finalize()

0 commit comments

Comments
 (0)