MPIX_Stream_comm_create(3)

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

πŸ’– 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 in MPI_Comm_rank). girl. πŸ‘‘
  • MPI_ERR_OTHER β€” other error; use MPI_Error_string to 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