Group
Date: 2015-04-18

mpi

## Class Group

- java.lang.Object
- - mpi.Group

-     public class Group
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `code`
    `static int` | `EMPTY`
    `mpjdev.Group` | `mpjdevGroup`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Group(mpjdev.Group mpjdevGroup)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `Compare(Group group1, Group group2)` Compare two groups.
    `static Group` | `Difference(Group group1, Group group2)` Result contains all elements of the first group that are not in the second group.
    `Group` | `Excl(int[] ranks)` Create a subset group excluding specified processes.
    `void` | `finalize()` Destructor.
    `void` | `free()` This method frees this group object.
    `Group` | `Incl(int[] ranks)` Create a subset group including specified processes.
    `static Group` | `Intersection(Group group1, Group group2)` Set intersection of two groups.
    `Group` | `Range_excl(int[][] ranges)` Create a subset group excluding processes specified by strided intervals of ranks.
    `Group` | `Range_incl(int[][] ranges)` 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.
    `static int[]` | `Translate_ranks(Group group1, int[] ranks1, Group group2)` Translate ranks within one group to ranks within another.
    `static Group` | `Union(Group group1, Group group2)` Set union of two groups.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EMPTY

          public static final int EMPTY

      See Also:
        Constant Field Values

    - #### code

          public int code

    - #### mpjdevGroup

          public mpjdev.Group mpjdevGroup

  - ### Constructor Detail

    - #### Group

          public Group(mpjdev.Group mpjdevGroup)

  - ### 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()
                   throws MPIException

      Size of group.

      returns: | number of processors in the group

      Java binding of the MPI operation `MPI_GROUP_SIZE`.

      Throws:
        `MPIException`

    - #### Rank

          public int Rank()
                   throws MPIException

      Rank of this process in group.

      returns: | rank of the calling process in the group

      Java binding of the MPI operation `MPI_GROUP_RANK`. Result value is `MPI.UNDEFINED` if this process is not a member of the group.

      Throws:
        `MPIException`

    - #### Translate_ranks

          public static int[] Translate_ranks(Group group1,
                              int[] ranks1,
                              Group group2)
                                       throws MPIException

      Translate ranks within one group to ranks within another.

      `group1` | a group
      `ranks1` | array of valid ranks in `group1`
      `group2` | another group
      returns: | array of corresponding ranks in `group2`

      Java binding of the MPI operation `MPI_GROUP_TRANSLATE_RANKS`.

      Result elements are `MPI.UNDEFINED` where no correspondence exists.

      Throws:
        `MPIException`

    - #### Compare

          public static int Compare(Group group1,
                    Group group2)
                             throws MPIException

      Compare two groups.

      `group1` | first group
      `group2` | second group
      returns: | result

      Java binding of the MPI operation `MPI_GROUP_COMPARE`.

      `MPI.IDENT` results if the group members and group order are exactly the same in both groups. `MPI.SIMILAR` results if the group members are the same but the order is different. `MPI.UNEQUAL` results otherwise.

      Throws:
        `MPIException`

    - #### Union

          public static Group Union(Group group1,
                    Group group2)
                             throws MPIException

      Set union of two groups.

      `group1` | first group
      `group2` | second group
      returns: | union group

      Java binding of the MPI operation `MPI_GROUP_UNION`.

      Throws:
        `MPIException`

    - #### Intersection

          public static Group Intersection(Group group1,
                           Group group2)
                                    throws MPIException

      Set intersection of two groups.

      `group1` | first group
      `group2` | second group
      returns: | intersection group

      Java binding of the MPI operation `MPI_GROUP_INTERSECTION`.

      Throws:
        `MPIException`

    - #### Difference

          public static Group Difference(Group group1,
                         Group group2)
                                  throws MPIException

      Result contains all elements of the first group that are not in the second group.

      `group1` | first group
      `group2` | second group
      returns: | difference group

      Java binding of the MPI operation `MPI_GROUP_DIFFERENCE`.

      Throws:
        `MPIException`

    - #### Incl

          public Group Incl(int[] ranks)
                     throws MPIException

      Create a subset group including specified processes.

      `ranks` | ranks from this group to appear in new group
      returns: | new group

      Java binding of the MPI operation `MPI_GROUP_INCL`.

      Throws:
        `MPIException`

    - #### Excl

          public Group Excl(int[] ranks)
                     throws MPIException

      Create a subset group excluding specified processes.

      `ranks` | ranks from this group not to appear in new group
      returns: | new group

      Java binding of the MPI operation `MPI_GROUP_EXCL`.

      Throws:
        `MPIException`

    - #### Range_incl

          public Group Range_incl(int[][] ranges)
                           throws MPIException

      Create a subset group including processes specified by strided intervals of ranks.

      `ranges` | array of integer triplets
      returns: | new group

      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 `ranges` is the number of triplets. The size of the second dimension is 3.

      Throws:
        `MPIException`

    - #### Range_excl

          public Group Range_excl(int[][] ranges)
                           throws MPIException

      Create a subset group excluding processes specified by strided intervals of ranks.

      `ranges` | array of integer triplets
      returns: | new group

      Java binding of the MPI operation `MPI_GROUP_RANGE_EXCL`.

      Triplet array is defined as for `Range_incl`, the ranges indicating ranks in this group to be excluded from the new group.

      Throws:
        `MPIException`

    - #### finalize

          public void finalize()
                        throws MPIException

      Destructor.

      Java binding of the MPI operation `MPI_GROUP_FREE`.

      Overrides:
        `finalize` in class `java.lang.Object`
      Throws:
        `MPIException`