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 if MPI_Abort was called on that communicator. if it's called on a window or a file, it acts as if MPI_Abort was 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_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. 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_errhandler
  • MPI_Win_set_errhandler

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