Intracomm
Date: 2015-04-18

mpi

## Class Intracomm

- java.lang.Object
- - mpi.Comm
  - - mpi.Intracomm

- Direct Known Subclasses:
    Cartcomm, Graphcomm

      public class Intracomm
      extends Comm

- - ### Field Summary

    - ### Fields inherited from class mpi.Comm

      `group, mpjdevComm`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `Allgather(java.lang.Object sendbuf, int sendoffset, int sendcount, Datatype sendtype, java.lang.Object recvbuf, int recvoffset, int recvcount, Datatype recvtype)` Similar to `Gather`, but all processes receive the result.
    `void` | `Allgatherv(java.lang.Object sendbuf, int sendoffset, int sendcount, Datatype sendtype, java.lang.Object recvbuf, int recvoffset, int[] recvcount, int[] displs, Datatype recvtype)` Similar to `Gatherv`, but all processes receive the result.
    `void` | `Allreduce(java.lang.Object sendbuf, int sendoffset, java.lang.Object recvbuf, int recvoffset, int count, Datatype datatype, Op op)` Same as `reduce` except that the result appears in receive buffer of all process in the group.
    `void` | `Alltoall(java.lang.Object sendbuf, int sendoffset, int sendcount, Datatype sendtype, java.lang.Object recvbuf, int recvoffset, int recvcount, Datatype recvtype)` Extension of `Allgather` to the case where each process sends distinct data to each of the receivers.
    `void` | `Alltoallv(java.lang.Object sendbuf, int sendoffset, int[] sendcount, int[] sdispls, Datatype sendtype, java.lang.Object recvbuf, int recvoffset, int[] recvcount, int[] rdispls, Datatype recvtype)` Adds flexibility to `Alltoall`: location of data for send is specified by `sdispls` and location to place data on receive side is specified by `rdispls`.
    `void` | `Barrier()` Broadcast a message from the process with rank `root` to all processes of the group.
    `void` | `Bcast(java.lang.Object buf, int offset, int count, Datatype type, int root)` Broadcast a message from the process with rank `root` to all processes of the group.
    `java.lang.Object` | `clone()` Clone the communicator This method will be called only by intracommunicator ....
    `static int` | `Compare(Comm comm1, Comm comm2)` Compare two communicators.
    `Cartcomm` | `Create_cart(int[] dims, boolean[] periods, boolean reorder)` Create a Cartesian topology communicator whose group is a subset of the group of this communicator.
    `Graphcomm` | `Create_graph(int[] index, int[] edges, boolean reorder)` Create a graph topology communicator whose group is a subset of the group of this communicator.
    `Intracomm` | `Create(Group group)` Create a new communicator.
    `void` | `Gather(java.lang.Object sendbuf, int sendoffset, int sendcount, Datatype sendtype, java.lang.Object recvbuf, int recvoffset, int recvcount, Datatype recvtype, int root)` Each process sends the contents of its send buffer to the root process.
    `void` | `Gatherv(java.lang.Object sendbuf, int sendoffset, int sendcount, Datatype sendtype, java.lang.Object recvbuf, int recvoffset, int[] recvcount, int[] displs, Datatype recvtype, int root)` Extends functionality of `Gather` by allowing varying counts of data from each process.
    `void` | `Reduce_scatter(java.lang.Object sendbuf, int sendoffset, java.lang.Object recvbuf, int recvoffset, int[] recvcounts, Datatype datatype, Op op)` Combine elements in input buffer of each process using the reduce operation, and scatter the combined values over the output buffers of the processes.
    `void` | `Reduce(java.lang.Object sendbuf, int sendoffset, java.lang.Object recvbuf, int recvoffset, int count, Datatype datatype, Op op, int root)` Combine elements in input buffer of each process using the reduce operation, and return the combined value in the output buffer of the root process.
    `void` | `Scan(java.lang.Object sendbuf, int sendoffset, java.lang.Object recvbuf, int recvoffset, int count, Datatype datatype, Op op)` Perform a prefix reduction on data distributed across the group.
    `void` | `Scatter(java.lang.Object sendbuf, int sendoffset, int sendcount, Datatype sendtype, java.lang.Object recvbuf, int recvoffset, int recvcount, Datatype recvtype, int root)` Inverse of the operation `Gather`.
    `void` | `Scatterv(java.lang.Object sendbuf, int sendoffset, int[] sendcount, int[] displs, Datatype sendtype, java.lang.Object recvbuf, int recvoffset, int recvcount, Datatype recvtype, int root)` Inverse of the operation `Gatherv`.
    `Intracomm` | `Split(int color, int key)` Partition the group associated with this communicator and create a new communicator within each subgroup.

    - ### Methods inherited from class mpi.Comm

      `Abort, Attr_delete, Attr_get, Bsend_init, Bsend, bsend, Create_intercomm, Free, Group, Ibsend, ibsend, Iprobe, Irecv, irecv, Irsend, irsend, Isend, isend, Issend, issend, Pack_size, Pack, Probe, Rank, Recv_init, Recv, recv, Rsend_init, Rsend, rsend, Send_init, Send, send, Sendrecv_replace, sendrecv, Sendrecv, Size, Ssend_init, Ssend, ssend, Test_inter, Topo_test, Unpack`

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

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

