Class Group
- java.lang.Object
-
- mpi.Group
-
-
Field Summary
Fields Modifier and Type Field Description protected longhandle
-
Constructor Summary
Constructors Modifier Constructor Description protectedGroup(long handle)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intcompare(Group group1, Group group2)Compare two groups.static Groupdifference(Group group1, Group group2)Set difference of two groups.Groupexcl(int[] ranks)Create a subset group excluding specified processes.voidfree()Java binding of the MPI operationMPI_GROUP_FREE.protected static longgetEmpty()intgetRank()Rank of this process in the group.intgetSize()Java binding of the MPI operationMPI_GROUP_SIZE.Groupincl(int[] ranks)Create a subset group including specified processes.static Groupintersection(Group group1, Group group2)Set intersection of two groups.booleanisNull()Test if group object is null.GrouprangeExcl(int[][] ranges)Create a subset group excluding processes specified by strided intervals of ranks.GrouprangeIncl(int[][] ranges)Create a subset group including processes specified by strided intervals of ranks.static int[]translateRanks(Group group1, int[] ranks1, Group group2)Translate ranks within one group to ranks within another.static Groupunion(Group group1, Group group2)Set union of two groups.
-
-
-
Method Detail
-
getEmpty
protected static long getEmpty()
-
getSize
public int getSize() throws MPIExceptionJava binding of the MPI operationMPI_GROUP_SIZE.- Returns:
- number of processes in the group
- Throws:
MPIException- Signals that an MPI exception of some sort has occurred.
-
getRank
public int getRank() throws MPIExceptionRank of this process in the group.Java binding of the MPI operation
MPI_GROUP_RANK.- Returns:
- rank of this process in the group, or
MPI.UNDEFINEDif this process is not a member of the group. - Throws:
MPIException- Signals that an MPI exception of some sort has occurred.
-
free
public void free() throws MPIExceptionJava binding of the MPI operationMPI_GROUP_FREE.- Specified by:
freein interfaceFreeable- Throws:
MPIException- Signals that an MPI exception of some sort has occurred.
-
isNull
public boolean isNull()
Test if group object is null.- Returns:
- true if the group object is null.
-
translateRanks
public static int[] translateRanks(Group group1, int[] ranks1, Group group2) throws MPIException
Translate ranks within one group to ranks within another.Java binding of the MPI operation
MPI_GROUP_TRANSLATE_RANKS.Result elements are
MPI.UNDEFINEDwhere no correspondence exists.- Parameters:
group1- a groupranks1- array of valid ranks in group1group2- another group- Returns:
- array of corresponding ranks in group2
- Throws:
MPIException- Signals that an MPI exception of some sort has occurred.
-
compare
public static int compare(Group group1, Group group2) throws MPIException
Compare two groups.Java binding of the MPI operation
MPI_GROUP_COMPARE.- Parameters:
group1- first groupgroup2- second group- Returns:
MPI.IDENTif the group members and group order are exactly the same in both groups,MPI.SIMILARif the group members are the same but the order is different,MPI.UNEQUALotherwise.- Throws:
MPIException- Signals that an MPI exception of some sort has occurred.
-
union
public static Group union(Group group1, Group group2) throws MPIException
Set union of two groups.Java binding of the MPI operation
MPI_GROUP_UNION.- Parameters:
group1- first groupgroup2- second group- Returns:
- union group
- Throws:
MPIException- Signals that an MPI exception of some sort has occurred.
-
intersection
public static Group intersection(Group group1, Group group2) throws MPIException
Set intersection of two groups. Java binding of the MPI operationMPI_GROUP_INTERSECTION.- Parameters:
group1- first groupgroup2- second group- Returns:
- intersection group
- Throws:
MPIException- Signals that an MPI exception of some sort has occurred.
-
difference
public static Group difference(Group group1, Group group2) throws MPIException
Set difference of two groups. Java binding of the MPI operationMPI_GROUP_DIFFERENCE.- Parameters:
group1- first groupgroup2- second group- Returns:
- difference group
- Throws:
MPIException- Signals that an MPI exception of some sort has occurred.
-
incl
public Group incl(int[] ranks) throws MPIException
Create a subset group including specified processes.Java binding of the MPI operation
MPI_GROUP_INCL.- Parameters:
ranks- ranks from this group to appear in new group- Returns:
- new group
- Throws:
MPIException- Signals that an MPI exception of some sort has occurred.
-
excl
public Group excl(int[] ranks) throws MPIException
Create a subset group excluding specified processes.Java binding of the MPI operation
MPI_GROUP_EXCL.- Parameters:
ranks- ranks from this group not to appear in new group- Returns:
- new group
- Throws:
MPIException- Signals that an MPI exception of some sort has occurred.
-
rangeIncl
public Group rangeIncl(int[][] ranges) throws MPIException
Create a subset group including processes specified by strided intervals of ranks.Java binding of the MPI operation
MPI_GROUP_RANGE_INCL.The triplets are of the form (first rank, last rank, stride) indicating ranks in this group to be included in the new group. The size of the first dimension of
rangesis the number of triplets. The size of the second dimension is 3.- Parameters:
ranges- array of integer triplets- Returns:
- new group
- Throws:
MPIException- Signals that an MPI exception of some sort has occurred.
-
rangeExcl
public Group rangeExcl(int[][] ranges) throws MPIException
Create a subset group excluding processes specified by strided intervals of ranks.Java binding of the MPI operation
MPI_GROUP_RANGE_EXCL.Triplet array is defined as for
rangeIncl, the ranges indicating ranks in this group to be excluded from the new group.- Parameters:
ranges- array of integer triplets- Returns:
- new group
- Throws:
MPIException- Signals that an MPI exception of some sort has occurred.
-
-