MPI_Isend(3)
π 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 inbuf.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 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 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.
π 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
- 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