MPIX_Send_enqueue(3)
π MPIX_Send_enqueue β bestie edition π
okay so picture this: you're in the MPI section 3 of the manual (MPIX_Send_enqueue(3)), and you've got a send that needs to go onto a GPU stream that's tied to your local stream. That's it. That's the whole vibe. Let's get into it. π¦
β¨ NAME β¨
MPIX_Send_enqueue β enqueue a send operation to a GPU stream that is associated with the local stream. π
πΈ SYNOPSIS πΈ
int MPIX_Send_enqueue(const void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm)
int MPIX_Send_enqueue_c(const void *buf, MPI_Count count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm)
π INPUT PARAMETERS π
bufβ the initial address of the send buffer. it's a choice, so like, you pick. (choice)countβ how many elements are chillin' in the send buffer. non-negative integer, pls. no negative counts, that's not the move. (non-negative integer)datatypeβ the datatype of each send buffer element. (handle)destβ rank of the destination, i.e. who's getting this message. (integer)tagβ message tag. your little label so the receiver knows what's up. (integer)commβ communicator. the group chat itself. (handle)
π§΅ THREAD AND INTERRUPT SAFETY π§΅
The way this routine is thread-safe?? iconic. that means multiple threads can use it safely with zero user-provided thread locks. no extra work from you, bestie, you're welcome. π«Ά
but β and I need you to hear me on this β it is not interrupt safe. not interrupt safe!! π typically this is because it uses memory allocation routines like malloc, or other non-MPICH runtime routines that themselves are not interrupt-safe. so like, don't come for it. π
π NOTES FOR FORTRAN π
fr fr, Fortran girlies, this one's for you:
- 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 are invoked with the
callstatement. - All MPI objects (e.g.,
MPI_Datatype,MPI_Comm) are of typeINTEGERin Fortran.
π ERRORS π
okay so every MPI routine (except MPI_Wtime and MPI_Wtick) returns 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, that error handler aborts the MPI job. yes, dramatic. π
you can swap that handler out 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 β deprecated, bestie, don't. the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. also note that MPI does not guarantee that an MPI program can continue past an error; however, MPI implementations will attempt to continue whenever possible. π
here's the whole roster:
MPI_SUCCESSβ no error; the MPI routine completed successfully. slay. β¨MPI_ERR_BUFFERβ invalid buffer pointer. usually a null buffer where one is not valid. π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β invalidcountargument. 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. (yes it really says "the the" in the source, I'm keeping it, character for character, that's the law π«‘)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.
reminder: this is the MPI section 3 manual, so go off, but keep your counts non-negative and your communicators non-null. π
that's the whole page, bestie. this one's from MPI, dated 4/10/2026, and you just read MPIX_Send_enqueue(3) β ate and left no crumbs. 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