This operation allows a request object to be deallocated without waiting for the associated communication to complete.
.sp
MPI_Request_free marks the request object for deallocation and sets request
to MPI_REQUEST_NULL. Any ongoing communication that is associated with the request will be allowed to complete. The request will be deallocated only after its completion.
.SHNOTES
Once a request is freed by a call to MPI_Request_free, it is not possible to check for the successful completion of the associated communication with calls to MPI_Wait or MPI_Test. Also, if an error occurs subsequently during the communication, an error code cannot be returned to the user -- such an error must be treated as fatal. Questions arise as to how one knows when the operations have completed when using MPI_Request_free. Depending on the program logic, there may be other ways in which the program knows that certain operations have completed and this makes usage of MPI_Request_free practical. For example, an active send request could be freed when the logic of the program is such that the receiver sends a reply to the message sent -- the arrival of the reply informs the sender that the send has completed and the send buffer can be reused. An active receive request should never be freed, as the receiver will have no way to verify that the receive has completed and the receive buffer can be reused.
This routine is normally used to free persistent requests created with
either
.IMPI_Recv_init
or
.IMPI_Send_init
and friends. However, it can be
used to free a request created with
.IMPI_Irecv
or
.IMPI_Isend
and friends;
in that case the use can not use the test/wait routines on the request.
It
.Bis
permitted to free an active request. However, once freed, you can not
use the request in a wait or test routine (e.g.,
.IMPI_Wait
).
.SHERRORS
Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ functions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI:Exception object.
.sp
Before the error value is returned, the current MPI error handler is
called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error.