MPI_TYPE_FREE_KEYVAL(3)

πŸ’– MPI_TYPE_FREE_KEYVAL(3) πŸ’–

okay so this one lives in the Open MPI manual, and it's literally just one tiny little function that cleans up after you. bestie behavior fr fr 🫢


✨ NAME ✨

MPI_Type_free_keyval β€” frees a previously created type key value. that's it, that's the whole job πŸ’…


✨ 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 freeing, queen. it's an integer, and yes it counts as input/output because it gets modified in the process. slay.

✨ OUTPUT PARAMETER ✨

  • ierror β€” Fortran only, bestie: error status, and it's an integer. C girlies get their error as the return value instead, iykyk.

πŸ“– DESCRIPTION πŸ“–

so… this page is serving absolutely nothing under DESCRIPTION. like, the section exists, the heading is right there, and then β€” nothing. no cap. πŸ’€ (respect tho, it's the manual's call, not mine.)


🚨 ERRORS 🚨

okay so almost every MPI routine hands you back an error value: C routines return it straight from the function, and Fortran routines put it in that last argument. periodt.

before that error value ever reaches you, the current MPI error handler attached to the communication object (think communicator, window, file) gets called. and if there's, like, no communication object attached to the MPI call at all? then the call is considered attached to MPI_COMM_SELF, and its associated MPI error handler gets called. πŸ’«

when MPI_COMM_SELF is not 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. and you can change that initial error handler:

  • call MPI_Comm_set_errhandler on MPI_COMM_SELF when you're using the World model, or
  • use 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 at all? then MPI_ERRORS_RETURN gets called for MPI I/O functions, and MPI_ERRORS_ABORT gets called for all other MPI functions.

Open MPI ships three predefined error handlers you can use:

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes. bye bestie 😭
  • 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 file, it acts as if MPI_Abort was 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.
  • MPI_ERRORS_RETURN β€” returns an error code to the application. very polite of it πŸŽ€

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, and this one's important: MPI does not guarantee that an MPI program can continue past an error. like, no promises, bestie. πŸ’€

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. πŸ‘‘

see also:

  • MPI_Type_create_keyval

2003-2026, The Open MPI Community β€” iconic, they've been at this for decades and we thank them for their service 🫢


and that's the whole page, bestie! this was the Open MPI manual, page MPI_TYPE_FREE_KEYVAL(3), dated Sep 10, 2026. go free those key values, you absolute main character. πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from