MPI_ERRHANDLER_GET(3)
π MPI_ERRHANDLER_GET π
okay bestie, welcome to the Open MPI manual, section three β library routines only, we're fancy. this one's a classic but also kind of a "we don't do that anymore" situation, so let's get into it. π«Ά
π NAME
MPI_Errhandler_get β gets the error handler for a communicator β and heads up, this routine is deprecated in favor of MPI_Comm_get_errhandler. no cap. π
β¨ 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 want to pull the error handler out of (a handle, bestie).
π OUTPUT PARAMETERS
errhandlerβ the MPI error handler that's currently associated with that communicator (a handle). this is the one you came for. β¨ierrorβ Fortran only: the error status (integer).
π DESCRIPTION
so like β real talk β using this routine is deprecated as of MPI-2. it's giving legacy. please use MPI_Comm_get_errhandler instead. truly, she's the upgrade. πΈ
π ERRORS
okay so basically almost every MPI routine hands back an error value; C routines return it as the return result of the function, and Fortran routines put it in the last argument.
before that error value gets 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 at all, then the call counts as attached to MPI_COMM_SELF and it'll call the error handler associated with that. now if MPI_COMM_SELF isn't 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. and you can change that initial error handler by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when you're using the World model, or with the mpi_initial_errhandler CLI argument to mpiexec, or the info key to MPI_Comm_spawn/MPI_Comm_spawn_multiple. and if no other appropriate error handler has been set? then MPI_ERRORS_RETURN gets called for MPI I/O functions, and MPI_ERRORS_ABORT gets called for all other MPI functions. π
Open MPI includes three predefined error handlers you can use, and honestly? iconic lineup:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. all of them. she does not do half measures. π₯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.MPI_ERRORS_RETURNβ returns an error code to the application. polite. π«Ά
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
lowkey crucial: MPI does not guarantee that an MPI program can continue past an error. like, at all. periodt. don't be surprised when things go sideways. π¨
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 β that's where the deep lore lives. π
see also:
MPI_Comm_create_errhandlerMPI_Comm_get_errhandlerMPI_Comm_set_errhandler
Β©οΈ Copyright
2003-2026, The Open MPI Community
and that's the whole page, bestie π this one came from Open MPI and it's dated Sep 10, 2026, page MPI_ERRHANDLER_GET(3) β go forth and use the non-deprecated version, i'm begging. π¦β¨
π¦ 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