MPI_GROUP_RANGE_EXCL(3)
MPI_GROUP_RANGE_EXCL π
okay bestie, so this is a page from the Open MPI manual, and we're about to make a whole new group by β¨excludingβ¨ a bunch of process ranges from a group you already have. it's giving "block list but for ranks." let's go π
NAME πΈ
MPI_Group_range_excl β produces a group by excluding ranges of processes from an existing group.
SYNTAX β¨
C Syntax
#include <mpi.h>
int MPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
MPI_Group *newgroup)
Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_GROUP_RANGE_EXCL(GROUP, N, RANGES, NEWGROUP, IERROR)
INTEGER GROUP, N, RANGES(3,*), NEWGROUP, IERROR
Fortran 2008 Syntax
USE mpi_f08
MPI_Group_range_excl(group, n, ranges, newgroup, ierror)
TYPE(MPI_Group), INTENT(IN) :: group
INTEGER, INTENT(IN) :: n, ranges(3,n)
TYPE(MPI_Group), INTENT(OUT) :: newgroup
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
INPUT PARAMETERS π«Ά
groupβ the group, as a handle. like, the friend group we're editing. π«nβ number of triplets in the arrayranges(integer). yes, triplets, plural, sonof them.rangesβ a one-dimensional array of integer triplets shaped like(first rank, last rank, stride), telling you which ranks ingroupget kicked out of the output groupnewgroup. note it says excluded from β these are the ones leaving the chat πͺ
OUTPUT PARAMETERS π
newgroupβ the new group derived from the above, and crucially it preserves the order ingroup(handle). no shuffling, the order stays iconic πierrorβ Fortran only: error status (integer).
DESCRIPTION π₯
so, each computed rank must be a valid rank in group, and all computed ranks must be distinct, or else the program is erroneous. like, no duplicates and no imaginary friends. periodt. π
the functionality of this routine is specified to be equivalent to expanding the array of ranges into an array of the excluded ranks and passing that resulting array of ranks β plus the other arguments β to MPI_Group_excl. and a call to MPI_Group_excl is equivalent to a call to MPI_Group_range_excl with each rank i in ranks replaced by the triplet (i,i,1) in the argument ranges. it's the same vibe, different packaging π
ERRORS π
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, the current MPI error handler associated with the communication object (e.g., communicator, window, file) gets called. if there's no communication object associated with the MPI call, then the call is considered attached to MPI_COMM_SELF and it will call the associated MPI error handler. and 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. that initial error handler can be changed by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when using the World model, or via 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. π΅βπ«
Open MPI includes three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. it's giving no chill π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 ifMPI_Abortwas called on that communicator. if 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 called on a session, it aborts only the local process.MPI_ERRORS_RETURNβ returns an error code to the application. polite king π
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
note that MPI does not guarantee that an MPI program can continue past an error. fr fr, it might just not come back π
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_Group_exclMPI_Group_free
Copyright π
2003-2026, The Open MPI Community
and that's the whole page bestie, we ate and left no crumbs π
β¨ this was written by the Open MPI community, dated Sep 10, 2026, and it's page MPI_GROUP_RANGE_EXCL(3) of the Open MPI manual β now go exclude those ranks, mwah π«Άππ
π¦ 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