MPI_Rsend(3)
π MPI_Rsend β blocking ready send π
okay bestie, welcome to the MPI manual page for MPI_Rsend. yes that's the section, three whole pages of collective-communication goodness, and we're gonna read it together like it's a group chat at 2am. grab a snack. π
β¨ NAME β¨
MPI_Rsend β Blocking ready send. that's it, that's the whole name. she's blocking, she's ready, and she sends. π
πΈ SYNOPSIS πΈ
int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest,
int tag, MPI_Comm comm)
int MPI_Rsend_c(const void *buf, MPI_Count count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm)
two flavors, both iconic. the _c one is for when your count is a big ol' MPI_Count instead of a regular int. slay. π
π¦ INPUT PARAMETERS π¦
the whole friend group, one by one:
bufβ initial address of send buffer (choice). this is where your stuff lives, bestie. πcountβ number of elements in send buffer (non-negative integer). not negative. i'm serious. πdatatypeβ datatype of each send buffer element (handle). it's giving "what even are these elements". πdestβ rank of destination (integer). who's getting the message. πtagβ message tag (integer). the lil label so your receiver knows what's up. π·οΈcommβ communicator (handle). the friend group they're both in. π«Ά
π THREAD AND INTERRUPT SAFETY π
ok so: this routine is thread-safe. which means multiple threads can use it at the same time with zero user-provided thread locks needed. no cap. it just works. β¨
BUT. and this is the important but β it's not interrupt safe. typically that's because of memory allocation routines like malloc, or other non-MPICH runtime routines that themselves aren't interrupt-safe. so like, thread-safe: yes. interrupt-safe: absolutely not, bestie. π
π§ NOTES FOR FORTRAN π§
for the Fortran girlies (affectionate) π:
- every MPI routine in Fortran has an extra argument called
ierrat the end of the argument list β the only exceptions areMPI_WTIMEandMPI_WTICK.ierris an integer and it means exactly the same thing as the return value of the routine in C. - in Fortran, MPI routines are subroutines, and you invoke them with the
callstatement. periodt. - all MPI objects (e.g.,
MPI_Datatype,MPI_Comm) are of typeINTEGERin Fortran. yes, even the fancy ones. π
π₯ ERRORS π₯
every MPI routine (except MPI_Wtime and MPI_Wtick) returns an error value β C routines hand it back as the function's value, and Fortran routines put it in that last argument. before the value even comes back, the current MPI error handler gets called. by default? that handler aborts the MPI job. like, whole thing, gone, bye. π
you can swap the error handler out with:
MPI_Comm_set_errhandlerβ for communicatorsMPI_File_set_errhandlerβ for filesMPI_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, fr fr). and if you want error values returned instead of the job dying, use the predefined error handler MPI_ERRORS_RETURN. π
heads up though: MPI does not guarantee that an MPI program can continue past an error. however, implementations will attempt to continue whenever possible. so like, they'll try. no promises. π«Ά
here's the whole roster of error codes:
MPI_SUCCESSβ no error, MPI routine completed successfully. the dream. β¨MPI_ERR_BUFFERβ invalid buffer pointer. usually a null buffer where one is not valid. bestie why is it null. πMPI_ERR_COMMβ invalid communicator. a common error is using 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 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. the mystery box of errors. π
okay that's the whole page, you ate that. π no skimming, i saw you.
and that's a wrap, bestie!! this was MPI_Rsend(3) from the MPI manual, dated 4/10/2026 β go forth and ready-send responsibly, 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