armando
armando

Reputation: 1480

understanding the functioning of MPI_Irsend()

according to this documentation page: https://www.rookiehpc.com/mpi/docs/mpi_irsend.php#:~:text=Definition,to%20have%20been%20issued%20first.

"Indeed, MPI_Irsend requires the corresponding receive (MPI_Recv or MPI_Irecv) to have been issued first."

Does this mean that MPI_Irsend works pretty much like a blocking routine? Thank you.

Upvotes: 0

Views: 66

Answers (1)

Victor Eijkhout
Victor Eijkhout

Reputation: 5794

The I in the routine name indicates that it is non-blocking. You get a request object, and from the request object you can query if the transfer has been completed.

The "ready" part means that when you call this, you guarantee that the send has been posted, so MPI can skip some of the handshake overhead.

I understand your confusion. Normally you would use a non-blocking receive so that you don't have idle time if the sending process is lagging. Why then a non-blocking ready send, where you know that the sending process is ready? Well, maybe you want to post more than one, and you know that all the sends have been posted, but you want to be independent of the order in which data arrives. Maybe transferring the data is slow and you want to overlap with communication.

That said, I always figured that this routine exists more because orthogonality of design suggests it, rather than that there are compelling use cases for it.

Upvotes: 1

Related Questions