MPIX_Stream_free(3)
π 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 communicatorsMPI_File_set_errhandlerβ for filesMPI_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; useMPI_Error_stringto 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
- 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