niran90
niran90

Reputation: 298

Under what conditions does MPI_Isend/MPI_Irecv wait for its associated completion call (MPI_Wait/MPI_Test) to start data transmission?

One of the comments in this post briefly mentions

The standard allows the implementation to postpone the actual data transmission until the wait/test call.

Is it always the case that data transmission of MPI_Isend/MPI_Irecv is postponed until the associated completion call (MPI_Wait/MPI_Test or their variants) is invoked? If not, what conditions influence this?

Upvotes: 2

Views: 503

Answers (1)

Raha Moosavi
Raha Moosavi

Reputation: 547

  • MPI_Wait is used to wait for a single communication to complete
  • MPI_Waitall is used to wait for a list of communications to complete
  • MPI_Test and MPI_Testall use in non-blocking communications to check if the communications are finished without requiring them to be finished.

With the MPI_Isend, You had to store the values of each of the data points as a separate variable in an array

  • This is because the data can be sent anytime until the MPI_Waitall is called.
  • This means that the data mustn’t be changed/overwritten or go out of scope within this interval.
  • This is different from MPI_Send, where the data to be sent is buffered and/or actually sent by the time MPI_Send completes.

The same is true of MPI_Irecv, though this is more obvious as you want to have the data.

Note

In MPI_Testall the flag will be true only if all the communications are finished.

Upvotes: 1

Related Questions