MPI_GROUP_FREE(3)
π MPI_GROUP_FREE π
okay bestie, welcome to the Open MPI manual, page MPI_GROUP_FREE(3) β yes that's the manual name, we're saying it out loud because it's literally the whole vibe of this page π«Ά
β¨ NAME β¨
MPI_Group_free β frees a group.
Like, releases it. Lets it go. Sets it free. π¦
π 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
πΈ INPUT/OUTPUT PARAMETER πΈ
- group β the Group (handle). It goes in, it comes back changed. main character energy, honestly.
π OUTPUT PARAMETER π
- ierror β Fortran only: the error status (integer).
π DESCRIPTION π
So here's the tea: this operation marks a group object for deallocation. Not instant-gone, just β¨markedβ¨. And the group handle gets set to MPI_GROUP_NULL by the call. Slay.
Any ongoing operation that's using this group? It'll complete normally. No chaos, no drama, it finishes what it started. π
π NOTE π
On return, group is set to MPI_GROUP_NULL. That's it. That's the note. fr fr.
π ERRORS π
ngl this section is the longest one and it's giving important.
Almost all MPI routines return an error value β C routines hand it back as the return result of the function, and Fortran routines put it in the last argument.
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 there's no communication object attached to the MPI call? Then the call is considered attached to MPI_COMM_SELF, and it'll call the associated MPI error handler. π
But wait β when MPI_COMM_SELF isn't 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 instead. And you can change that initial error handler:
- by calling
MPI_Comm_set_errhandleronMPI_COMM_SELFwhen you're using the World model, or - via the
mpi_initial_errhandlerCLI argument tompiexec, or - via 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 gets called for MPI I/O functions, and MPI_ERRORS_ABORT gets called for all other MPI functions. periodt.
Open MPI ships with three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. πMPI_ERRORS_ABORTβ an error handler you can invoke 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.MPI_ERRORS_RETURNβ returns an error code to the application.
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
β οΈ Real talk: note that MPI does not guarantee that an MPI program can continue past an error. Like, at all. Don't assume you can just keep going. π
For the full list of MPI error codes, go see the MPI man page. And for more info, check the Error Handling section of the MPI-3.1 standard. iykyk. π
π Copyright π
2003-2026, The Open MPI Community
and that's the whole page babes π this was MPI_GROUP_FREE(3) from Open MPI, dated Sep 10, 2026 β go free those groups, you got this ππβ¨
π¦ where this page comes from
- ubuntu stonking: openmpi-doc 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms