MPIX_Stream_create(3)
β¨ NAME β¨
MPIX_Stream_create β bestie, this is the one that creates a brand new stream object for you π (it's from the MPI manual, she's a real one)
πΈ SYNOPSIS πΈ
int MPIX_Stream_create(MPI_Info info, MPIX_Stream *stream)
π INPUT PARAMETERS π
infoβ the info argument, and yeah she's a handle π
π OUTPUT PARAMETERS π
streamβ the freshly-made stream object that pops out of this call (also a handle, we love a handle-to-handle moment) β¨
π§΅ THREAD AND INTERRUPT SAFETY π§΅
Okay so the good news first: this routine is thread-safe. Meaning?? Multiple threads can use it at the same time and you do not need to bring your own thread locks. None. Zero. Nada. She handles it π
But β and I need you to hear me on this β the routine is not interrupt safe. Whyyy? Usually because it calls memory allocation routines like malloc, or other non-MPICH runtime routines, and those are themselves not interrupt-safe. So it's giving "safe with your friends, not safe with a signal" π«
π NOTES FOR FORTRAN π
Listen up, all MPI routines in Fortran (big exception energy for MPI_WTIME and MPI_WTICK, they're the rebels) get an extra argument ierr tacked onto 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. Same vibe, different syntax, iykyk π
And in Fortran, MPI routines are subroutines, so you invoke them with the call statement. That's the whole thing, that's the assignment π
Also: every MPI object (think MPI_Datatype, MPI_Comm, all of them) is of type INTEGER in Fortran. Every. Single. One. π§
π ERRORS π
So, all MPI routines (except MPI_Wtime and MPI_Wtick, obviously, they do their own thing) return an error value. C routines give it back as the value of the function, and Fortran routines put it in that last argument. Before the value ever gets returned, the current MPI error handler gets called. And by default?? That error handler aborts the MPI job. Yeah. It just ends it. π
You can swap the error handler 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, but heads up bestie β using it is deprecated, so like... don't π
There's a predefined error handler MPI_ERRORS_RETURN you can use to make error values actually get returned to you instead of nuking everything. Slay.
Not me having to say this: 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 are the error codes you might catch:
MPI_SUCCESSβ no error, the MPI routine completed successfully. Ate. πMPI_ERR_ARGβ invalid argument. Some argument is invalid and isn't identified by a more specific error class (likeMPI_ERR_RANK).MPI_ERR_INFOβ invalid Info.MPI_ERR_OTHERβ some other error. UseMPI_Error_stringto get more info about this error code, because she's not gonna explain herself π
π SEE ALSO π
Go read up on all the routines mentioned above β MPI_Comm_set_errhandler, MPI_File_set_errhandler, MPI_Win_set_errhandler, MPI_Errhandler_set, MPI_ERRORS_RETURN, MPI_Error_string, MPI_Wtime, MPI_Wtick, and all the MPI object types that are INTEGER in Fortran. It's giving β¨ lore β¨
okay that's the whole page bestie, go forth and create some streams, you're gonna do amazing π«Άπβ¨
This iconic little number comes to you from the MPI manual, dated 4/10/2026. Bye-bye, love you, 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