MPIX_Wait_enqueue(3)
π 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_WTIMEandMPI_WTICK) have an additional argumentierrat the end of the argument list. ierris 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
callstatement. periodt. - All MPI objects (e.g.,
MPI_Datatype,MPI_Comm) are of typeINTEGERin 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 communicatorsMPI_File_set_errhandlerβ for filesMPI_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β invalidMPI_Request. either null or, in the case of aMPI_StartorMPI_Startall, not a persistent request. πMPI_ERR_OTHERβ other error; useMPI_Error_stringto 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
- 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