MPI_WIN_FREE_KEYVAL(3)

πŸ’– MPI_Win_free_keyval πŸ’–

okay bestie, welcome to the Open MPI manual, section 3 πŸŽ€ β€” this page is all about MPI_Win_free_keyval, and it does exactly one (1) thing: it frees a window keyval. that's it. that's the whole vibe. ✨


✨ SYNTAX ✨

🌸 C Syntax

#include <mpi.h>

int MPI_Win_free_keyval(int *win_keyval)

🌸 Fortran Syntax

USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_WIN_FREE_KEYVAL(WIN_KEYVAL, IERROR)
     INTEGER WIN_KEYVAL, IERROR

🌸 Fortran 2008 Syntax

USE mpi_f08
MPI_Win_free_keyval(win_keyval, ierror)
     INTEGER, INTENT(INOUT) :: win_keyval
     INTEGER, OPTIONAL, INTENT(OUT) :: ierror

πŸ¦‹ INPUT/OUTPUT PARAMETER

  • win_keyval β€” the key value, and it's an integer. it's INOUT energy, meaning she goes in and she comes back changed. queen behavior πŸ‘‘ (integer, obviously)

πŸŽ€ OUTPUT PARAMETER

  • ierror β€” Fortran only, bestie 🫢 this is the error status, and yes it's an integer.

πŸ’… ERRORS

ngl this section is a whole saga, so let's get into it. literally almost all MPI routines return an error value: C routines hand it back as the return result of the function, and Fortran routines put it in the last argument. periodt.

Before that error value ever comes back to you, the current MPI error handler that's attached to the communication object (think: communicator, window, file) gets called. and if there's no communication object attached to the MPI call? then the call is considered attached to MPI_COMM_SELF, and it'll call the error handler associated with that. πŸ’€

When MPI_COMM_SELF isn't initialized β€” that means 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
  • via the mpi_initial_errhandler CLI argument to mpiexec, or
  • via an info key to MPI_Comm_spawn / MPI_Comm_spawn_multiple.

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.

Open MPI ships three predefined error handlers you can use, and they're iconic tbh:

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes. yeah. all of them. 😭
  • MPI_ERRORS_ABORT β€” an error handler you can invoke 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 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.
  • MPI_ERRORS_RETURN β€” returns an error code to the application. polite. respectful. we love her. πŸ“

MPI applications can also implement their own error handlers by calling:

  • MPI_Comm_create_errhandler and then MPI_Comm_set_errhandler
  • MPI_File_create_errhandler and then MPI_File_set_errhandler
  • MPI_Session_create_errhandler and then MPI_Session_set_errhandler, or at MPI_Session_init
  • MPI_Win_create_errhandler and then MPI_Win_set_errhandler
⚠️ heads up bestie: note that MPI does not guarantee that an MPI program can continue past an error. fr fr. no cap.

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 πŸ“š


2003-2026, The Open MPI Community


okay that's the whole page, you ate that πŸ’…βœ¨ this was Open MPI, dated Sep 10, 2026, and you've been reading MPI_WIN_FREE_KEYVAL(3) πŸ’– go free those keyvals, main character πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from