MPIX_Wait_enqueue(3)

πŸ“¦
version 5.0.1 Β· 4 versions
, in nixos 26.05, ubuntu stonking

πŸ’– MPIX_Wait_enqueue(3) β€” the MPI glow-up manual πŸ’–

okay bestie, pull up a chair, we're doing MPIX_Wait_enqueue(3) from the MPI manual and honestly? it's giving low-key but essential. this is the one that hands a wait operation over to a GPU stream that's tied to your local stream. no cap, it's a whole vibe.


✨ NAME ✨

MPIX_Wait_enqueue β€” enqueue a wait operation to a GPU stream that is associated with the local stream 🫢


✨ SYNOPSIS ✨

int MPIX_Wait_enqueue(MPI_Request *request, MPI_Status *status)

✨ INPUT/OUTPUT PARAMETERS ✨

  • request β€” your request (handle). it goes in, and it's very much in its input/output era πŸ’…

✨ OUTPUT PARAMETERS ✨

  • status β€” a status object (Status). this is where the tea gets spilled back to you πŸŽ€

🧡 THREAD AND INTERRUPT SAFETY 🧡

okay so this routine is thread-safe. translation: multiple threads can use it at the same time and you do not need to bring your own user-provided thread locks. she's self-sufficient, she's independent, iconic behavior πŸ’…βœ¨

BUT β€” and this is the plot twist β€” the routine is not interrupt safe. typically that's 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. read the room 😭


🌈 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. ✨

πŸ’€ ERRORS πŸ’€

okay so here's the deal with basically every MPI routine (except MPI_Wtime and MPI_Wtick): they all return an error value. C routines give it back as the value of the function, Fortran routines put it in that last argument. before that value comes back to you, the current MPI error handler gets called. by default, that error handler aborts the MPI job β€” like, full main character exit. πŸšͺπŸ’₯

want to change the handler? you can:

  • MPI_Comm_set_errhandler β€” for communicators
  • MPI_File_set_errhandler β€” for files
  • MPI_Win_set_errhandler β€” for RMA windows

there's also the MPI-1 routine MPI_Errhandler_set, but its use is deprecated β€” so like, don't, bestie. πŸ™ˆ

and if you'd rather have error values returned to you instead of the whole job getting nuked, you can use the predefined error handler MPI_ERRORS_RETURN.

⚠️ heads up: MPI does not guarantee that an MPI program can continue past an error. however, MPI implementations will attempt to continue whenever possible. so... fingers crossed, no promises. 🫢

and here are the error codes, gorgeous:

  • MPI_SUCCESS β€” no error; MPI routine completed successfully. slay! βœ…
  • MPI_ERR_ARG β€” invalid argument. some argument is invalid and it isn't identified by a specific error class (e.g., MPI_ERR_RANK). it's giving vague on purpose πŸ’€
  • MPI_ERR_REQUEST β€” invalid MPI_Request. either null or, in the case of a MPI_Start or MPI_Startall, not a persistent request. πŸ™ˆ
  • MPI_ERR_OTHER β€” other error; use MPI_Error_string to get more information about this error code. the classic "it's complicated" 🌸

and that's the whole page, bestie!! you just read MPIX_Wait_enqueue(3) from the MPI manual, dated 4/10/2026, and this whole manifest was brought to you by the MPI docs. go forth, enqueue your wait, and know that i am so proud of you. πŸ’–βœ¨πŸŽ€πŸ¦‹ mwah!

πŸ“¦ where this page comes from