8.3.1. Group Accessors

PreviousUpNext
Up: Group Management Next: Group Constructors Previous: Group Management

MPI_GROUP_SIZE(group, size)
IN groupgroup (handle)
OUT sizenumber of MPI processes in the group (integer)
C binding
int MPI_Group_size(MPI_Group group, int *size)
Fortran 2008 binding
MPI_Group_size(group, size, ierror)

TYPE(MPI_Group), INTENT(IN) :: group
INTEGER, INTENT(OUT) :: size
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_GROUP_SIZE(GROUP, SIZE, IERROR)

INTEGER GROUP, SIZE, IERROR

MPI_GROUP_RANK(group, rank)
IN groupgroup (handle)
OUT rankrank of the calling MPI process in group, or MPI_UNDEFINED if the MPI process is not a member (integer)
C binding
int MPI_Group_rank(MPI_Group group, int *rank)
Fortran 2008 binding
MPI_Group_rank(group, rank, ierror)

TYPE(MPI_Group), INTENT(IN) :: group
INTEGER, INTENT(OUT) :: rank
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_GROUP_RANK(GROUP, RANK, IERROR)

INTEGER GROUP, RANK, IERROR

MPI_GROUP_TRANSLATE_RANKS(group1, n, ranks1, group2, ranks2)
IN group1group1 (handle)
IN nnumber of elements in ranks1 and ranks2 arrays (integer)
IN ranks1array of zero or more valid ranks in group1
IN group2group2 (handle)
OUT ranks2array of corresponding ranks in group2, MPI_UNDEFINED when no correspondence exists.
C binding
int MPI_Group_translate_ranks(MPI_Group group1, int n, const int ranks1[], MPI_Group group2, int ranks2[])
Fortran 2008 binding
MPI_Group_translate_ranks(group1, n, ranks1, group2, ranks2, ierror)

TYPE(MPI_Group), INTENT(IN) :: group1, group2
INTEGER, INTENT(IN) :: n, ranks1(n)
INTEGER, INTENT(OUT) :: ranks2(n)
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_GROUP_TRANSLATE_RANKS(GROUP1, N, RANKS1, GROUP2, RANKS2, IERROR)

INTEGER GROUP1, N, RANKS1(*), GROUP2, RANKS2(*), IERROR

This function is important for determining the relative numbering of the same MPI processes in two different groups. For instance, if one knows the ranks of certain MPI processes in the group of MPI_COMM_WORLD, one might want to know their ranks in a subset of that group.

MPI_PROC_NULL is a valid rank for input to MPI_GROUP_TRANSLATE_RANKS, which returns MPI_PROC_NULL as the translated rank.

MPI_GROUP_COMPARE(group1, group2, result)
IN group1first group (handle)
IN group2second group (handle)
OUT resultresult (integer)
C binding
int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result)
Fortran 2008 binding
MPI_Group_compare(group1, group2, result, ierror)

TYPE(MPI_Group), INTENT(IN) :: group1, group2
INTEGER, INTENT(OUT) :: result
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_GROUP_COMPARE(GROUP1, GROUP2, RESULT, IERROR)

INTEGER GROUP1, GROUP2, RESULT, IERROR

MPI_IDENT results if the group members and group order are exactly the same in both groups. This happens for instance if group1 and group2 are the same handle. MPI_SIMILAR results if the group members are the same but the order is different. MPI_UNEQUAL results otherwise.


PreviousUpNext
Up: Group Management Next: Group Constructors Previous: Group Management


Return to MPI-4.1 Standard Index
Return to MPI Forum Home Page

(Unofficial) MPI-4.1 of November 2, 2023
HTML Generated on November 19, 2023