MPI_GROUP_COMPARE(3)

πŸ’– MPI_GROUP_COMPARE(3) β€” Open MPI πŸ’–

okay bestie, this is the MPI_Group_compare page from the Open MPI manual, section 3. yes we are reading a manpage together, it's giving study date energy 🌸

short version: it compares two groups. that's it. that's the whole vibe check.


✨ SYNTAX ✨

πŸŽ€ C Syntax

#include <mpi.h>

int MPI_Group_compare(MPI_Group group1, MPI_Group group2,
    int *result)

πŸŽ€ Fortran Syntax

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

MPI_GROUP_COMPARE(GROUP1, GROUP2, RESULT, IERROR)
    INTEGER GROUP1, GROUP2, RESULT, IERROR

πŸŽ€ Fortran 2008 Syntax

USE mpi_f08

MPI_Group_compare(group1, group2, result, ierror)
    TYPE(MPI_Group), INTENT(IN) :: group1, group2
    INTEGER, INTENT(OUT) :: result
    INTEGER, OPTIONAL, INTENT(OUT) :: ierror

🫢 INPUT PARAMETERS

  • group1 : the first group, as a handle. bestie number one πŸ’œ
  • group2 : the second group, as a handle. bestie number two πŸ’™

πŸ‘‘ OUTPUT PARAMETERS

  • result (Integer) β€” and the way this one works is: it's MPI_IDENT if the order and the members of the two groups are the same, MPI_SIMILAR if only the members are the same, and MPI_UNEQUAL otherwise. three possible outcomes, one little int, iconic.
  • ierror : Fortran only β€” the error status (integer). πŸ™ˆ

πŸ¦‹ DESCRIPTION

so here's the tea β˜•

  • MPI_IDENT shows up if the group members and the group order are exactly the same in both groups. this happens, for instance, if group1 and group2 are literally the same handle. same handle = same everything, no cap.
  • MPI_SIMILAR shows up if the group members are the same but the order is different. same people, different seating chart, you know how it is.
  • MPI_UNEQUAL shows up otherwise. not the same members, not the same order, not the same anything. it's giving exes. πŸ’€

😭 ERRORS

almost all MPI routines return an error value, fr fr. 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 that's associated with the communication object (like a communicator, window, or file) gets called. and if there's no communication object associated with the MPI call, then the call counts as attached to MPI_COMM_SELF and it'll call the associated MPI error handler. and when MPI_COMM_SELF isn't 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 instead.

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 with an 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 gets called for MPI I/O functions, and the MPI_ERRORS_ABORT error handler gets called for all the other MPI functions. yeah. whole system, honestly.

Open MPI ships three predefined error handlers you can use:

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes. everyone. gone. πŸ’€
  • 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. and if it's called on a session, it aborts only the local process. context is everything, bestie.
  • 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. so like... 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. slay, standards. πŸ“š


2003-2026, The Open MPI Community


and that's the whole page, bestie!! you understood it, I'm so proud of you πŸ₯ΉπŸ’– this was MPI_GROUP_COMPARE(3) from Open MPI, dated Sep 10, 2026. go forth and compare some groups. periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from