MPIX_Stream_free(3)

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

πŸ’– MPIX_Stream_free(3) β€” the MPI manual page, bestie edition πŸ’–

okay so you're in the MPI manual section, and today's main character is MPIX_Stream_free β€” the routine that frees a stream object. yes. that's the whole vibe. let's get into it 🫢


✨ NAME ✨

MPIX_Stream_free β€” Free a stream object πŸ¦‹


🌸 SYNOPSIS 🌸

int MPIX_Stream_free(MPIX_Stream *stream)

that's it. one function, one pointer, so clean, so iconic πŸ’…


πŸŽ€ INPUT/OUTPUT PARAMETERS πŸŽ€

  • stream β€” stream object (handle). yes bestie, it's input/output, we're handing over the handle and the routine is doing its thing with it. πŸ‘‘

πŸ”₯ THREAD AND INTERRUPT SAFETY πŸ”₯

okay this part actually matters so pay attention, no cap:

This routine is thread-safe. Which means the way that it can be safely used by multiple threads without needing any user-provided thread locks?? literally iconic. go off, multiple threads, no locks required ✨

However β€” and this is the important bit β€” 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. so it's giving "fine in threads, not fine mid-interrupt". noted, bestie. πŸ’€


🧚 NOTES FOR FORTRAN 🧚

All MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK) have an additional argument ierr at the end of the argument list. ierr is an integer and has the same meaning as the return value of the routine in C. In Fortran, MPI routines are subroutines, and they're invoked with the call statement. πŸ“ž

All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. yes, INTEGER, not handle, not pointer, not vibes. INTEGER. πŸ’œ


🌈 ERRORS 🌈

okay so every MPI routine (except MPI_Wtime and MPI_Wtick) returns an error value. Put simply: C routines return it as the value of the function, and Fortran routines return it in the last argument. Before the value comes back to you, the current MPI error handler gets called. By default, this error handler aborts the MPI job. 😳 yeah. full abort. drama.

The error handler can be changed with:

  • MPI_Comm_set_errhandler β€” for communicators
  • MPI_File_set_errhandler β€” for files
  • MPI_Win_set_errhandler β€” for RMA windows

The MPI-1 routine MPI_Errhandler_set may be used, but its use is deprecated. 🚩 The predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned.

Note that MPI does not guarantee that an MPI program can continue past an error; however, MPI implementations will attempt to continue whenever possible. 🫢

and here's the error code list, bestie:

  • MPI_SUCCESS β€” No error; MPI routine completed successfully. πŸŽ‰ ate.
  • MPI_ERR_OTHER β€” Other error; use MPI_Error_string to get more information about this error code. πŸ”

and that's the whole page, slay πŸ’…βœ¨

sign-off time πŸŽ€ β€” this beauty is from the MPI manual, page MPIX_Stream_free(3), dated 4/10/2026. mwah. go free those streams, queen πŸ‘‘πŸ¦‹

πŸ“¦ where this page comes from