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 communicators
  • MPI_File_set_errhandler β€” for files
  • MPI_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; use MPI_Error_string to 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