MPI_WIN_GET_ERRHANDLER(3)
β¨ NAME β¨
MPI_Win_get_errhandler β grabs the error handler that's currently vibing with a window π (this is from the Open MPI fam, section 3 of the manual, just so you know what you're reading, bestie)
π¦ SYNTAX π¦
C Syntax
#include <mpi.h>
int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler)
Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_WIN_GET_ERRHANDLER(WIN, ERRHANDLER, IERROR)
INTEGER WIN, ERRHANDLER, IERROR
Fortran 2008 Syntax
USE mpi_f08
MPI_Win_get_errhandler(win, errhandler, ierror)
TYPE(MPI_Win), INTENT(IN) :: win
TYPE(MPI_Errhandler), INTENT(OUT) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
πΈ INPUT PARAMETER πΈ
- win β the Window (handle). that's the one you're peeking into π
π OUTPUT PARAMETERS π
- errhandler β the error handler currently associated with the window (handle). yes it's giving "who's on duty rn" π
- ierror β Fortran only: error status (integer).
β¨ DESCRIPTION β¨
MPI_Win_get_errhandler retrieves the error handler currently associated with a window. that's it, that's the whole job β you hand it a window, it hands you back the errhandler riding with it π«Ά lowkey iconic for debugging, ngl.
π₯ ERRORS π₯
Okay so real talk: almost every MPI routine returns an error value. C routines give it back as the return result of the function, and Fortran routines tuck it into that last argument. periodt.
Before that error value ever comes back to you, the current MPI error handler tied to the communication object (think: communicator, window, file) gets called. And if there's no communication object attached to the MPI call at all? Then the call is treated as attached to MPI_COMM_SELF and it'll call whatever error handler that one has. And when MPI_COMM_SELF isn't initialized yet β like before MPI_Init/MPI_Init_thread, or after MPI_Finalize, or if you're using the Sessions Model exclusively β the error raises the initial error handler instead. You can swap that initial error handler by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when you're on the World model, or via the mpi_initial_errhandler CLI argument to mpiexec, or through an info key when you call MPI_Comm_spawn/MPI_Comm_spawn_multiple. And if literally 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 every other MPI function. no cap. π
Open MPI ships with three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. it's giving nuclear πMPI_ERRORS_ABORTβ an error handler that can be invoked on a communicator, window, file, or session. When it's called on a communicator, it acts as ifMPI_Abortwas called on that communicator. If it's called on a window or a file, it acts as ifMPI_Abortwas called on a communicator containing the group of processes in the corresponding window or file. And if it's called on a session, it aborts only the local process. β¨MPI_ERRORS_RETURNβ returns an error code to the application. the chill one π
MPI applications can also cook up their own error handlers by calling:
MPI_Comm_create_errhandlerthenMPI_Comm_set_errhandlerπMPI_File_create_errhandlerthenMPI_File_set_errhandlerπMPI_Session_create_errhandlerthenMPI_Session_set_errhandleror atMPI_Session_initπMPI_Win_create_errhandlerthenMPI_Win_set_errhandlerπ
β οΈ heads up bestie: note that MPI does not guarantee that an MPI program can continue past an error. so don't be out here assuming you can just keep going, fr fr π
See the MPI man page for a full list of MPI error codes. And see the Error Handling section of the MPI-3.1 standard for even more info, iykyk π
π Copyright π
2003-2026, The Open MPI Community β yes the whole squad, all of them π
okay that's the whole page, you're officially caught up π¦ this was MPI_WIN_GET_ERRHANDLER(3) from the Open MPI manual, dated Sep 10, 2026 β slay, go forth and handle your errors, bestie π
πΈ
π¦ 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