Point-to-point communication
Types
MPI.Request — TypeMPI.RequestAn MPI Request object, representing a non-blocking communication. This also contains a reference to the buffer used in the communication to ensure it isn't garbage-collected during communication.
The status of a Request can be checked by the Wait! and Test! functions or their multiple-request variants, which will deallocate the request once it is determined to be complete. Alternatively, it will be deallocated at finalization, meaning that it is safe to ignore the request objects if the status of the communication can be checked by other means.
See also Cancel!.
MPI.Status — TypeMPI.StatusThe status of an MPI receive communication. It has 3 accessible fields
source: source of the received messagetag: tag of the received messageerror: error code. This is only set if a function returns multiple statuses.
Additionally, the accessor function MPI.Get_count can be used to determine the number of entries received.
Accessors
MPI.Get_count — FunctionMPI.Get_count(status::Status, T)The number of entries received. T should match the argument provided by the receive call that set the status variable.
If the number of entries received exceeds the limits of the count parameter, then it returns MPI_UNDEFINED.
External links
Blocking communication
MPI.Send — FunctionSend(buf, dest::Integer, tag::Integer, comm::Comm)Perform a blocking send from the buffer buf to MPI rank dest of communicator comm using the message tag tag.
External links
Send(obj::T, dest::Integer, tag::Integer, comm::Comm) where TComplete a blocking send of obj to MPI rank dest of communicator comm using with the message tag tag.
MPI.send — Functionsend(obj, dest::Integer, tag::Integer, comm::Comm)Complete a blocking send using a serialized version of obj to MPI rank dest of communicator comm using with the message tag tag.
MPI.Recv! — FunctionRecv!(data, src::Integer, tag::Integer, comm::Comm)Completes a blocking receive into the buffer data from MPI rank src of communicator comm using with the message tag tag.
data can be a Buffer, or any object for which Buffer(data) is defined.
Returns the Status of the receive.
See also
External links
MPI.Recv — FunctionRecv(::Type{T}, src::Integer, tag::Integer, comm::Comm)Completes a blocking receive of an object of type T from MPI rank src of communicator comm using with the message tag tag.
Returns a tuple of the object of type T and the Status of the receive.
See also
External links
MPI.recv — Functionrecv(src::Integer, tag::Integer, comm::Comm)Completes a blocking receive of a serialized object from MPI rank src of communicator comm using with the message tag tag.
Returns the deserialized object and the Status of the receive.
MPI.Sendrecv! — FunctionSendrecv!(sendbuf, dest::Integer, sendtag::Integer,
recvbuf, source::Integer, recvtag::Integer,
comm::Comm)Complete a blocking send-receive operation over the MPI communicator comm. Send sendcount elements of type sendtype from sendbuf to the MPI rank dest using message tag tag, and receive recvcount elements of type recvtype from MPI rank source into the buffer recvbuf using message tag tag. Return a Status object.
If not provided, sendtype/recvtype and sendcount/recvcount are derived from the element type and length of sendbuf/recvbuf, respectively.
External links
Non-blocking communication
Initiation
MPI.Isend — FunctionIsend(data, dest::Integer, tag::Integer, comm::Comm)Starts a nonblocking send of data to MPI rank dest of communicator comm using with the message tag tag.
data can be a Buffer, or any object for which Buffer_send is defined.
Returns the Request object for the nonblocking send.
External links
MPI.isend — Functionisend(obj, dest::Integer, tag::Integer, comm::Comm)Starts a nonblocking send of using a serialized version of obj to MPI rank dest of communicator comm using with the message tag tag.
Returns the commication Request for the nonblocking send.
MPI.Irecv! — FunctionIrecv!(data, src::Integer, tag::Integer, comm::Comm)Starts a nonblocking receive into the buffer data from MPI rank src of communicator comm using with the message tag tag.
data can be a Buffer, or any object for which Buffer(data) is defined.
Returns the Request for the nonblocking receive.
External links
Completion
MPI.Test! — Function(flag, status) = Test!(req::Request)Check if the request req is complete. If so, the request is deallocated and flag is returned true and status as the Status of the request. Otherwise flag is returned false and status is nothing.
External links
MPI.Testall! — Function(flag, statuses) = Testall!(reqs::Vector{Request})Check if all active requests in the array reqs are complete. If so, the requests are deallocated and flag is returned as true and statuses is an array of the Status objects corresponding to each request is returned. Otherwise no requests are modified a tuple of false, nothing is returned.
External links
MPI.Testany! — Function(flag, index, status) = Testany!(reqs::Vector{Request})Check if any one of the requests in the array reqs is complete.
If one or more requests are complete, then one is chosen arbitrarily, deallocated and flag is returned as true, along with the index and the Status of the request.
Otherwise, if there are no complete requests, then index is returned as 0, status as nothing, and flag as true if there are no active requests and false otherwise.
External links
MPI.Testsome! — Function(indices, statuses) = Testsome!(reqs::Vector{Request})Similar to Waitsome! except that it returns immediately: if no operations have completed then indices and statuses will be empty.
External links
MPI.Wait! — Functionstatus = Wait!(req::Request)Block until the request req is complete and deallocated. Returns the Status of the request.
External links
MPI.Waitall! — Functionstatuses = Waitall!(reqs::Vector{Request})Block until all active requests in the array reqs are complete. Returns an array of the Status objects corresponding to each request.
External links
MPI.Waitany! — Function(index, status) = Waitany!(reqs::Vector{Request})Blocks until one of the requests in the array reqs is complete: if more than one is complete, one is chosen arbitrarily. The request is deallocated and a tuple of the index of the completed request and its Status is returned. If there are no active requests, then index is returned as 0.
External links
MPI.Waitsome! — Function(indices, statuses) = Waitsome!(reqs::Vector{Request})Block until at least one of the active requests in the array reqs is complete. The completed requests are deallocated, and a tuple of their indices in reqs and their corresponding Status objects are returned. If there are no active requests, then the function returns immediately and indices and statuses are empty.
External links
Probe/Cancel
MPI.Cancel! — FunctionCancel!(req::Request)Marks a pending Irecv! operation for cancellation (cancelling a Isend, while supported in some implementations, is deprecated as of MPI 3.1). Note that the request is not deallocated, and can still be queried using the test or wait functions.
External links
MPI.Iprobe — Functionismessage, (status|nothing) = Iprobe(src::Integer, tag::Integer, comm::Comm)Checks if there is a message that can be received matching src, tag and comm. If so, returns a tuple true and a Status object, otherwise returns a tuple false, nothing.
External links
MPI.Probe — Functionstatus = Probe(src::Integer, tag::Integer, comm::Comm)Blocks until there is a message that can be received matching src, tag and comm. Returns the corresponding Status object.
External links