Cramer
Cramer

Reputation: 1795

MPI non blocking send/recv

I'm curious at the lack of this function in MPI:

MPI_Isendrecv( ... );

i.e., a non-blocking send and receive, can anyone tell me the rationale behind its omission?

Upvotes: 6

Views: 3454

Answers (2)

julaine
julaine

Reputation: 1674

MPI-4 defines the following function, see MPI-4.1 pdf, page 77

int MPI_Isendrecv_replace(void *buf, int count, MPI_Datatype datatype,
    int dest, int sendtag, int source, int recvtag, MPI_Comm comm,
    MPI_Request *request);

note there is only one buffer which is used for sending and receiving, so it is not strictly a non-blocking variant of MPI_Sendrecv. This buffer being used as in- and output is something you could not implement yourself using MPI_Isend and MPI_Irecv so that's why inclusion in the standard makes sense, it is more than a convenience-function. Sometimes the standard includes a 'rationale'-section, but for this function it does not.

Upvotes: 0

Edric
Edric

Reputation: 25140

My take is that MPI_SENDRECV exists as a convenience for programmers who want to use blocking semantics, but need to implement a shift operation. If you're comfortable with non-blocking semantics, you should simply use the existing MPI_ISEND and MPI_IRECV.

Interestingly, MPI-3 will add non-blocking collectives (e.g. MPI_IBARRIER), but still no MPI_ISENDRECV (see http://meetings.mpi-forum.org/draft_standard/mpi3.0_draft_2.pdf ).

Upvotes: 6

Related Questions