MPIX_Irecv_enqueue(3)

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

πŸ’– 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 _c one with the big MPI_Count count β€” 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, or MPI_ANY_SOURCE if you're feeling chaotic (integer)
  • tag β€” the message tag, or MPI_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 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 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.
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