MPIX_Stream_irecv(3)
π MPIX_Stream_irecv β from the MPI manual, section 3
okay bestie, listen up, this one is lowkey iconic β¨
πΈ NAME πΈ
MPIX_Stream_irecv β start a nonblocking receive from a specific source stream to a specific local stream. yes, streams. we're being β¨fancyβ¨ with it.
π SYNOPSIS π
int MPIX_Stream_irecv(void *buf, int count, MPI_Datatype datatype, int source,
int tag, MPI_Comm comm, int source_stream_index,
int dest_stream_index, MPI_Request *request)
int MPIX_Stream_irecv_c(void *buf, MPI_Count count, MPI_Datatype datatype,
int source, int tag, MPI_Comm comm,
int source_stream_index, int dest_stream_index,
MPI_Request *request)
two flavors, both slay: the regular one takes an int count, and the _c version takes an MPI_Count count. no cap. π
π«Ά INPUT PARAMETERS π«Ά
countβ how many elements are chillin' in the receive buffer (non-negative integer, so zero and up only, bestie).datatypeβ the datatype of each receive buffer element (handle).sourceβ the rank of the source, orMPI_ANY_SOURCEif you're feeling open-minded (integer).tagβ the message tag, orMPI_ANY_TAGif you're playing it chill (integer).commβ the communicator (handle).source_stream_indexβ the source stream index (integer). yes it's literally just that.dest_stream_indexβ the destination stream index (integer). and that.
π OUTPUT PARAMETERS π
bufβ the initial address of the receive buffer (choice).requestβ the communication request (handle). you WILL be needing this later to check on it. it's giving "don't leave me on read".
π§΅ THREAD AND INTERRUPT SAFETY π§΅
this routine is thread-safe, periodt. that means multiple threads can use it at the same time and you do NOT have to bring your own thread locks, you can just go off. π
BUT β and this is the important part, so pay attention β it is not interrupt safe. typically that's because of memory allocation routines like malloc, or other non-MPICH runtime routines that aren't interrupt-safe themselves. so no interrupting, babe. π
π¦ NOTES FOR FORTRAN π¦
all MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK) get an extra argument called ierr stuck on the end of the argument list. ierr is an integer and 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 call statement. so cute, so retro. π
also: all MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. yes, all of them. fr fr.
π ERRORS π
okay so, every MPI routine (except MPI_Wtime and MPI_Wtick) returns an error value β C routines as the return value of the function, and Fortran routines 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. π so yeah. dramatic.
you can swap the error handler with:
MPI_Comm_set_errhandlerfor communicatorsMPI_File_set_errhandlerfor filesMPI_Win_set_errhandlerfor RMA windows
the MPI-1 routine MPI_Errhandler_set may also be used, but its use is deprecated (we don't do that anymore, bestie). and the predefined error handler MPI_ERRORS_RETURN can be used to make error values actually get returned to you instead.
heads up: MPI does not guarantee that an MPI program can continue past an error. the implementations will try to continue whenever possible, but likeβ¦ no promises. π«
here's the error code menu:
MPI_SUCCESSβ no error! the MPI routine completed successfully. we love to see it. π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 a null buffer is not valid.MPI_ERR_COMMβ invalid communicator. a very common oopsie is using a null communicator in a call (which is 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. also, this error can happen if an uncommittedMPI_Datatype(seeMPI_Type_commit) is used in a communication call. commit your types, bestie.MPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code.
and that's the whole page, angel π
this was MPIX_Stream_irecv(3) from the MPI manual, dated 4/10/2026. go forth and receive nonblockingly, my love. 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