===========================================================================
A call to complete a generalized request via MPI_TEST, MPI_WAIT, or any
of their derived calls, will succeed only after the request was marked
complete and was successfully completed, or after the request was marked
for cancelation and the cancellation was successful; in all other cases,
the call will return an error code.
When a request has been marked as complete or for cancellation, the
query_fn and free_fn will be invoked, in this order, for each request
examined by the MPI_{TEST|WAIT} call. The \mpiarg{status} returned by
each query_fn invocation will be returned to the user by the
MPI_{WAIT|TEST}{ANY|SOME|ALL} call.
For requests marked for cancellation, the \mpiarg{status} returned by
the query_fn and MPI_{TEST|WAIT}{ANY|SOME|ALL} will be such that
MPI_TEST_CANCELLED will return flag==true if the request was successfully
cancelled, and flag==false otherwise.
For MPI_{TEST|WAIT} or MPI{TEST|WAIT}{ANY}, if the request completed
unsuccessfully, the query_fn will not change the \mpiarg{status} (i.e.,
it will be undefined).
For MPI_{TEST|WAIT}{SOME|ALL}, if any request did not complete
successfully, the query_fn will return an error code in the error field
of the \mpiarg{status} argument, and MPI_{TEST|WAIT}{SOME|ALL}
will return MPI_ERR_IN_STATUS.
===========================================================================
That is, I see the following cases:
request status returned status return value {TEST|WAIT}*
-------------- --------------- -------------------------
not marked undefined ! MPI_SUCCESS
marked cancel; TEST_CANCELLED's MPI_SUCCESS
successful flag == true
marked cancel; TEST_CANCELLED's ! MPI_SUCCESS
unsuccessful flag == false
marked complete; normal status MPI_SUCCESS
successful
marked complete; error code in {SOME|ALL} - MPI_ERR_IN_STATUS
unsuccessful error field Otherwise - ! MPI_SUCCESS
Note that the current spec is not consistent with MPI_{TEST|WAIT}{ANY}
for nongeneralized requests since it requires that an error code be
returned in the status arg -and- the return value of the MPI_{TEST|WAIT},
rather than leaving the status undefined. The proposed revision would
modify this so that we are consistent with section 3.2.3 of MPI-2. (I
would have preferred that we return a defined status with an error code
and MPI_ERR_IN_STATUS for all these cases, but then I read 3.2.3!)
I assume that the return values of the query_fn, free_fn, and cancel_fn
are irrelevant and will be ignored by MPI_{TEST|WAIT|REQUEST_FREE|CANCEL|
REQUEST_GET_STATUS}. That is, it's assumed these functions can't fail?
Have I got this right?
Linda