c - When is MPI_wait necessary with non-blocking calls? -
i'm little bit confused when should call mpi_wait (or other variants such as: mpi_waitall, mpii_waitsome, etc). consider following situations: (note: pseudo code)
case (1)
mpi_isend (send_buffer, send_req); // local work mpi_probe (recv_msg); mpi_irecv (recv_buffer, recv_req); // wait msgs finish mpi_wait (recv_req); // <--- needed? mpi_wait (send_req); // <--- how this? so confusion stems mpi_probe in case. since blocking call, wouldn't mean blocks caller until message received? if case, think mpi_waits unnecessary here.
how following case?
case (2)
mpi_isend (send_buffer, send_req); // local work mpi_probe (recv_msg); mpi_recv (recv_buffer); // wait msgs finish mpi_wait (send_req); // <--- necessary? similar first case mpi_irecv replaced blocking version. in case, message received time mpi_wait called means mpi_isend must have been finished ...
also separate question, mean when mpi_probe blocking? block until of message received process or block until "meta-data" (such msg size, sender rank, etc) received? in other words mpi_probe + mpi_irecv better mpi_probe + mpi_recv ?
only when wants receives data asynchronously, need use "mpi_wait" function or mpi_waitall if initiated various asynchronous read. problem mpi_wait blocking call. if want have non-blocking should use mpi_test check completion of function.
in case, mpi_probe block until message received. call mpi_probe not necessary in case.
Comments
Post a Comment