MPI_SENDRECV_REPLACE, MPI_Sendrecv_replace Purpose Performs a blocking send and receive operation using a common buffer. C synopsis #include int MPI_Sendrecv_replace(void* buf,int count,MPI_Datatype datatype, int dest,int sendtag,int source,int recvtag, MPI_Comm comm,MPI_Status *status); C++ synopsis #include mpi.h void MPI::Comm::Sendrecv_replace(void* buf, int count, const MPI::Datatype& datatype, int dest, int sendtag, int source, int recvtag) const; #include mpi.h void MPI::Comm::Sendrecv_replace(void *buf, int count, const MPI::Datatype& datatype, int dest, int sendtag, int source, int recvtag, MPI::Status& status) const; FORTRAN synopsis include 'mpif.h' or use mpi MPI_SENDRECV_REPLACE(CHOICE BUF,INTEGER COUNT,INTEGER DATATYPE,INTEGER DEST, INTEGER SENDTAG,INTEGER SOURCE,INTEGER RECVTAG,INTEGER COMM, INTEGER STATUS(MPI_STATUS_SIZE),INTEGER IERROR) Parameters buf is the initial address of the send and receive buffer (choice) (INOUT) count is the number of elements to be sent and received (integer) (IN) datatype is the type of elements in the send and receive buffer (handle) (IN) dest is the rank of the destination task (integer) (IN) sendtag is the send message tag (integer) (IN) source is the rank of the source task or MPI_ANY_SOURCE (integer) (IN) recvtag is the receive message tag or MPI_ANY_TAGE (integer) (IN) comm is the communicator (handle) (IN) status is the status object (Status) (INOUT). Note that in FORTRAN a single status object is an array of integers. IERROR is the FORTRAN return code. It is always the last argument. Description This subroutine is a blocking send and receive operation using a common buffer. Send and receive use the same buffer so the message sent is replaced with the message received. Passing MPI_STATUS_IGNORE for the status argument causes PE MPI to skip filling in the status fields. By passing this value for status, you can avoid having to allocate a status object in programs that do not need to examine the status fields. Errors Invalid count count < 0 Invalid datatype Type not committed Invalid destination dest < 0 or dest > = groupsize Invalid source source < 0 or source > = groupsize Invalid communicator Invalid tag(s) tag < 0 Invalid status ignore value Out of memory MPI not initialized MPI already finalized Related information