mpjdev
Class Group

java.lang.Object
  extended by mpjdev.Group

public class Group
extends java.lang.Object


Field Summary
static int CONGRUENT
           
static int IDENT
           
 ProcessID[] ids
           
static int NO_RANK
           
static int SIMILAR
           
static int UNEQUAL
           
 
Constructor Summary
Group(ProcessID[] ids, ProcessID myID, int rank)
           
 
Method Summary
static int compare(Group group1, Group group2)
           
static Group difference(Group group1, Group group2)
          Processes in group1, which are not in group2 make another grp.
 Group excl(int[] ranks)
          This method returns a new group object excluding all the ranks specified in the argument array.
 void finalize()
           
 void free()
          This method frees this group object.
 Group incl(int[] ranks)
          This method returns a new group object including all the ranks specified in the argument array.
static Group intersection(Group group1, Group group2)
           
 Group rangeExcl(int[][] ranges)
          implemented, not sure what it does and thus not tested at the moment.
 Group rangeIncl(int[][] ranges)
           
 int rank()
          This method returns the rank of the group.
 int size()
          This method returns the size of the group.
static int[] transRanks(Group group1, int[] ranks1, Group group2)
          ranks1 should be a valid argument in Translate_ranks ranks2.length = ranks1.length
static Group union(Group group1, Group group2)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ids

public ProcessID[] ids

NO_RANK

public static final int NO_RANK
See Also:
Constant Field Values

IDENT

public static final int IDENT
See Also:
Constant Field Values

CONGRUENT

public static final int CONGRUENT
See Also:
Constant Field Values

SIMILAR

public static final int SIMILAR
See Also:
Constant Field Values

UNEQUAL

public static final int UNEQUAL
See Also:
Constant Field Values
Constructor Detail

Group

public Group(ProcessID[] ids,
             ProcessID myID,
             int rank)
Method Detail

free

public void free()
This method frees this group object. Though automatic garbage collector will take care of it, but we mark this object for gc, by declaring it null ... implement at the end.


size

public int size()
This method returns the size of the group. It is a count of the number of process encapsulated by this group object.

Returns:
int The number of processes in this group

rank

public int rank()
This method returns the rank of the group. It is the rank (id) of the calling thread/process in this group.

Returns:
int The rank of the callling process in this group.

transRanks

public static int[] transRanks(Group group1,
                               int[] ranks1,
                               Group group2)
ranks1 should be a valid argument in Translate_ranks ranks2.length = ranks1.length


compare

public static int compare(Group group1,
                          Group group2)

union

public static Group union(Group group1,
                          Group group2)
                   throws MPJDevException
Throws:
MPJDevException

intersection

public static Group intersection(Group group1,
                                 Group group2)

difference

public static Group difference(Group group1,
                               Group group2)
                        throws MPJDevException
Processes in group1, which are not in group2 make another grp.

Throws:
MPJDevException

incl

public Group incl(int[] ranks)
           throws MPJDevException
This method returns a new group object including all the ranks specified in the argument array. Each item of the argument array should be a valid rank in the calling group. The total number of items in argument array should not be more than the size of the existing group. This method is a local operation.

Parameters:
ranks - Integer array specifying the ranks of the processes that will be part of the new group
Returns:
Group The group object of the new process or null if the calling process is not in the new group.
Throws:
MPJDevException

excl

public Group excl(int[] ranks)
           throws MPJDevException
This method returns a new group object excluding all the ranks specified in the argument array. Each item of the argument array should be a valid rank in the calling group. The total number of items in argument array should not be more than the size of the existing group. This method is a local operation.

Parameters:
ranks - Integer array specifying the ranks of the processes that will not be part of the new group
Returns:
Group The group object of the new process or null if the calling process is in argument array.
Throws:
MPJDevException

rangeIncl

public Group rangeIncl(int[][] ranges)
                throws MPJDevException
Throws:
MPJDevException

rangeExcl

public Group rangeExcl(int[][] ranges)
                throws MPJDevException
implemented, not sure what it does and thus not tested at the moment.

Throws:
MPJDevException

finalize

public void finalize()
              throws MPJDevException
Overrides:
finalize in class java.lang.Object
Throws:
MPJDevException