Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sending multiple mpi non blocking send - will it preserve the sent order

Tags:

mpi

say i have the 3 non blocking sends like this

  1. MPI_Isend ();
  2. MPI_Isend ();
  3. MPI_Isend ();

and the 3 corresponding receives

  1. MPI_Recv();
  2. MPI_Recv();
  3. MPI_Recv();

Now assume that the 2nd Isend doesnt send so since its non blocking the 3rd one will be send. Now will the MPI_Recv functions get intended ones ?

I mean will the 1st MPI_ISend send data to the 1st receive and the 2nd MPI_ISent to the 2nd MPI_Recv and so on.

like image 459
klijo Avatar asked Jan 29 '12 18:01

klijo


People also ask

What are the differences between blocking and non-blocking send in MPI?

A nonblocking send will return as soon as possible, whereas a blocking send will return after the data has been copied out of the sender memory. The use of nonblocking sends is advantageous in these cases only if data copying can be concurrent with computation.

What is the meaning of non-blocking send?

Non-blocking means computation and transferring data can happen in the same time for a single process.

What is non-blocking communication in MPI?

Non-blocking MPI send calls An MPI_Isend creates a send request and returns a request object. It may or may not have sent the message, or buffered it. The caller is responsible for not changing the buffer until after waiting upon the resulting request object.

What is use of blocking send in MPI?

The MPI standard requires that a blocking send call blocks (and hence NOT return to the call) until the send buffer is safe to be reused. Similarly, the Standard requires that a blocking receive call blocks until the receive buffer actually contains the intended message.


1 Answers

Updated: Jeremiah Willcock below in comments is I think right, and this answer was wrong.

If the three ISends are called sequentially, and the receives all match them, then it doesn't matter if one is send operation is bigger, or faster, or whatever; MPI's non-overtaking guarantee tells you that the messages will arrive (and thus be available for the Recv) in the order the Isends were made.

If the call to the ISend was delayed, which was how I interpreted the question initially, or if the call failed as suggested (but note that you'd have other problems later if the call failed) then the original answer holds: if the Recieves match any all of the Isends, and the call to the second ISend gets held up somehow, then the 1st MPI_Recv() will get the first Isend, the second Recv will get the third Isend, and the third will hang until that second Isend happens.

If you want to ensure that the first MPI_Recv receives a particular message, you should use tags to distinguish the various messages, and have the receive specify that tag.

like image 179
Jonathan Dursi Avatar answered Nov 27 '22 02:11

Jonathan Dursi