ibis.mpj
Class Group

java.lang.Object
  extended by ibis.mpj.Group

public class Group
extends Object

Organisation of groups within each communicator.


Constructor Summary
Group()
           
 
Method Summary
static int compare(Group group1, Group group2)
          Compare two groups.
static Group difference(Group group1, Group group2)
          Result contains all elements of this group that are not in group1.
 Group excl(int[] ranks)
          Create a subset group excluding specified processes.
 Group incl(int[] ranks)
          Create a subset group including specified processes.
static Group intersection(Group group1, Group group2)
          Set intersection of two groups.
 Group rangeExcl(int[][] ranks)
          Create a subset group of excluding processes specified by strided intervals of ranks.
 Group rangeIncl(int[][] ranks)
          Create a subset group including processes specified by strided intervals of ranks.
 int rank()
          Rank of this process in group.
 int size()
          Size of group.
 int[] translateRanks(Group group1, int[] ranks1)
          Translate ranks within another group to ranks within this group.
static Group union(Group group1, Group group2)
          Set union of two groups
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Group

public Group()
Method Detail

size

public int size()
         throws MPJException
Size of group. Result value is MPJ.UNDEFINED if the group is not initialized.

Returns:
number of processes in the group
Throws:
MPJException

rank

public int rank()
         throws MPJException
Rank of this process in group. Result value is MPJ.UNDEFINED if this process is not a member of the group.

Returns:
rank of the calling process in the group
Throws:
MPJException

translateRanks

public int[] translateRanks(Group group1,
                            int[] ranks1)
                     throws MPJException
Translate ranks within another group to ranks within this group. Result elements are MPJ.UNDEFINED where no correspondence exists.

Parameters:
group1 - another group
ranks1 - array of valid ranks in group1
Returns:
array of corresponding ranks in this group
Throws:
MPJException

compare

public static int compare(Group group1,
                          Group group2)
                   throws MPJException
Compare two groups. MPJ.IDENT results if the group members and group order are exactly the same in both groups. MPJ.SIMILAR results if the group members are the same, but the order is different. MPJ.UNEQUAL results otherwise.

Parameters:
group1 - the group to compare with
Returns:
MPJ.IDENT, MPJ.SIMILAR or MPJ.UNEQUAL
Throws:
MPJException

union

public static Group union(Group group1,
                          Group group2)
                   throws MPJException
Set union of two groups

Parameters:
group1 - the group to set union with
Returns:
union group
Throws:
MPJException

intersection

public static Group intersection(Group group1,
                                 Group group2)
                          throws MPJException
Set intersection of two groups.

Parameters:
group1 - the group to set intersection with
Returns:
intersection group
Throws:
MPJException

difference

public static Group difference(Group group1,
                               Group group2)
                        throws MPJException
Result contains all elements of this group that are not in group1.

Parameters:
group1 - the group to set difference with
Returns:
difference group
Throws:
MPJException

incl

public Group incl(int[] ranks)
           throws MPJException
Create a subset group including specified processes.

Parameters:
ranks - ranks from this group appear in new group
Returns:
new group
Throws:
MPJException

excl

public Group excl(int[] ranks)
           throws MPJException
Create a subset group excluding specified processes.

Parameters:
ranks - ranks from this group not to appear in new group
Returns:
new group
Throws:
MPJException

rangeIncl

public Group rangeIncl(int[][] ranks)
                throws MPJException
Create a subset group including processes specified by strided intervals of ranks. 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 ranges is the number of triplets. The size of the second dimension is 3.

Parameters:
ranks - array of integer triplets
Returns:
new group
Throws:
MPJException

rangeExcl

public Group rangeExcl(int[][] ranks)
                throws MPJException
Create a subset group of excluding processes specified by strided intervals of ranks. Triplet array is defined as for rangeIncl, the ranges indicating ranks in this group to be excluded from the new group

Parameters:
ranks - array of integer triplets
Returns:
new group
Throws:
MPJException


The Ibis project