/*D
   MPI_Waitsome - Waits for some given MPI Requests to complete

Synopsis:
.vb
int MPI_Waitsome(int incount, MPI_Request array_of_requests[], int *outcount,
                 int array_of_indices[], MPI_Status *array_of_statuses)
.ve

Input Parameters:
. incount - length of array_of_requests (non-negative integer)

Input/Output Parameters:
. array_of_requests - array of requests (handle)

Output Parameters:
+ outcount - number of completed requests (integer)
. array_of_indices - array of indices of operations that completed (integer)
- array_of_statuses - array of status objects for operations that completed (Status)

Notes:
The array of indices are in the range '0' to 'incount - 1' for C and
in the range '1' to 'incount' for Fortran.

Null requests are ignored; if all requests are null, then the routine
returns with 'outcount' set to 'MPI_UNDEFINED'.

While it is possible to list a request handle more than once in the
array_of_requests, such an action is considered erroneous and may cause the
program to unexecpectedly terminate or produce incorrect results.

'MPI_Waitsome' provides an interface much like the Unix 'select' or 'poll'
calls and, in a high qualilty implementation, indicates all of the requests
that have completed when 'MPI_Waitsome' is called.
However, 'MPI_Waitsome' only guarantees that at least one
request has completed; there is no guarantee that `all` completed requests
will be returned, or that the entries in 'array_of_indices' will be in
increasing order. Also, requests that are completed while 'MPI_Waitsome' is
executing may or may not be returned, depending on the timing of the
completion of the message.

.N waitstatus

.N ThreadSafe

.N Fortran

.N Errors
.N MPI_SUCCESS
.N MPI_ERR_ARG
.N MPI_ERR_COUNT
.N MPI_ERR_REQUEST
.N MPI_ERR_OTHER

D*/

