MPI_Isend(3)

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

πŸ’– MPI_Isend(3) β€” bestie, you're about to send a message and NOT wait around for it πŸ’…

okay so, this page lives in the MPI manual, and it's section 3, and it's literally about the moment you fire off a message into the void and then go do your own thing. main character energy fr fr.


✨ NAME ✨

MPI_Isend β€” Begins a nonblocking send πŸš€

lowkey the whole point: you start a send, you get a request back, and you keep it moving. no sitting around, no blocking, no "wait for meee" behavior. periodt.

🌸 SYNOPSIS 🌸

int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest,
int tag, MPI_Comm comm, MPI_Request *request)

int MPI_Isend_c(const void *buf, MPI_Count count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm, MPI_Request *request)

yes bestie, there's a _c variant, and the only glow-up is that count is an MPI_Count instead of an int. iconic. πŸ‘‘


πŸŽ€ INPUT PARAMETERS πŸŽ€

  • buf β€” initial address of send buffer (choice). it's giving "here's where my stuff lives."
  • count β€” number of elements in send buffer (non-negative integer). do NOT be negative, that's not the vibe.
  • datatype β€” datatype of each send buffer element (handle). this is what tells MPI how to read the bytes in buf.
  • dest β€” rank of destination (integer). who's getting the message, bestie.
  • tag β€” message tag (integer). your little label so the receiver knows which message this is.
  • comm β€” communicator (handle). the group chat this is all happening in.

πŸ¦‹ OUTPUT PARAMETERS πŸ¦‹

  • request β€” communication request (handle). ✨ hold onto this ✨ you need it later to check on or finish the send. this is your receipt.

πŸ”₯ THREAD AND INTERRUPT SAFETY πŸ”₯

This routine is thread-safe. Translation: multiple threads can use it at the same time and you do NOT need to write your own user-provided thread locks. go off, multithreading queen. πŸ’…

BUT. it is not interrupt safe. 🚨 typically this is because it uses memory allocation routines like malloc, or other non-MPICH runtime routines, and those are themselves not interrupt-safe. so don't be interrupted mid-vibe, iykyk.

🌈 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 same meaning as the return value of the routine in C.

In Fortran, MPI routines are subroutines, and they are invoked with the call statement.

All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. no cap. 🫢


πŸ’€ 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, the whole thing. dramatic but true.

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. ⚠️ (deprecated = don't start anything new with it, bestie.)

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. πŸ™

here's the whole error roster, no skipping:

  • MPI_SUCCESS β€” No error; MPI routine completed successfully. πŸŽ‰ ate.
  • 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.
  • 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 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.

🌟 SEE ALSO 🌟

okay so this page didn't hand us a SEE ALSO list, but the error descriptions above do shout out MPI_Recv, MPI_Irecv, MPI_Sendrecv, MPI_Comm_rank, MPI_Type_commit, MPI_Error_string, MPI_Wtime, MPI_Wtick, MPI_WTIME, MPI_WTICK, MPI_Comm_set_errhandler, MPI_File_set_errhandler, MPI_Win_set_errhandler, and MPI_Errhandler_set β€” so that's your reading list, bestie. πŸ“š


and that's the whole page!! πŸ’– this one came from the MPI source, dated 4/10/2026, and it's MPI_Isend(3). go start that nonblocking send, hold your request, and slay. πŸŒΈπŸ¦‹βœ¨ periodt.

πŸ“¦ where this page comes from