mpi-forum / mpi-issues

Tickets for the MPI Forum
http://www.mpi-forum.org/
67 stars 8 forks source link

Behavior of MPI_ERR_PENDING underspecified #841

Open devreal opened 8 months ago

devreal commented 8 months ago

Problem

The text for MPI_WAITALL (Section 3.7.5, page 86) is the only place where MPI_ERR_PENDING is mentioned in the text itself (and serves as main index entry).

The text says on requests in general:

Active persistent requests are marked inactive. Requests of any other type are deallocated and the corresponding handles in the array are set to MPI_REQUEST_NULL.

This paragraph introduces MPI_ERR_PENDING:

When one or more of the communication operations completed by a call to MPI_WAITALL fail, it is desirable to return specific information on each communication. The function MPI_WAITALL will return in such case the error code MPI_ERR_IN_STATUS and will set the error field of each status to a specific error code. This code will be MPI_SUCCESS, if the specific communication completed; it will be another specific error code, if it failed; or it can be MPI_ERR_PENDING if it has neither failed nor completed.

The text makes no mention of what happens to these pending requests and there is no other place (I can find) throughout the document that explains it. Intuitively, pending requests should be returned to the caller who then decides what to do with it but that needs to be stated explicitly.

Proposal

The text should be amended to describe the semantics of MPI_ERR_PENDING and what applications should expect happens if they see the error.

Changes to the Text

Add language like the following:

When one or more of the communication operations completed by a call to MPI_WAITALL fail, it is desirable to return specific information on each communication. The function MPI_WAITALL will return in such case the error code MPI_ERR_IN_STATUS and will set the error field of each status to a specific error code. This code will be MPI_SUCCESS, if the specific communication completed; it will be another specific error code, if it failed; or it can be MPI_ERR_PENDING if it has neither failed nor completed. In the latter case, the corresponding request handle will not be reset to MPI_REQUEST_NULL.

Impact on Implementations

Check handling of MPI_ERR_PENDING.

Impact on Users

Clarity on how pending requests are to be handled if an error occurs.

References and Pull Requests

TBD