MPI\_Sendrecv and MPI\_Sendrecv\_replace APIs
mpi.sendrecv
and mpi.sendrecv.replace
execute blocking send
and receive operations. Both of them combine the sending of one message to
a destination and the receiving of another message from a source in one
call. The source and destination are possibly the same. The send buffer and
receive buffer are disjoint for mpi.sendrecv
, while the buffers are
not disjoint for mpi.sendrecv.replace
.
mpi.sendrecv(senddata, sendtype, dest, sendtag, recvdata, recvtype, source, recvtag, comm = 1, status = 0) mpi.sendrecv.replace(x, type, dest, sendtag, source, recvtag, comm = 1, status = 0)
x |
data to be sent or recieved. Must be the same type for source and destination. |
senddata |
data to be sent. May have different datatypes and lengths |
recvdata |
data to be recieved. May have different datatypes and lengths |
type |
type of the data to be sent or recieved. 1 for integer, 2 for double, and 3 for character. Others are not supported. |
sendtype |
type of the data to be sent. 1 for integer, 2 for double, and 3 for character. Others are not supported. |
recvtype |
type of the data to be recieved. 1 for integer, 2 for double, and 3 for character. Others are not supported. |
dest |
the destination rank. Use |
source |
the source rank. Use |
sendtag |
non-negative integer. Use |
recvtag |
non-negative integer. Use |
comm |
a communicator number. |
status |
a status number. |
The receive buffer must be large enough to contain an incoming message otherwise programs will be crashed. There is compatibility between send-receive and normal sends and receives. A message sent by a send-receive can be received by a regular receive and a send-receive can receive a message sent by a regular send.
Returns the int, double or char vector sent from the send buffers.
Kris Chen
mpi.sendrecv(as.integer(11:20),1,0,33,integer(10),1,0,33,comm=0) mpi.sendrecv.replace(seq(1,2,by=0.1),2,0,99,0,99,comm=0)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.