- - ### Method Detail

    - #### Compare

          public static int Compare(Comm comm1,
                    Comm comm2)
                             throws MPIException

      Compare two communicators.

      `comm1` | first communicator
      `comm2` | second communicator
      returns: | result

      Java binding of the MPI operation `MPI_COMM_COMPARE`.

      `MPI.IDENT`(0) results if the `comm1` and `comm2` are references to the same object (ie, if `comm1 == comm2`). `MPI.CONGRUENT`(3) results if the underlying groups are identical but the communicators differ by context. `MPI.SIMILAR`(1) results if the underlying groups are similar but the communicators differ by context. `MPI.UNEQUAL`(2) results otherwise.

      Throws:
        `MPIException`

    - #### Split

          public Intracomm Split(int color,
                        int key)
                          throws MPIException

      Partition the group associated with this communicator and create a new communicator within each subgroup.

      `color` | control of subset assignment
      `key` | control of rank assignment
      returns: | new communicator

      Java binding of the MPI operation `MPI_COMM_SPLIT`.

      Throws:
        `MPIException`

    - #### clone

          public java.lang.Object clone()
                                 throws MPIException

      Clone the communicator This method will be called only by intracommunicator .... changed the return value to Intracomm ...(instead of Object) ...
      Overrides:
        `clone` in class `Comm`
      Throws:
        `MPIException`

    - #### Create

          public Intracomm Create(Group group)
                           throws MPIException

      Create a new communicator.

      `group` | group which is a subset of the group of this communicator
      returns: | new communicator

      Java binding of the MPI operation `MPI_COMM_CREATE`.

      Throws:
        `MPIException`

    - #### Barrier

          public void Barrier()
                       throws MPIException

      Broadcast a message from the process with rank `root` to all processes of the group.

      `buf` | buffer array
      `offset` | initial offset in buffer
      `count` | number of items in buffer
      `datatype` | datatype of each item in buffer
      /** A call to `Barrier` blocks the caller until all process in the group have called it.

      Java binding of the MPI operation `MPI_BARRIER`.

      Throws:
        `MPIException`

    - #### Bcast

          public void Bcast(java.lang.Object buf,
                   int offset,
                   int count,
                   Datatype type,
                   int root)
                     throws MPIException

      Broadcast a message from the process with rank `root` to all processes of the group.

      `buf` | buffer array
      `offset` | initial offset in buffer
      `count` | number of items in buffer
      `datatype` | datatype of each item in buffer
      `root` | rank of broadcast root

      Java binding of the MPI operation `MPI_BCST`.

      Throws:
        `MPIException`

    - #### Gather

          public void Gather(java.lang.Object sendbuf,
                    int sendoffset,
                    int sendcount,
                    Datatype sendtype,
                    java.lang.Object recvbuf,
                    int recvoffset,
                    int recvcount,
                    Datatype recvtype,
                    int root)
                      throws MPIException

      Each process sends the contents of its send buffer to the root process.

      `sendbuf` | send buffer array
      `sendoffset` | initial offset in send buffer
      `sendcount` | number of items to send
      `sendtype` | datatype of each item in send buffer
      `recvbuf` | receive buffer array
      `recvoffset` | initial offset in receive buffer
      `recvcount` | number of items to receive
      `recvtype` | datatype of each item in receive buffer
      `root` | rank of receiving process

      Java binding of the MPI operation `MPI_GATHER`.

      Throws:
        `MPIException`

    - #### Gatherv

          public void Gatherv(java.lang.Object sendbuf,
                     int sendoffset,
                     int sendcount,
                     Datatype sendtype,
                     java.lang.Object recvbuf,
                     int recvoffset,
                     int[] recvcount,
                     int[] displs,
                     Datatype recvtype,
                     int root)
                       throws MPIException

      Extends functionality of `Gather` by allowing varying counts of data from each process.

      `sendbuf` | send buffer array
      `sendoffset` | initial offset in send buffer
      `sendcount` | number of items to send
      `sendtype` | datatype of each item in send buffer
      `recvbuf` | receive buffer array
      `recvoffset` | initial offset in receive buffer
      `recvcounts` | number of elements received from each process
      `displs` | displacements at which to place incoming data
      `recvtype` | datatype of each item in receive buffer
      `root` | rank of receiving process

      Java binding of the MPI operation `MPI_GATHERV`.

      The sizes of arrays `recvcounts` and `displs` should be the size of the group. Entry i of `displs` specifies the displacement relative to element `recvoffset` of `recvbuf` at which to place incoming data.

      Throws:
        `MPIException`

    - #### Scatter

          public void Scatter(java.lang.Object sendbuf,
                     int sendoffset,
                     int sendcount,
                     Datatype sendtype,
                     java.lang.Object recvbuf,
                     int recvoffset,
                     int recvcount,
                     Datatype recvtype,
                     int root)
                       throws MPIException

      Inverse of the operation `Gather`.

      `sendbuf` | send buffer array
      `sendoffset` | initial offset in send buffer
      `sendcount` | number of items to send
      `sendtype` | datatype of each item in send buffer
      `recvbuf` | receive buffer array
      `recvoffset` | initial offset in receive buffer
      `recvcount` | number of items to receive
      `recvtype` | datatype of each item in receive buffer
      `root` | rank of sending process

      Java binding of the MPI operation `MPI_SCATTER`.

      Throws:
        `MPIException`

    - #### Scatterv

          public void Scatterv(java.lang.Object sendbuf,
                      int sendoffset,
                      int[] sendcount,
                      int[] displs,
                      Datatype sendtype,
                      java.lang.Object recvbuf,
                      int recvoffset,
                      int recvcount,
                      Datatype recvtype,
                      int root)
                        throws MPIException

      Inverse of the operation `Gatherv`.

      `sendbuf` | send buffer array
      `sendoffset` | initial offset in send buffer
      `sendcounts` | number of items sent to each process
      `displs` | displacements from which to take outgoing data
      `sendtype` | datatype of each item in send buffer
      `recvbuf` | receive buffer array
      `recvoffset` | initial offset in receive buffer
      `recvcount` | number of items to receive
      `recvtype` | datatype of each item in receive buffer
      `root` | rank of sending process

      Java binding of the MPI operation `MPI_SCATTERV`.

      Throws:
        `MPIException`

    - #### Allgather

          public void Allgather(java.lang.Object sendbuf,
                       int sendoffset,
                       int sendcount,
                       Datatype sendtype,
                       java.lang.Object recvbuf,
                       int recvoffset,
                       int recvcount,
                       Datatype recvtype)
                         throws MPIException

      Similar to `Gather`, but all processes receive the result.

      `sendbuf` | send buffer array
      `sendoffset` | initial offset in send buffer
      `sendcount` | number of items to send
      `sendtype` | datatype of each item in send buffer
      `recvbuf` | receive buffer array
      `recvoffset` | initial offset in receive buffer
      `recvcount` | number of items to receive
      `recvtype` | datatype of each item in receive buffer

      Java binding of the MPI operation `MPI_ALLGATHER`.

      Throws:
        `MPIException`

    - #### Allgatherv

          public void Allgatherv(java.lang.Object sendbuf,
                        int sendoffset,
                        int sendcount,
                        Datatype sendtype,
                        java.lang.Object recvbuf,
                        int recvoffset,
                        int[] recvcount,
                        int[] displs,
                        Datatype recvtype)
                          throws MPIException

      Similar to `Gatherv`, but all processes receive the result.

      `sendbuf` | send buffer array
      `sendoffset` | initial offset in send buffer
      `sendcount` | number of items to send
      `sendtype` | datatype of each item in send buffer
      `recvbuf` | receive buffer array
      `recvoffset` | initial offset in receive buffer
      `recvcounts` | number of elements received from each process
      `displs` | displacements at which to place incoming data
      `recvtype` | datatype of each item in receive buffer

      Java binding of the MPI operation `MPI_ALLGATHERV`.

      Throws:
        `MPIException`

    - #### Alltoall

          public void Alltoall(java.lang.Object sendbuf,
                      int sendoffset,
                      int sendcount,
                      Datatype sendtype,
                      java.lang.Object recvbuf,
                      int recvoffset,
                      int recvcount,
                      Datatype recvtype)
                        throws MPIException

      Extension of `Allgather` to the case where each process sends distinct data to each of the receivers.

      `sendbuf` | send buffer array
      `sendoffset` | initial offset in send buffer
      `sendcount` | number of items sent to each process
      `sendtype` | datatype send buffer items
      `recvbuf` | receive buffer array
      `recvoffset` | initial offset in receive buffer
      `recvcount` | number of items received from any process
      `recvtype` | datatype of receive buffer items

      Java binding of the MPI operation `MPI_ALLTOALL`.

      Throws:
        `MPIException`

    - #### Alltoallv

          public void Alltoallv(java.lang.Object sendbuf,
                       int sendoffset,
                       int[] sendcount,
                       int[] sdispls,
                       Datatype sendtype,
                       java.lang.Object recvbuf,
                       int recvoffset,
                       int[] recvcount,
                       int[] rdispls,
                       Datatype recvtype)
                         throws MPIException

      Adds flexibility to `Alltoall`: location of data for send is specified by `sdispls` and location to place data on receive side is specified by `rdispls`.

      `sendbuf` | send buffer array
      `sendoffset` | initial offset in send buffer
      `sendcounts` | number of items sent to each process
      `sdispls` | displacements from which to take outgoing data
      `sendtype` | datatype send buffer items
      `recvbuf` | receive buffer array
      `recvoffset` | initial offset in receive buffer
      `recvcounts` | number of elements received from each process
      `rdispls` | displacements at which to place incoming data
      `recvtype` | datatype of each item in receive buffer

      Java binding of the MPI operation `MPI_ALLTOALLV`.

      Throws:
        `MPIException`

    - #### Reduce

          public void Reduce(java.lang.Object sendbuf,
                    int sendoffset,
                    java.lang.Object recvbuf,
                    int recvoffset,
                    int count,
                    Datatype datatype,
                    Op op,
                    int root)
                      throws MPIException

      Combine elements in input buffer of each process using the reduce operation, and return the combined value in the output buffer of the root process.

      `sendbuf` | send buffer array
      `sendoffset` | initial offset in send buffer
      `recvbuf` | receive buffer array
      `recvoffset` | initial offset in receive buffer
      `count` | number of items in send buffer
      `datatype` | data type of each item in send buffer
      `op` | reduce operation
      `root` | rank of root process

      Java binding of the MPI operation `MPI_REDUCE`.

      The predefined operations are available in Java as `MPI.MAX`, `MPI.MIN`, `MPI.SUM`, `MPI.PROD`, `MPI.LAND`, `MPI.BAND`, `MPI.LOR`, `MPI.BOR`, `MPI.LXOR`, `MPI.BXOR`, `MPI.MINLOC` and `MPI.MAXLOC`.

      Throws:
        `MPIException`

    - #### Allreduce

          public void Allreduce(java.lang.Object sendbuf,
                       int sendoffset,
                       java.lang.Object recvbuf,
                       int recvoffset,
                       int count,
                       Datatype datatype,
                       Op op)
                         throws MPIException

      Same as `reduce` except that the result appears in receive buffer of all process in the group.

      `sendbuf` | send buffer array
      `sendoffset` | initial offset in send buffer
      `recvbuf` | receive buffer array
      `recvoffset` | initial offset in receive buffer
      `count` | number of items in send buffer
      `datatype` | data type of each item in send buffer
      `op` | reduce operation

      Java binding of the MPI operation `MPI_ALLREDUCE`.

      Throws:
        `MPIException`

    - #### Reduce_scatter

          public void Reduce_scatter(java.lang.Object sendbuf,
                            int sendoffset,
                            java.lang.Object recvbuf,
                            int recvoffset,
                            int[] recvcounts,
                            Datatype datatype,
                            Op op)
                              throws MPIException

      Combine elements in input buffer of each process using the reduce operation, and scatter the combined values over the output buffers of the processes.

      `sendbuf` | send buffer array
      `sendoffset` | initial offset in send buffer
      `recvbuf` | receive buffer array
      `recvoffset` | initial offset in receive buffer
      `recvcounts` | numbers of result elements distributed to each process
      `datatype` | data type of each item in send buffer
      `op` | reduce operation

      Java binding of the MPI operation `MPI_REDUCE_SCATTER`.

      Throws:
        `MPIException`

    - #### Scan

          public void Scan(java.lang.Object sendbuf,
                  int sendoffset,
                  java.lang.Object recvbuf,
                  int recvoffset,
                  int count,
                  Datatype datatype,
                  Op op)
                    throws MPIException

      Perform a prefix reduction on data distributed across the group.

      `sendbuf` | send buffer array
      `sendoffset` | initial offset in send buffer
      `recvbuf` | receive buffer array
      `recvoffset` | initial offset in receive buffer
      `count` | number of items in input buffer
      `datatype` | data type of each item in input buffer
      `op` | reduce operation

      Java binding of the MPI operation `MPI_SCAN`.

      Throws:
        `MPIException`

    - #### Create_cart

          public Cartcomm Create_cart(int[] dims,
                             boolean[] periods,
                             boolean reorder)
                               throws MPIException

      Create a Cartesian topology communicator whose group is a subset of the group of this communicator.

      `dims` | the number of processes in each dimension
      `periods` | `true` if grid is periodic, `false` if not, in each dimension
      `reorder` | `true` if ranking may be reordered, `false` if not
      returns: | new Cartesian topology communicator

      Java binding of the MPI operation `MPI_CART_CREATE`.

      The number of dimensions of the Cartesian grid is taken to be the size of the `dims` argument. The array `periods` must be the same size.

      Throws:
        `MPIException`

    - #### Create_graph

          public Graphcomm Create_graph(int[] index,
                               int[] edges,
                               boolean reorder)

      Create a graph topology communicator whose group is a subset of the group of this communicator.

      `index` | node degrees
      `edges` | graph edges
      `reorder` | `true` if ranking may be reordered, `false` if not
      returns: | new graph topology communicator

      Java binding of the MPI operation `MPI_GRAPH_CREATE`.

      The number of nodes in the graph, nnodes, is taken to be size of the `index` argument. The size of array `edges` must be `index [nnodes} - 1]`.