@@ -341,6 +341,65 @@ function irecv(src::Integer, tag::Integer, comm::Comm)
341341 (true , MPI. deserialize (buf), stat)
342342end
343343
344+ """
345+ Sendrecv(sendbuf, sendcount::Integer, sendtype::Union{Datatype, MPI_Datatype}, dest::Integer, sendtag::Integer,
346+ recvbuf, recvcount::Integer, recvtype::Union{Datatype, MPI_Datatype}, source::Integer, recvtag::Integer,
347+ comm::Comm)
348+
349+ Complete a blocking send-receive operation over the MPI communicator `comm`. Send
350+ `sendcount` elements of type `sendtype` from `sendbuf` to the MPI rank `dest` using message
351+ tag `tag`, and receive `recvcount` elements of type `recvtype` from MPI rank `source` into
352+ the buffer `recvbuf` using message tag `tag`. Return an MPI.Status object.
353+ """
354+ function Sendrecv (sendbuf, sendcount:: Integer , sendtype:: Union{Datatype, MPI_Datatype} , dest:: Integer , sendtag:: Integer ,
355+ recvbuf, recvcount:: Integer , recvtype:: Union{Datatype, MPI_Datatype} , source:: Integer , recvtag:: Integer ,
356+ comm:: Comm )
357+ # int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag,
358+ # void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag,
359+ # MPI_Comm comm, MPI_Status *status)
360+ stat_ref = Ref {Status} ()
361+ @mpichk ccall ((:MPI_Sendrecv , libmpi), Cint,
362+ (MPIPtr, Cint, MPI_Datatype, Cint, Cint,
363+ MPIPtr, Cint, MPI_Datatype, Cint, Cint,
364+ MPI_Comm, Ptr{Status}),
365+ sendbuf, sendcount, sendtype, dest, sendtag,
366+ recvbuf, recvcount, recvtype, source, recvtag, comm, stat_ref)
367+ return stat_ref[]
368+ end
369+
370+ """
371+ Sendrecv(sendbuf::MPIBuffertype{T}, sendcount::Integer, dest::Integer, sendtag::Integer,
372+ recvbuf::MPIBuffertype{T}, recvcount::Integer, source::Integer, recvtag::Integer,
373+ comm::Comm) where {T}
374+
375+ Complete a blocking send-receive operation over the MPI communicator `comm`, sending
376+ `sendcount` elements of type `T` from `sendbuf` to the MPI rank `dest` using message
377+ tag `tag`, and receiving `recvcount` elements of the same type from MPI rank `source` into
378+ the buffer `recvbuf` using message tag `tag`. Return an MPI.Status object.
379+ """
380+ function Sendrecv (sendbuf:: MPIBuffertype{T} , sendcount:: Integer , dest:: Integer , sendtag:: Integer ,
381+ recvbuf:: MPIBuffertype{T} , recvcount:: Integer , source:: Integer , recvtag:: Integer ,
382+ comm:: Comm ) where {T}
383+ return Sendrecv (sendbuf, sendcount, mpitype (eltype (sendbuf)), dest, sendtag,
384+ recvbuf, recvcount, mpitype (eltype (recvbuf)), source, recvtag, comm)
385+ end
386+
387+ """
388+ Sendrecv(sendbuf::AbstractArray{T}, dest::Integer, sendtag::Integer,
389+ recvbuf::AbstractArray{T}, source::Integer, recvtag::Integer,
390+ comm::Comm) where {T}
391+
392+ Complete a blocking send-receive operation over the MPI communicator `comm`, sending
393+ `sendbuf` to the MPI rank `dest` using message tag `tag`, and receiving the buffer
394+ `recvbuf` using message tag `tag`. Return an MPI.Status object.
395+ """
396+ function Sendrecv (sendbuf:: AbstractArray{T} , dest:: Integer , sendtag:: Integer ,
397+ recvbuf:: AbstractArray{T} , source:: Integer , recvtag:: Integer ,
398+ comm:: Comm ) where {T}
399+ return Sendrecv (sendbuf, length (sendbuf), dest, sendtag,
400+ recvbuf, length (recvbuf), source, recvtag, comm)
401+ end
402+
344403"""
345404 Wait!(req::Request)
346405
0 commit comments