Skip to content

Commit 9b69d79

Browse files
authored
fix SentinelPtr conversion error (#509)
1 parent ec65ada commit 9b69d79

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/MPI.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ function __init__()
6767
end
6868

6969
__init__deps()
70-
70+
7171
# disable UCX memory cache, since it doesn't work correctly
7272
# https://github.com/openucx/ucx/issues/5061
7373
if !haskey(ENV, "UCX_MEMTYPE_CACHE")
7474
ENV["UCX_MEMTYPE_CACHE"] = "no"
7575
end
76-
76+
7777
# Julia multithreading uses SIGSEGV to sync thread
7878
# https://docs.julialang.org/en/v1/devdocs/debuggingtips/#Dealing-with-signals-1
7979
# By default, UCX will error if this occurs (issue #337)

src/nonblocking.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ if !@isdefined(Status)
5959
@assert sizeof(Status) == MPI_Status_size
6060
end
6161

62+
Base.cconvert(::Type{Ptr{Status}}, x::SentinelPtr) = x
63+
Base.unsafe_convert(::Type{Ptr{Status}}, x::SentinelPtr) = reinterpret(Ptr{Status}, x)
6264

6365
"""
6466
MPI.Status

test/test_sendrecv.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,25 @@ rreq = MPI.Irecv!(recv_mesg, src, src+32, comm)
6767
sreq = MPI.Isend(send_mesg, dst, rank+32, comm)
6868

6969
req_arr = [sreq,rreq]
70-
(inds, stats) = MPI.Waitsome!(req_arr)
70+
inds = MPI.Waitsome(req_arr)
7171
for i in inds
72-
(done, status) = MPI.Test!( req_arr[i] )
73-
@test done
72+
@test MPI.Test(req_arr[i])
7473
end
7574

7675
rreq = MPI.Irecv!(recv_mesg, src, src+32, comm)
7776
MPI.Cancel!(rreq)
78-
MPI.Wait!(rreq)
77+
MPI.Wait(rreq)
7978
@test rreq.buffer == nothing
8079

8180
GC.gc()
8281

8382
# ---------------------
8483
# MPI_Sendrecv function
8584
# ---------------------
86-
#
85+
#
8786
# send datatype
8887
# ---------------------
89-
# We test this function by executing a left shift of the leftmost element in a 1D
88+
# We test this function by executing a left shift of the leftmost element in a 1D
9089
# cartesian topology with periodic boundary conditions.
9190
#
9291
# Assume we have two processors, the data will look like this

0 commit comments

Comments
 (0)