MPIX_Isend_enqueue(3)
π MPIX_Isend_enqueue β bestie's guide to yeeting sends into a GPU stream π
okay so. This is MPIX_Isend_enqueue(3), a lil MPI-adjacent routine from the MPI manual. Its whole vibe? Enqueue a nonblocking send operation to a GPU stream that is associated with the local stream. That's it, that's the job. Slay.
β¨ NAME β¨
MPIX_Isend_enqueue β Enqueue a nonblocking send operation to a GPU stream that is associated with the local stream.
πΈ SYNOPSIS πΈ
int MPIX_Isend_enqueue(const void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm, MPI_Request *request)
int MPIX_Isend_enqueue_c(const void *buf, MPI_Count count,
MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, MPI_Request *request)
Two flavors, same energy: the regular one takes an int count, and the _c one takes an MPI_Count count because sometimes you have SO many elements and int could never. π
π«Ά INPUT PARAMETERS π«Ά
bufβ initial address of send buffer (choice)countβ number of elements in send buffer (non-negative integer)datatypeβ datatype of each send buffer element (handle)destβ rank of destination (integer)tagβ message tag (integer)commβ communicator (handle)
π OUTPUT PARAMETERS π
requestβ communication request (handle)
Like, you hand over your info, you get a request handle back. The main character of the interaction tbh.
π THREAD AND INTERRUPT SAFETY π
This routine is thread-safe. Meaning? Multiple threads can use it at the same time with zero user-provided thread locks needed. No gatekeeping, no drama, no locks. π§
BUT. It is not interrupt safe, bestie. Not even close. Typically this is because of memory allocation routines like malloc or other non-MPICH runtime routines that are themselves not interrupt-safe. So thread-safe? yes queen. Interrupt-safe? absolutely not, do not test it.
π 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 exact same meaning as the return value of the routine in C. Also, 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. That's just how it is over there.
π 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 the value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job π (yes, fr, it just ends everything).
The error handler may be changed 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 (old, retired, we don't do that anymore). 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 likeβ¦ fingers crossed. π€
Here's the full error roster:
MPI_SUCCESSβ No error; MPI routine completed successfully. The dream. β¨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_BUFFERβ Invalid buffer pointer. Usually a null buffer where one is not valid. A null buffer is NOT the moment.MPI_ERR_COMMβ Invalid communicator. A common error is to use a null communicator in a call (not 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 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. The vague one. The "it's giving mysterious" one. π
and that's the whole page bestie π that was MPIX_Isend_enqueue(3) from the MPI manual, dated 4/10/2026. go forth and enqueue responsibly. 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