mpi.recv are two most used blocking
calls for point-to-point communications. An int, double or char vector
can be transmitted from any source to any destination.
mpi.irecv are the same except that
they are nonblocking calls.
Blocking and nonblocking calls are interchangeable, e.g., nonblocking sends can be matched with blocking receives, and vice-versa.
1 2 3 4
data to be sent or received. Must be the same type for source and destination. The receive buffer must be as large as the send buffer.
1 for integer, 2 for double, and 3 for character. Others are not supported.
the destination rank. Use
the source rank. Use
non-negative integer. Use
a communicator number.
a request number.
a status number.
mpi.irecv) must be used together, i.e., if there is a sender,
then there must be a receiver. Any mismatch will result a deadlock
situation, i.e., programs stop responding. The receive buffer must be
large enough to contain an incoming message otherwise programs will be
crashed. One can use
mpi.probe (or mpi.iprobe) and
mpi.get.count to find the length of an incoming message
mpi.any.tag is used in
mpi.recv, one can use
mpi.get.sourcetag to find out the source or tag of the
received message. To send/receive an R object rather than an int, double
or char vector, please use the pair
mpi.irecv is a nonblocking call,
x with enough buffer
must be created before using it. Then use nonblocking completion calls
mpi.test to test if
x contains data from sender.
If multiple nonblocking sends or receives are used, please use request
number consecutively from 0. For example, to receive two messages from two
mpi.waitall can be
used to complete the operations.
mpi.isend return no value.
returns the int, double or char vector sent from
mpi.irecv returns no value. See details for explanation.
1 2 3 4 5 6 7 8 9 10 11
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.