MPI_INFO_FREE(3)

✨ MPI_INFO_FREE(3) ✨

okay bestie, we're doing the Open MPI manual page for MPI_Info_free πŸ’– it's a short one and honestly? it's giving ✨closure✨


🌸 NAME 🌸

MPI_Info_free β€” frees an info object. that's it. that's the whole job. she cleans up and dips πŸ’…


πŸŽ€ SYNTAX πŸŽ€

C Syntax

#include <mpi.h>

int MPI_Info_free(MPI_Info *info)

Fortran Syntax

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

Fortran 2008 Syntax

USE mpi_f08
MPI_Info_free(info, ierror)
     TYPE(MPI_Info), INTENT(INOUT) :: info
     INTEGER, OPTIONAL, INTENT(OUT) :: ierror

πŸ¦‹ INPUT/OUTPUT PARAMETER πŸ¦‹

  • info β€” the Info object (handle). she goes in alive, she goes out freed 🫢

⭐ OUTPUT PARAMETER ⭐

  • ierror β€” Fortran only: error status (integer). classic Fortran behaviour, ngl.

πŸ’– DESCRIPTION πŸ’–

So like, MPI_Info_free frees info and sets it to MPI_INFO_NULL. no cap. that's the whole vibe β€” hand it over, and it becomes a polite little nothing πŸ•³οΈβœ¨


πŸ‘‘ ERRORS πŸ‘‘

fr fr, 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. no surprises there πŸ’β€β™€οΈ

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

When MPI_COMM_SELF is not initialized β€” meaning 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 😳

That initial error handler can be changed by:

  • calling MPI_Comm_set_errhandler on MPI_COMM_SELF when using the World model, or
  • 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 MPI_ERRORS_RETURN is the one called for MPI I/O functions, while MPI_ERRORS_ABORT gets called for all other MPI functions. the drama of it all 🎭

Open MPI includes three predefined error handlers you can use:

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes. straight to the group chat graveyard πŸ’€
  • 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 if MPI_Abort was called on that communicator. If 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 called on a session, it aborts only the local process. (so many contexts, so consistent 🫑)
  • 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. like, no promises, bestie. plan accordingly 😭

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_Info_create
  • MPI_Info_delete
  • MPI_Info_dup
  • MPI_Info_get
  • MPI_Info_set

2003-2026, The Open MPI Community


and that's a wrap, bestie πŸŽ€ this page is from the Open MPI manual, dated Sep 10, 2026, and the copyright belongs to The Open MPI Community (2003-2026). go free that info object, you absolute icon πŸ‘‘πŸ’…πŸ’œ

πŸ“¦ where this page comes from