| mpi.send {Rmpi} | R Documentation |
The pair mpi.send and 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.send(x, type, dest, tag, comm = 1) mpi.recv(x, type, source, tag, comm = 1, status = 0)
x |
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. |
type |
1 for integer, 2 for double, and 3 for character. Others are not supported. |
dest |
the destination rank. Use mpi.proc.null for a
fake destination. |
source |
the source rank. Use mpi.any.source for any source.
Use mpi.proc.null for a fake source. |
tag |
non-negative integer. Use mpi.any.tag for any tag flag. |
comm |
a communicator number. |
status |
a status number. |
The pair mpi.send and mpi.recv 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 and
mpi.get.count to find the length of an incoming message
before calling mpi.recv. If mpi.any.source or
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.send.Robj and
mpi.recv.Robj.
mpi.send returns no value. mpi.recv returns the int,
double or char vector sent from source.
Hao Yu
http://www.lam-mpi.org/, http://www-unix.mcs.anl.gov/mpi/www/www3/
mpi.send.Robj,
mpi.recv.Robj,
mpi.probe.
mpi.get.count,
mpi.get.sourcetag.