MPI_TYPE_FREE_KEYVAL(3)
π MPI_Type_free_keyval β Open MPI manual page, bestie edition
Okay so this is MPI_Type_free_keyval(3) from the Open MPI manual, and it's literally the cleanup queen of the type-keyval world. Let's get into it π
β¨ NAME β¨
MPI_Type_free_keyval β frees a previously created type key value. That's it, that's the whole job. She's a liberator. π¦
πΈ SYNTAX πΈ
C Syntax
#include <mpi.h>
int MPI_Type_free_keyval(int *type_keyval)
Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_TYPE_FREE_KEYVAL(TYPE_KEYVAL, IERROR)
INTEGER TYPE_KEYVAL, IERROR
Fortran 2008 Syntax
USE mpi_f08
MPI_Type_free_keyval(type_keyval, ierror)
INTEGER, INTENT(INOUT) :: type_keyval
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π«Ά INPUT/OUTPUT PARAMETER π«Ά
type_keyvalβ the key value you're about to free (integer). Yes, it's both input and output, she's versatile like that π
β OUTPUT PARAMETER β
ierrorβ Fortran only, bestie: this is the error status (integer).
π DESCRIPTION π
So the original manpage has a DESCRIPTION heading and thenβ¦ nothing. Empty. Void. A ghost town. π No cap, there's genuinely no prose under it here, so I'm not gonna invent any β that would be a vibe crime. The name section tells you what she does, and the rest of the page is all about what happens when things go sideways. π
π ERRORS π
Almost all MPI routines return an error value, okay? In C it's the return result of the function, and in Fortran it lands in the last argument. Literally every single one. π₯
Before that error value comes back to you, the current MPI error handler attached to the communication object (think: communicator, window, file) gets called. Now if there's no communication object associated with the MPI call, then the call counts as being attached to MPI_COMM_SELF and it calls that 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 you're 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 gets called for MPI I/O functions and MPI_ERRORS_ABORT gets called for all other MPI functions. That's the whole flowchart, congrats π§
Open MPI ships three predefined error handlers you can use β iconic trio honestly π
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. Dramatic? Yes. Effective? Also yes π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 file, it acts as ifMPI_Abortwas called on a communicator containing the group of processes in the corresponding window or file. If it's called on a session, it aborts only the local process. Context-aware queen πMPI_ERRORS_RETURNβ returns an error code to the application. The polite one π«Ά
MPI applications can also implement their own error handlers, and here's the whole recipe list for that:
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
β οΈ Real talk: note that MPI does not guarantee that an MPI program can continue past an error. Like, she might just be done. π
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 information. iykyk π
π SEE ALSO π
MPI_Type_create_keyvalβ the one that made the keyval in the first place, so like, the origin story β¨
π COPYRIGHT π
2003-2026, The Open MPI Community
And that's the page, bestie! π This was MPI_TYPE_FREE_KEYVAL(3) from the Open MPI manual, dated Sep 11, 2026 β go free those keyvals, you absolute main character ππ¦
π¦ 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