MPI_GROUP_FREE(3)

πŸ’… MPI_GROUP_FREE(3) β€” the MPI_Group_free glow-up πŸ¦‹

okay bestie, so this is a page from Open MPI (that's the manual collection it lives in, MPI_GROUP_FREE(3) is the whole vibe) and honestly? it's a short one. it's literally about letting a group go. self-care for handles, periodt. ✨


🌸 NAME 🌸

MPI_Group_free β€” frees a group. that's it. that's the whole thing. she releases the group and moves on. πŸ‘‘


πŸŽ€ SYNTAX πŸŽ€

C Syntax

#include <mpi.h>

int MPI_Group_free(MPI_Group *group)

Fortran Syntax

USE MPI
! or the older form: INCLUDE 'mpif.h'

MPI_GROUP_FREE(GROUP, IERROR)
    INTEGER GROUP, IERROR

Fortran 2008 Syntax

USE mpi_f08

MPI_Group_free(group, ierror)
    TYPE(MPI_Group), INTENT(INOUT) :: group
    INTEGER, OPTIONAL, INTENT(OUT) :: ierror

three flavours, same energy πŸ“


πŸ’– INPUT/OUTPUT PARAMETER πŸ’–

  • group β€” the group handle. it goes in and it comes out, because that's literally why it's an input/output situation β€” the call is gonna touch it (see the note below, iykyk πŸ‘€).

🫢 OUTPUT PARAMETER 🫢

  • ierror β€” Fortran only, bestie: the error status, and it's an integer. C girlies get their error as the function's return value instead, we don't make the rules πŸ’…

πŸŽ€ DESCRIPTION πŸŽ€

okay so what this operation actually does: it marks a group object for deallocation. not "instantly vaporizes", not "yeets it into the sun" β€” it marks it. the handle group is set to MPI_GROUP_NULL by the call. and listen, if some ongoing operation is still using this group? it will complete normally. no drama, no chaos, no ripped-out rug. the vibe check passes. 🌈


⭐ NOTE ⭐

just in case you scrolled past it: on return, group is set to MPI_GROUP_NULL. that's the whole note. it's important enough to say twice, clearly. 🎯


πŸ”₯ ERRORS πŸ”₯

almost all MPI routines return an error value β€” C routines as the return result of the function, and Fortran routines in the last argument. so yeah, check it, bestie. πŸ™ˆ

before that error value gets returned, the current MPI error handler associated with the communication object (e.g., communicator, window, file) gets called. and if there's no communication object associated with the MPI call? then the call is considered attached to MPI_COMM_SELF and it'll call the associated MPI error handler. when MPI_COMM_SELF is not initialized (i.e., before MPI_Init/MPI_Init_thread, after MPI_Finalize, or when using the Sessions Model exclusively) the error raises the initial error handler. and 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 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. 😭 it's a whole pipeline, I know.

Open MPI ships three predefined error handlers you can use:

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes. yes, ALL of them. nuclear option, no cap πŸ’€
  • 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. 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 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, it might just not. be aware. fr fr.

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


and that's the page, bestie!! πŸŽ€βœ¨ brought to you by the Open MPI girlies, dated Sep 11, 2026 β€” go free those groups responsibly, mwah πŸ’‹πŸ’–

πŸ“¦ where this page comes from