MPI_ERRHANDLER_GET(3)
π MPI_ERRHANDLER_GET(3) π
okay bestie, so this is the Open MPI man page for MPI_Errhandler_get β section 3 of the manual, iykyk β¨ β and it's gonna tell you how to grab the error handler off a communicator. Fair warning: it's lowkey a legacy girlie. More on that in a sec π
πΈ NAME πΈ
MPI_Errhandler_get β gets the error handler for a communicator β and honestly? this routine is deprecated in favor of MPI_Comm_get_errhandler. so like, it still works, but it's giving "old money, expired vibes" π«
β¨ SYNTAX β¨
π C Syntax
#include <mpi.h>
int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
π¦ Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_ERRHANDLER_GET(COMM, ERRHANDLER, IERROR)
INTEGER COMM, ERRHANDLER, IERROR
π INPUT PARAMETER π
commβ the communicator you wanna pull the error handler from (handle). like, which one, bestie? π
π OUTPUT PARAMETERS π
errhandlerβ the MPI error handler that's currently associated with the communicator (handle). that's your prize πierrorβ Fortran only: the error status (integer). classic Fortran behavior, she reports back in the last argument π
π DESCRIPTION π
so here's the tea: use of this routine is deprecated as of MPI-2. no cap. please use MPI_Comm_get_errhandler instead β she's the upgraded version and she ate π
π₯ ERRORS π₯
Almost all MPI routines return an error value β C routines as the return result of the function, and Fortran routines in the last argument. (yes, the Fortran girlies always get it in the back π«Ά)
Before that error value ever gets returned, the current MPI error handler associated with the communication object (e.g., communicator, window, file) gets called. And if no communication object is associated with the MPI call? Then the call is considered attached to MPI_COMM_SELF and it'll call the associated MPI error handler. π
When MPI_COMM_SELF is not initialized (i.e., before MPI_Init/MPI_Init_thread, after MPI_Finalize, or when using the Sessions Model exclusively), the error raises the initial error handler. That initial error handler can be changed by:
- calling
MPI_Comm_set_errhandleronMPI_COMM_SELFwhen using the World model, or - the
mpi_initial_errhandlerCLI argument tompiexec, or - the 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. that's the default lineup, bestie π
Open MPI includes three predefined error handlers that can be used:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. dramatic? yes. effective? also yes π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. she's versatile πMPI_ERRORS_RETURNβ returns an error code to the application. polite, gentle, hands it right back to you π
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, fr fr, don't count on bouncing back every time π
See the MPI man page for a full list of MPI error codes.
See the Error Handling section of the MPI-3.1 standard for more information.
π SEE ALSO π
MPI_Comm_create_errhandlerMPI_Comm_get_errhandlerMPI_Comm_set_errhandler
π COPYRIGHT π
2003-2026, The Open MPI Community
so yeah, that's the whole page π¦ she's dated Sep 11, 2026, brought to you by The Open MPI Community (2003-2026) β go forth and use MPI_Comm_get_errhandler instead, bestie, this one's deprecated but we still love her πβ¨
π¦ where this page comes from
- arch rolling: openmpi 5.0.11-1 Β· BSD-3-Clause AND LicenseRef-MPICH
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms