MPI_KEYVAL_FREE(3)
π MPI_KEYVAL_FREE(3)
okay so this is an Open MPI man page, bestie β buckle up π
πΈ NAME πΈ
MPI_Keyval_free β frees the attribute key for a communicator cache attribute β and heads up, this routine is deprecated in favor of MPI_Comm_free_keyval. no cap, it's giving "old faithful but we've moved on" π
β¨ SYNOPSIS β¨
π» C Syntax
#include <mpi.h>
int MPI_Keyval_free(int *keyval)
π§ Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_KEYVAL_FREE(KEYVAL, IERROR)
INTEGER KEYVAL, IERROR
π INPUT PARAMETER π
keyvalβ frees the integer key value (integer). yes that's literally the whole description, she's concise π
π¦ OUTPUT PARAMETER π¦
ierrorβ Fortran only: the error status (integer). π«Ά
π DESCRIPTION π
real talk: use of this routine is deprecated as of MPI-2. please use MPI_Comm_free_keyval instead. that's it, that's the whole description β she's short but she means it π
π₯ 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. periodt.
Before that error value comes back, the current MPI error handler associated with the communication object (like a communicator, window, or file) gets called. If there's no communication object associated with the MPI call, then the call counts as attached to MPI_COMM_SELF and will 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 that initial error handler by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when using the World model, or via the mpi_initial_errhandler CLI argument to mpiexec, or the info key to MPI_Comm_spawn/MPI_Comm_spawn_multiple. If no other appropriate error handler has been set, then MPI_ERRORS_RETURN is called for MPI I/O functions, and MPI_ERRORS_ABORT is called for all other MPI functions. iykyk π
Open MPI ships three predefined error handlers you can use, and they are lowkey iconic:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. dramatic but effective π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 ifMPI_Abortwas called on that communicator. If called on a window or file, it acts as ifMPI_Abortwas 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. β¨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_errhandleror atMPI_Session_initMPI_Win_create_errhandlerthenMPI_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 it π
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_Keyval_createMPI_Comm_create_keyvalMPI_Comm_free_keyval
π COPYRIGHT π
2003-2026, The Open MPI Community
and that's the whole vibe check, bestie β page brought to you by Open MPI, dated Sep 11, 2026, filed under MPI_KEYVAL_FREE(3). slay, go free those keyvals (with MPI_Comm_free_keyval, obviously π
β¨)
π¦ where this page comes from
- arch rolling: openmpi 5.0.11-1 Β· BSD-3-Clause AND LicenseRef-MPICH
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms