MPI_WAIT, MPI_Wait Purpose Waits for a nonblocking operation to complete. C synopsis #include int MPI_Wait(MPI_Request *request,MPI_Status *status); C++ synopsis #include mpi.h void MPI::Request::Wait(); #include mpi.h void MPI::Request::Wait(MPI::Status& status); FORTRAN synopsis include 'mpif.h' or use mpi MPI_WAIT(INTEGER REQUEST,INTEGER STATUS(MPI_STATUS_SIZE),INTEGER IERROR) Description MPI_WAIT returns after the operation identified by request completes. If the object associated with request was created by a nonblocking operation, the object is deallocated and request is set to MPI_REQUEST_NULL. MPI_WAIT is a non-local operation. You can call MPI_WAIT with a null or inactive request argument. The operation returns immediately. The status argument returns tag = MPI_ANY_TAG, source = MPI_ANY_SOURCE. The status argument is also internally configured so that calls to MPI_GET_COUNT and MPI_GET_ELEMENTS return count = 0. This is called an empty status. Information on the completed operation is found in status. You can query the status object for a send or receive operation with a call to MPI_TEST_CANCELLED. For receive operations, you can also retrieve information from status with MPI_GET_COUNT and MPI_GET_ELEMENTS. If wildcards were used by the receive for either the source or tag, the actual source and tag can be retrieved by: In C: source = status.MPI_SOURCE tag = status.MPI_TAG In FORTRAN: source = status(MPI_SOURCE) tag = status(MPI_TAG) The error field of MPI_Status is never modified. The success or failure is indicated by the return code only. Passing MPI_STATUS_IGNORE for the status argument causes PE MPI to skip filling in the status fields. By passing this value for status, you can avoid having to allocate a status object in programs that do not need to examine the status fields. When one of the MPI wait or test calls returns status for a nonblocking operation request and the corresponding blocking operation does not provide a status argument, the status from this wait or test call does not contain meaningful source, tag, or message size information. When you use this subroutine in a threads application, make sure that the wait for a given request is done on only one thread. The wait does not have to be done on the thread that created the request. See IBM Parallel Environment for AIX: MPI Programming Guide for more information on programming with MPI in a threads environment. Parameters request is the request to wait for (handle) (INOUT) status is the status object (Status) (INOUT). Note that in FORTRAN a single status object is an array of integers. IERROR is the FORTRAN return code. It is always the last argument. Errors A GRequest free function returned an error A GRequest query function returned an error Invalid status ignore value Invalid form of status ignore Invalid request handle Truncation occurred MPI not initialized MPI already finalized Develop mode error if: Illegal buffer update (ISEND) Inconsistent datatype (MPE_I collectives) Inconsistent message length (MPE_I collectives) Inconsistent op (MPE_I collectives) Match of blocking and non-blocking collectives (MPE_I collectives) Related information MPI_TEST MPI_WAITALL MPI_WAITANY MPI_WAITSOME