MPIX_Stream_create(3)

πŸ“¦
version 5.0.1 Β· 4 versions
, in nixos 26.05, ubuntu stonking

✨ 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 (like MPI_ERR_RANK).
  • MPI_ERR_INFO β€” invalid Info.
  • MPI_ERR_OTHER β€” some other error. Use MPI_Error_string to 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