MPI_WAITANY, MPI_Waitany Purpose Waits for any specified nonblocking operation to complete. C synopsis #include int MPI_Waitany(int count,MPI_Request *array_of_requests, int *index,MPI_Status *status); C++ synopsis #include mpi.h int MPI::Request::Waitany(int count, MPI::Request array[]); #include mpi.h int MPI::Request::Waitany(int count, MPI::Request array[], MPI::Status& status); FORTRAN synopsis include 'mpif.h' or use mpi MPI_WAITANY(INTEGER COUNT,INTEGER ARRAY_OF_REQUESTS(*),INTEGER INDEX, INTEGER STATUS(MPI_STATUS_SIZE),INTEGER IERROR) Description This subroutine blocks until one of the operations associated with the active requests in the array has completed. If more than one operation can complete, one is arbitrarily chosen. MPI_WAITANY returns in index the index of that request in the array, and in status the status of the completed operation. When the request is allocated by a nonblocking operation, it is deallocated and the request handle is set to MPI_REQUEST_NULL. The array_of_requests list can contain null or inactive handles. When the list has a length of zero or all entries are null or inactive, the call returns immediately with index = MPI_UNDEFINED, and an empty status. MPI_WAITANY(count, array_of_requests, index, status) has the same effect as the execution of MPI_WAIT(array_of_requests[i], status), where i is the value returned by index. MPI_WAITANY with an array containing one active entry is equivalent to MPI_WAIT. 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 it. See IBM Parallel Environment for AIX: MPI Programming Guide for more information on programming with MPI in a threads environment. Parameters count is the list length (integer) (IN) array_of_requests is the array of requests (array of handles) (INOUT) index is the index of the handle for the operation that completed (integer) (OUT) status 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. Notes The array is indexed from 0 in C and from 1 in FORTRAN. 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 count count < 0 Invalid requests array Invalid request(s) 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_TESTANY MPI_WAIT