MPIX_Irecv_enqueue(3)
π MPIX_Irecv_enqueue(3) β the MPI manual, bestie edition π
okay so. welcome to the MPI manual page for MPIX_Irecv_enqueue, and yes this is section 3, we're in library-call territory, slay. buckle up buttercup, we're queueing nonblocking receives onto GPU streams today β¨
πΈ NAME πΈ
MPIX_Irecv_enqueue β enqueue a nonblocking receive operation to a GPU stream that is associated with the local stream π
(it's giving "async receive but make it GPU-coded", fr fr)
β¨ SYNOPSIS β¨
int MPIX_Irecv_enqueue(void *buf, int count, MPI_Datatype datatype, int source,
int tag, MPI_Comm comm, MPI_Request *request)
int MPIX_Irecv_enqueue_c(void *buf, MPI_Count count, MPI_Datatype datatype,
int source, int tag, MPI_Comm comm,
MPI_Request *request)
lowkey note that there's two of them β the regular one and the_cone with the bigMPI_Countcount β and the code above is verbatim, don't @ me, copy it character for character π
π¦ INPUT PARAMETERS π¦
countβ number of elements in the receive buffer, and it's gotta be a non-negative integer, so no negative shenanigans πdatatypeβ the datatype of each receive buffer element (it's a handle, bestie)sourceβ rank of the source, orMPI_ANY_SOURCEif you're feeling chaotic (integer)tagβ the message tag, orMPI_ANY_TAG(integer)commβ the communicator (handle)
π OUTPUT PARAMETERS π
bufβ initial address of the receive buffer (choice)requestβ the communication request (handle)
π₯ THREAD AND INTERRUPT SAFETY π₯
periodt, this routine is thread-safe. that means you can hit it from multiple threads at the same time and not need any user-provided thread locks β no cap, she's built for that π«Ά
b u t β she is not interrupt safe. the way that usually happens is because of 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 π
π NOTES FOR FORTRAN π
every single MPI routine in Fortran (except for MPI_WTIME and MPI_WTICK) gets an extra argument called ierr tacked on at the end of the argument list. ierr is an integer and it means exactly the same thing as the return value of the routine in C. also, in Fortran, MPI routines are subroutines, and you invoke them with the call statement. iconic behavior honestly.
and all MPI objects (like MPI_Datatype, MPI_Comm, etc.) are of type INTEGER in Fortran. yes, all of them. π§
π ERRORS π
every MPI routine (except MPI_Wtime and MPI_Wtick) returns an error value β C routines give it back as the value of the function, Fortran routines put it in that last argument. before the value comes back to you, the current MPI error handler gets called. by default, that error handler aborts the MPI job (dramatic, I know π). you can swap the error handler with MPI_Comm_set_errhandler (for communicators), MPI_File_set_errhandler (for files), and MPI_Win_set_errhandler (for RMA windows). the MPI-1 routine MPI_Errhandler_set may be used but its use is deprecated, so like, don't. 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. so, fingers crossed π€
here's the error lineup, one by one:
MPI_SUCCESSβ no error, the MPI routine completed successfully πMPI_ERR_ARGβ invalid argument. some argument is invalid and isn't identified by a specific error class (e.g.,MPI_ERR_RANK).MPI_ERR_BUFFERβ invalid buffer pointer. usually a null buffer where one is not valid.MPI_ERR_COMMβ invalid communicator. a common one is using a null communicator in a call (which isn't even allowed inMPI_Comm_rank).MPI_ERR_COUNTβ invalid count argument. count arguments must be non-negative; a count of zero is often valid.MPI_ERR_RANKβ invalid source or destination rank. ranks must be between zero and the size of the communicator minus one; ranks in a receive (MPI_Recv,MPI_Irecv,MPI_Sendrecv, etc.) may also beMPI_ANY_SOURCE.MPI_ERR_TAGβ invalid tag argument. tags must be non-negative; tags in a receive (MPI_Recv,MPI_Irecv,MPI_Sendrecv, etc.) may also beMPI_ANY_TAG. the largest tag value is available through the the attributeMPI_TAG_UB.MPI_ERR_TYPEβ invalid datatype argument. additionally, this error can occur if an uncommittedMPI_Datatype(seeMPI_Type_commit) is used in a communication call.MPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code.
ok that's genuinely a lot of ways to fail, vibe check accordingly π
π fin π
and that's the whole page, bestie, no skips, no shortcuts. this was MPIX_Irecv_enqueue(3) from the MPI manual, dated 4/10/2026, and you can find her under that same name in section 3. go forth and enqueue responsibly πβ¨ππ¦πΈπ
π«Ά
π¦ 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