Skip to content

Commit

Permalink
use matched ops for MPI.recv
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Dec 31, 2022
1 parent 97738dc commit 21534b1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/pointtopoint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ Returns the deserialized object and optionally the [`Status`](@ref) of the recei
recv(comm::Comm, status=nothing; source::Integer=API.MPI_ANY_SOURCE[], tag::Integer=API.MPI_ANY_TAG[]) =
recv(source, tag, comm, status)
function recv(source::Integer, tag::Integer, comm::Comm, status::Union{Ref{Status}, Nothing})
stat = Probe(comm, Status; source=source, tag=tag)
msg, stat = Mprobe(comm, Status; source=source, tag=tag)
count = Get_count(stat, UInt8)
buf = Array{UInt8}(undef, count)
stat = Recv!(buf, comm, status; source=Get_source(stat), tag=Get_tag(stat))
Mrecv!(buf, msg, status)
return MPI.deserialize(buf)
end
function recv(source::Integer, tag::Integer, comm::Comm, ::Type{Status})
Expand Down Expand Up @@ -380,4 +380,3 @@ function Imrecv!(buf::Buffer, msg::Message, req::AbstractRequest=Request())
end
Imrecv!(data, msg::Message, req::AbstractRequest=Request()) =
Imrecv!(Buffer(data), msg, req)

0 comments on commit 21534b1

Please sign in to comment.