MPI_COMM_GROUP(3)
π MPI_Comm_group β the Open MPI glow-up π«Ά
okay so bestie, welcome to the Open MPI manual page for MPI_Comm_group, and no cap this one is a little icon. it literally just hands you the group that lives inside a communicator. that's it. that's the whole vibe. β¨
β¨ SYNTAX β¨
πΈ C Syntax
#include <mpi.h>
int MPI_Comm_group(MPI_Comm comm, MPI_Group *group)
π Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_COMM_GROUP(COMM, GROUP, IERROR)
INTEGER COMM, GROUP, IERROR
π¦ Fortran 2008 Syntax
USE mpi_f08
MPI_Comm_group(comm, group, ierror)
TYPE(MPI_Comm), INTENT(IN) :: comm
TYPE(MPI_Group), INTENT(OUT) :: group
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT PARAMETER π
commβ the communicator. yes, that one. hand it over. π«΄
π OUTPUT PARAMETERS π
groupβ the group chilling inside that communicator (handle). it's giving "here's your friend group, bestie". πierrorβ Fortran only, bb: the error status, and it's an integer. π
π DESCRIPTION π
so if your communicator is an intercommunicator (that's the kind that lets two whole groups of processes talk to each other), this function gives you back the local group. that's it. the local one. π«Ά
and if you're sitting there like "okay but what about the other group tho π" β that's a whole different function, bestie. use MPI_Comm_remote_group for the remote group. iykyk. β¨
π₯ ERRORS π₯
okay so almost every MPI routine returns an error value, lowkey. in C routines it's the return result of the function, and in Fortran routines it's that last argument. classic. π
before the error value even 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 tied to the MPI call, then the call counts as 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 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 with 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 the MPI_ERRORS_RETURN error handler is called for MPI I/O functions, and the MPI_ERRORS_ABORT error handler is called for all other MPI functions. periodt. π
Open MPI ships with three predefined error handlers you can use, and they are:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. yes, all of them. dramatic but valid. π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. and if it's called on a session, it aborts only the local process. slay, know your scope. β¨MPI_ERRORS_RETURNβ returns an error code to the application. polite. respectful. we love her. π
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
β οΈ okay important caveat bestie, don't skip this one: note that MPI does not guarantee that an MPI program can continue past an error. fr fr. π
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. π
π COPYRIGHT π
2003-2026, The Open MPI Community
and that's the whole page, bestie!! π source/version teaser: this is Open MPI, dated Sep 11, 2026 β go forth and group responsibly πβ¨π¦
π¦ 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