MPIX_Isend_enqueue(3)

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

πŸ’– 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 in MPI_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 be MPI_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 be MPI_ANY_TAG. The largest tag value is available through the attribute MPI_TAG_UB.
  • MPI_ERR_TYPE β€” Invalid datatype argument. Additionally, this error can occur if an uncommitted MPI_Datatype (see MPI_Type_commit) is used in a communication call.
  • MPI_ERR_OTHER β€” Other error; use MPI_Error_string to 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