MPI_ERRHANDLER_FREE(3)
π MPI_ERRHANDLER_FREE(3) π
okay so bestie, welcome to the Open MPI manual page for MPI_ERRHANDLER_FREE(3), and likeβ¦ this one is your lil cleanup queen. she frees an MPI-style error handler. that's it. that's the whole vibe. β¨
πΈ NAME πΈ
MPI_Errhandler_free β frees an MPI-style error handler. yes it's giving "tidying up after the party" and honestly? we love a girl who cleans up after herself π§Ήπ
β¨ SYNTAX β¨
π C Syntax
#include <mpi.h>
int MPI_Errhandler_free(MPI_Errhandler *errhandler)
π§ Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_ERRHANDLER_FREE(ERRHANDLER, IERROR)
INTEGER ERRHANDLER, IERROR
π¦ Fortran 2008 Syntax
USE mpi_f08
MPI_Errhandler_free(errhandler, ierror)
TYPE(MPI_Errhandler), INTENT(INOUT) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π₯ INPUT PARAMETER π₯
errhandlerβ your MPI error handler (a handle, okurrr). on exit it gets set toMPI_ERRHANDLER_NULL, so like, don't be surprised when it's β¨goneβ¨ π«Ά
π€ OUTPUT PARAMETER π€
ierrorβ Fortran only, bestie: this is the error status (integer). she only shows up for the Fortran girlies π
π« DESCRIPTION π«
so what this actually does: it marks the error handler associated with errhandler for deallocation and sets errhandler to MPI_ERRHANDLER_NULL. π
but NOT me being dramatic β she doesn't get deallocated immediately, okay? the error handler will be deallocated after all communicators associated with it have been deallocated. it's giving "she's not leaving until everyone she came with has left the function" π iconic behavior fr fr.
β οΈ ERRORS β οΈ
almost all MPI routines return an error value β C routines hand it back as the return result of the function, and Fortran routines tuck it into the last argument. standard π
Before the error value is returned, the current MPI error handler associated with the communication object (like a communicator, window, or file) gets called. And if there's no communication object associated with the MPI call, then the call is considered attached to MPI_COMM_SELF and will call the associated MPI error handler. And when MPI_COMM_SELF is not initialized β i.e. before MPI_Init / MPI_Init_thread, after MPI_Finalize, or when you're using the Sessions Model exclusively β the error raises the initial error handler π
you can change the initial error handler by:
- calling
MPI_Comm_set_errhandleronMPI_COMM_SELFwhen you're using the World model, or - the
mpi_initial_errhandlerCLI argument tompiexec, or - an info key to
MPI_Comm_spawn/MPI_Comm_spawn_multiple.
and if no other appropriate error handler has been set? then the MPI_ERRORS_RETURN error handler is called for MPI I/O functions, and the MPI_ERRORS_ABORT error handler is called for all other MPI functions. no cap. π₯
Open MPI includes three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. like, everybody goes down together. πMPI_ERRORS_ABORTβ an error handler that can be invoked on a communicator, window, file, or session. When called on a communicator, it acts as ifMPI_Abortwas called on that communicator. If called on a window or file, it acts as ifMPI_Abortwas called on a communicator containing the group of processes in the corresponding window or file. If called on a session, it aborts only the local process. (lowkey selective, highkey iconic π)MPI_ERRORS_RETURNβ returns an error code to the application. she's the chill one π
MPI applications can also implement their own error handlers by calling:
MPI_Comm_create_errhandlerthenMPI_Comm_set_errhandlerMPI_File_create_errhandlerthenMPI_File_set_errhandlerMPI_Session_create_errhandlerthenMPI_Session_set_errhandleror atMPI_Session_initMPI_Win_create_errhandlerthenMPI_Win_set_errhandler
π¨ note that MPI does not guarantee that an MPI program can continue past an error. like, she said what she said. π
see the MPI man page for a full list of MPI error codes, and the Error Handling section of the MPI-3.1 standard for more information. iykyk π
See also:
MPI_Comm_create_errhandlerMPI_Comm_get_errhandlerMPI_Comm_set_errhandler
π Copyright π
2003-2026, The Open MPI Community π«Ά
okay bestie that's the whole page, and real talk β this was the Open MPI girlies' own manual page for MPI_ERRHANDLER_FREE(3), dated Sep 10, 2026, brought to you by The Open MPI Community (Β© 2003-2026). go deallocate responsibly, mwah πβ¨π
π¦ where this page comes from
- ubuntu stonking: openmpi-doc 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms