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_errhandler on MPI_COMM_SELF when using the World model, or
  • 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 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 if MPI_Abort was called on that communicator. If called on a window or file, it acts as if MPI_Abort was 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_errhandler then MPI_Comm_set_errhandler
  • MPI_File_create_errhandler then MPI_File_set_errhandler
  • MPI_Session_create_errhandler then MPI_Session_set_errhandler or at MPI_Session_init
  • MPI_Win_create_errhandler then MPI_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_errhandler
  • MPI_Comm_get_errhandler
  • MPI_Comm_set_errhandler

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