MPIX_Stream_comm_create(3)
π MPIX_Stream_comm_create(3) π
okay bestie, welcome to the MPI manual, section 3, and today's main character is MPIX_Stream_comm_create π β no cap, this one's a whole vibe.
β¨ NAME β¨
MPIX_Stream_comm_create β create a new communicator with a local stream attached π¦
β¨ SYNOPSIS β¨
int MPIX_Stream_comm_create(MPI_Comm comm, MPIX_Stream stream,
MPI_Comm *newcomm)
β¨ INPUT PARAMETERS β¨
commβ a communicator (handle). yes queen, we start here πstreamβ a stream object (handle). the whole point of the function, honestly π
β¨ OUTPUT PARAMETERS β¨
newcommβ the new stream-associated communicator (handle). she's brand new, she's got a stream, she's slaying π
β¨ THREAD AND INTERRUPT SAFETY β¨
This routine is thread-safe π«Ά. What that means for you: multiple threads can call it at the same time with zero user-provided thread locks needed. Go off, multithreaded queen.
But β and this is the important part, so listen up β the routine is not interrupt safe π. Typically that's because of memory allocation routines like malloc, or other non-MPICH runtime routines that are themselves not interrupt-safe. not their fault, they're just like that.
πΈ NOTES FOR FORTRAN πΈ
Every 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. iykyk.
In Fortran, MPI routines are subroutines, and you invoke them with the call statement. that's just the rules π
Also, all MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. iconic behavior tbh.
π ERRORS π
Every MPI routine (except MPI_Wtime and MPI_Wtick) returns an error value. In C routines it's the value of the function, and in Fortran routines it's in the last argument. Before that value comes back to you, the current MPI error handler gets called. By default, that error handler aborts the MPI job π³ β dramatic, but true.
You can swap the error handler out with MPI_Comm_set_errhandler (for communicators), MPI_File_set_errhandler (for files), and MPI_Win_set_errhandler (for RMA windows). There's also the MPI-1 routine MPI_Errhandler_set, which may be used, but heads up: its use is deprecated π«.
If you want error values returned to you instead of the job just perishing, use the predefined error handler MPI_ERRORS_RETURN.
β οΈ Real talk: MPI does not guarantee that an MPI program can continue past an error. However, MPI implementations will attempt to continue whenever possible. so likeβ¦ fingers crossed π
Here's the error-code lineup:
MPI_SUCCESSβ no error; the MPI routine completed successfully. we love a happy ending β¨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_COMMβ invalid communicator. a common error is to use a null communicator in a call (not even allowed inMPI_Comm_rank). girl. πMPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code. detective mode π
and that's the whole page, bestie π β this was the MPI manual's MPIX_Stream_comm_create(3) page, source/version dated 4/10/2026. periodt. go create some stream communicators, you've got this π§β¨
π¦ 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