If you send with MPI_Isend, the send operation is started. In order to
complete the send, you need a corresponding MPI_Wait (or MPI_Test or
variant like MPI_Waitall, etc.).
I am wondering if there is an flush()-like function in MPI. I saw
the output of my program. One sent something but some other process did
not receive it, just sitting there waiting. I used MPI_Isend for
sending and MPI_Recv for receiving. Is it possible the message was lost
or the message was not flushed out and was still in the I/O buffer.
Even then, it is possible for the MPI implementation to buffer the
message internally. That is, the completion of the send operation only
means that the message has left the user's send buffer -- not that the
message has been received at the other end.
There are also synchronous sends such as MPI_Ssend (or the non-blocking
variant MPI_Issend). This guarantees that the send completes not only
once the message has left the user's send buffer but only only once the
receiver has posted a matching receive. It does not, however,
guarantee that the full message has arrived at or been received by the
I think once you've completed the send (e.g., adding an MPI_Wait to
your MPI_Isend), there is nothing more to do on the sender's side to
push the message along.