MPI_WIN_CALL_ERRHANDLER(3)
π MPI_WIN_CALL_ERRHANDLER π
okay bestie, welcome to the Open MPI man page for MPI_Win_call_errhandler β this one's short and sweet but it has OPINIONS, so listen up π«Ά
β¨ NAME β¨
MPI_Win_call_errhandler β passes the supplied error code to the error handler assigned to a window
πΈ SYNTAX πΈ
C Syntax
#include <mpi.h>
int MPI_Win_call_errhandler(MPI_Win win, int errorcode)
Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_WIN_CALL_ERRHANDLER(WIN, ERRORCODE, IERROR)
INTEGER WIN, ERRORCODE, IERROR
Fortran 2008 Syntax
USE mpi_f08
MPI_Win_call_errhandler(win, errorcode, ierror)
TYPE(MPI_Win), INTENT(IN) :: win
INTEGER, INTENT(IN) :: errorcode
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT PARAMETERS π
winβ the window that's got the error handler attached, as a handle. it's giving "this specific window, not any other window" πerrorcodeβ the MPI error code, an integer. yes it's literally just a number you're handing over.
π¦ OUTPUT PARAMETER π¦
ierrorβ Fortran only, bestie: the error status, as an integer.
π DESCRIPTION π
So what this function DOES is: it invokes the error handler that's assigned to the window win, and it hands over the error code you gave it in errorcode. that's the whole vibe.
And if everything goes right β like, the error handler actually got called successfully, the process did not get aborted, and the error handler returned β then this function returns MPI_SUCCESS. slay.
π₯ NOTES π₯
β οΈ bestie. READ THIS. the default error handler is MPI_ERRORS_ARE_FATAL. so if nobody has changed the error handler for this window, then calling this function will abort the window processes. no cap. it's not a warning, it's a whole situation π
π ERRORS π
Almost all MPI routines return an error value β C routines give it back as the return result of the function, and Fortran routines put it in the last argument. classic.
Before that error value comes back to you, the current MPI error handler attached to the communication object (think: communicator, window, file) gets called. and if there's no communication object associated with the MPI call, then the call counts as attached to MPI_COMM_SELF and it'll call the associated MPI error handler. and when 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. you can change the 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 the MPI_ERRORS_RETURN error handler gets called for MPI I/O functions, and the MPI_ERRORS_ABORT error handler gets called for all the other MPI functions. that's the whole flowchart, bestie.
Open MPI ships with three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. yes, all of them. iconic in a scary way.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. range, honestly.MPI_ERRORS_RETURNβ returns an error code to the application. 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_errhandler, or atMPI_Session_initMPI_Win_create_errhandlerthenMPI_Win_set_errhandler
π note that MPI does not guarantee that an MPI program can continue past an error. 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 more info.
See also:
MPI_Win_create_errhandlerMPI_Win_set_errhandler
π Copyright π
2003-2026, The Open MPI Community
and that's the whole page, bestie π written by The Open MPI Community, dated Sep 10, 2026, and it lives at section MPI_WIN_CALL_ERRHANDLER(3). go set a non-fatal error handler before you test this, i'm literally 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