MPIX_Grequest_start(3)
π MPIX_Grequest_start π
okay bestie, welcome to the MPI manual page for MPIX_Grequest_start β yes that manual name is literally right there in the corner, we keep it, we love it, we move on π
β¨ NAME β¨
MPIX_Grequest_start β create and return a user-defined extended request π«Ά
πΈ SYNOPSIS πΈ
int MPIX_Grequest_start(MPI_Grequest_query_function *query_fn,
MPI_Grequest_free_function *free_fn,
MPI_Grequest_cancel_function *cancel_fn,
MPIX_Grequest_poll_function *poll_fn,
MPIX_Grequest_wait_function *wait_fn, void *extra_state,
MPI_Request *request)
π INPUT PARAMETERS π
query_fnβ the callback function that gets invoked when the request status is queried (it's a function, okay bestie, it's giving function energy)free_fnβ the callback function that gets invoked when the request is freed (function)cancel_fnβ the callback function that gets invoked when the request is cancelled (function)poll_fnβ the callback function that gets invoked when request completion is tested (function)wait_fnβ the callback function that gets invoked when the request is waited on (function)extra_stateβ extra state (None)
π OUTPUT PARAMETERS π
requestβ generalized request (handle) β¨
π§΅ THREAD AND INTERRUPT SAFETY π§΅
This routine is thread-safe. Which means β and I need you to hear me on this β it can safely be used by multiple threads without you having to build any user-provided thread locks yourself. no cap, you just vibe π
However (and this is the lowkey part, bestie π), the routine is not interrupt safe. Typically this is because it uses memory allocation routines like malloc, or other non-MPICH runtime routines, that are themselves not interrupt-safe. so likeβ¦ thread safe yes, interrupt safe no, it's giving complicated π
πΊ NOTES FOR FORTRAN πΊ
All MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK) have an additional argument ierr at the end of the argument list. ierr is an integer and has the same meaning as the return value of the routine in C. In Fortran, MPI routines are subroutines, and they're invoked with the call statement. periodt π
All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. yes, all of them, in Fortran. iconic behavior honestly π
π ERRORS π
All MPI routines (except MPI_Wtime and MPI_Wtick) return an error value β C routines as the value of the function and Fortran routines in the last argument. Before that value comes back, the current MPI error handler gets called. By default, this error handler aborts the MPI job π (dramatic, but that's literally what it does).
The error handler may be changed with:
MPI_Comm_set_errhandlerβ for communicatorsMPI_File_set_errhandlerβ for filesMPI_Win_set_errhandlerβ for RMA windows
The MPI-1 routine MPI_Errhandler_set may be used but its use is deprecated π. 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; however, MPI implementations will attempt to continue whenever possible. they're trying their best, bestie π«Ά
MPI_SUCCESSβ no error; MPI routine completed successfully βMPI_ERR_ARGβ invalid argument. Some argument is invalid and is not identified by a specific error class (e.g.,MPI_ERR_RANK) πMPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code π
reminder bestie: those callback signatures and handles go in exactly as written, no renaming, no improvising, ok? iykyk π
and that's the whole page!! stay slay, write good callbacks, and remember β this one landed in your hands via the MPI manual, dated 4/10/2026, filed under MPIX_Grequest_start(3) πΈπ¦ bye bestie π
π¦ where this page comes from
- nixos 26.05: mpich 5.0.1
- ubuntu stonking: mpich-doc 5.0.1-9 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms