MPI_GREQUEST_COMPLETE(3)
π MPI_Grequest_complete β that's an Open MPI man page, bestie π
okay so. You know how MPI needs to know when your little custom operation is DONE? That's literally this function. MPI_Grequest_complete reports that a generalized request is complete. That's the whole vibe. Let's get into it β¨
β¨ SYNTAX β¨
C Syntax π
#include <mpi.h>
int MPI_Grequest_complete(MPI_Request request)
Fortran Syntax πΈ
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_GREQUEST_COMPLETE(REQUEST, IERROR)
INTEGER REQUEST, IERROR
Fortran 2008 Syntax π¦
USE mpi_f08
MPI_Grequest_complete(request, ierror)
TYPE(MPI_Request), INTENT(IN) :: request
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT/OUTPUT PARAMETER π
requestβ your generalized request, i.e. the handle. That's it, that's the girl.
π OUTPUT PARAMETER π
ierrorβ Fortran only, bestie: the error status, and it's an integer.
π DESCRIPTION π
So here's the tea, fr fr: MPI_Grequest_complete tells MPI that the operations represented by the generalized request request are complete. Like, done done. No cap. And the way that this matters is:
- a call to
MPI_Wait(request, status)will return, and - a call to
MPI_Test(request, flag, status)will returnflag=true
β¦only after a call to MPI_Grequest_complete has declared that those operations are complete. So it's giving "the finish line has been crossed, you may now proceed." π
MPI imposes no restrictions on the code executed by the callback functions. Like, zero. Run wild. BUT β and this is the important part, don't skip it β new nonblocking operations should be defined so that the general semantic rules about MPI calls such as MPI_Test, MPI_Request_free, or MPI_Cancel still hold.
For example (and this is literally the example, not me making stuff up): all these calls are supposed to be local and nonblocking. Therefore, the callback functions query_fn, free_fn, or cancel_fn should invoke blocking MPI communication calls only if the context is such that these calls are guaranteed to return in finite time. Once MPI_Cancel has been invoked, the canceled operation should complete in finite time, regardless of the state of other processes β basically, the operation has acquired "local" semantics. It should either succeed or fail without side-effects. And the user should guarantee these same properties for newly defined operations.
β οΈ Bestie, read that last paragraph again. The callback functions are YOUR problem, not MPI's. If you block forever in there, that's on you. π
π ERRORS π
Almost all MPI routines return an error value, okay? For C routines, it's the return result of the function. For Fortran routines, it's in the last argument. Classic.
Before the error value is returned, the current MPI error handler associated with the communication object (e.g., communicator, window, file) is called. If no communication object is associated with the MPI call, then the call is considered attached to MPI_COMM_SELF and will call the associated MPI error handler.
When MPI_COMM_SELF is not initialized (i.e., before MPI_Init/MPI_Init_thread, after MPI_Finalize, or when using the Sessions Model exclusively) the error raises the initial error handler. And the initial error handler can be changed by:
- calling
MPI_Comm_set_errhandleronMPI_COMM_SELFwhen using the World model, or - the
mpi_initial_errhandlerCLI argument tompiexec, or - the info key to
MPI_Comm_spawn/MPI_Comm_spawn_multiple.
If no other appropriate error handler has been set, then the MPI_ERRORS_RETURN error handler is called for MPI I/O functions and the MPI_ERRORS_ABORT error handler is called for all other MPI functions.
Open MPI includes three predefined error handlers that can be used:
MPI_ERRORS_ARE_FATALβ Causes the program to abort all connected MPI processes. πMPI_ERRORS_ABORTβ An error handler that can be invoked on a communicator, window, file, or session. When called on a communicator, it acts as ifMPI_Abortwas called on that communicator. If called on a window or file, acts as ifMPI_Abortwas called on a communicator containing the group of processes in the corresponding window or file. If called on a session, aborts only the local process.MPI_ERRORS_RETURNβ Returns an error code to the application. π«Ά
MPI applications can also implement their own error handlers by calling:
MPI_Comm_create_errhandlerthenMPI_Comm_set_errhandlerMPI_File_create_errhandlerthenMPI_File_set_errhandlerMPI_Session_create_errhandlerthenMPI_Session_set_errhandleror atMPI_Session_initMPI_Win_create_errhandlerthenMPI_Win_set_errhandler
β οΈ Note that MPI does not guarantee that an MPI program can continue past an error. Not a vibe. Plan accordingly. π
See the MPI man page for a full list of MPI error codes. And see the Error Handling section of the MPI-3.1 standard for more information.
π Copyright π
2003-2026, The Open MPI Community
and that's the whole page, bestie!! this was MPI_GREQUEST_COMPLETE(3), an Open MPI page, dated Sep 10, 2026 β go forth and complete your generalized requests, you absolute main character ππ
π¦ where this page comes from
- ubuntu stonking: openmpi-doc 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms