ibis.mpj
Class Intracomm

java.lang.Object
  extended by ibis.mpj.Comm
      extended by ibis.mpj.Intracomm
Direct Known Subclasses:
Cartcomm, Graphcomm

public class Intracomm
extends Comm

Communicator for the collective operations.


Constructor Summary
Intracomm()
           
 
Method Summary
 void allgather(Object sendbuf, int sendoffset, int sendcount, Datatype sendtype, Object recvbuf, int recvoffset, int recvcount, Datatype recvtype)
          Similar to gather, but all processes receive the result.
 void allgatherv(Object sendbuf, int sendoffset, int sendcount, Datatype sendtype, Object recvbuf, int recvoffset, int[] recvcount, int[] displs, Datatype recvtype)
          Similar to gatherv, but all processes receive the result.
 void allreduce(Object sendbuf, int sendoffset, Object recvbuf, int recvoffset, int count, Datatype datatype, Op op)
          Same as reduce except that the result appears in receive buffer of all processes in the group.
 void alltoall(Object sendbuf, int sendoffset, int sendcount, Datatype sendtype, Object recvbuf, int recvoffset, int recvcount, Datatype recvtype)
          Extension to allgather to the case where each process sends distinct data to each of the receivers.
 void alltoallv(Object sendbuf, int sendoffset, int[] sendcount, int[] sdispls, Datatype sendtype, Object recvbuf, int recvoffset, int[] recvcount, int[] rdispls, Datatype recvtype)
          Adds felxibility to alltoall: location of data for send is specified by sdispls and location to place the data on receive side is specified by rdispls.
 void barrier()
          A call to barrier blocks the caller until all processes in the group have called it.
 void bcast(Object sendbuf, int offset, int count, Datatype datatype, int root)
          Broadcast a message from the process with rank root to all processes of the group.
 Object clone()
          Duplicate this communicator.
 Intracomm create(Group group)
          Create a new intra communicator
 Cartcomm createCart(int[] dims, boolean[] periods, boolean reorder)
           NOT IMPLEMENTED YET.
 Graphcomm createGraph(int[] index, int[] edges, boolean reorder)
           NOT IMPLEMENTED YET.
 void gather(Object sendbuf, int sendoffset, int sendcount, Datatype sendtype, 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(Object sendbuf, int sendoffset, int sendcount, Datatype sendtype, Object recvbuf, int recvoffset, int[] recvcount, int[] displs, Datatype recvtype, int root)
          Extends funcionality of gather by allowing varying counts of data from each process.
 void reduce(Object sendBuf, int sendOffset, 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 reduceScatter(Object sendbuf, int sendoffset, 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 vover the output buffers of the processes.
 void scan(Object sendbuf, int sendoffset, Object recvbuf, int recvoffset, int count, Datatype datatype, Op op)
          Perform a prefix reduction on data distributed across the group.
 void scatter(Object sendbuf, int sendoffset, int sendcount, Datatype sendtype, Object recvbuf, int recvoffset, int recvcount, Datatype recvtype, int root)
          Inverse of the operation gather.
 void scatterv(Object sendbuf, int sendoffset, int[] sendcount, int[] displs, Datatype sendtype, Object recvbuf, int recvoffset, int recvcount, Datatype recvtype, int root)
          Inverse of the operation getherv.
 Intracomm split(int colour, int key)
          Partition the group associated with this communicator and create a new communicator within each subgroup.
 
Methods inherited from class ibis.mpj.Comm
abort, attrGet, bsend, bsendInit, compare, createIntercomm, free, group, ibsend, iprobe, irecv, irsend, isend, issend, pack, pack, packSize, probe, rank, recv, recvInit, rsend, rsendInit, send, sendInit, sendrecv, sendrecvReplace, size, ssend, ssendInit, testInter, topoTest, unpack
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Intracomm

public Intracomm()
          throws MPJException
Throws:
MPJException
Method Detail

clone

public Object clone()
Description copied from class: Comm
Duplicate this communicator. The new communicator is "congruent" to the old one, but has a differnt context.

Overrides:
clone in class Comm
Returns:
copy of this communicator

create

public Intracomm create(Group group)
                 throws MPJException
Create a new intra communicator

Parameters:
group - group to be associated with the new communicator
Returns:
new intra communicator
Throws:
MPJException

split

public Intracomm split(int colour,
                       int key)
                throws MPJException
Partition the group associated with this communicator and create a new communicator within each subgroup.

Parameters:
colour - control of subset assignment
key - control of rank assignment
Returns:
new intra communicator
Throws:
MPJException

barrier

public void barrier()
             throws MPJException
A call to barrier blocks the caller until all processes in the group have called it.

Throws:
MPJException

bcast

public void bcast(Object sendbuf,
                  int offset,
                  int count,
                  Datatype datatype,
                  int root)
           throws MPJException
Broadcast a message from the process with rank root to all processes of the group.

Parameters:
sendbuf - 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
Throws:
MPJException

gather

public void gather(Object sendbuf,
                   int sendoffset,
                   int sendcount,
                   Datatype sendtype,
                   Object recvbuf,
                   int recvoffset,
                   int recvcount,
                   Datatype recvtype,
                   int root)
            throws MPJException
Each process sends the contents of its send buffer to the root process.

Parameters:
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 in receive buffer
recvtype - datatype of each item in receive buffer
root - rank of receiving process
Throws:
MPJException

gatherv

public void gatherv(Object sendbuf,
                    int sendoffset,
                    int sendcount,
                    Datatype sendtype,
                    Object recvbuf,
                    int recvoffset,
                    int[] recvcount,
                    int[] displs,
                    Datatype recvtype,
                    int root)
             throws MPJException
Extends funcionality of gather by allowing varying counts of data from each process. The sizes of arrays recvcount 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. Note that if recvtype is a derived datatype, elements of displs are in units of the derived type extent, (unlike recvoffset, which is a direct index into the buffer array).

Parameters:
sendbuf - send buffer array
sendoffset - initial offset in send buffer
sendcount - number of items in send buffer
sendtype - datatype of each item in send buffer
recvbuf - receive buffer array
recvoffset - initial offset in receive buffer
recvcount - number of items in receive buffer
displs - displacements at which to place incoming data
recvtype - datatype of each item in receive buffer
root - rank of receiving process
Throws:
MPJException

scatter

public void scatter(Object sendbuf,
                    int sendoffset,
                    int sendcount,
                    Datatype sendtype,
                    Object recvbuf,
                    int recvoffset,
                    int recvcount,
                    Datatype recvtype,
                    int root)
             throws MPJException
Inverse of the operation gather.

Parameters:
sendbuf - send buffer array
sendoffset - initial offset in send buffer
sendcount - number of items sent to each process
sendtype - datatype of send buffer items
recvbuf - receive buffer array
recvoffset - initial offset in receive buffer
recvcount - number of items in receive buffer
recvtype - datatype of receive buffer items
root - rank of sending process
Throws:
MPJException

scatterv

public void scatterv(Object sendbuf,
                     int sendoffset,
                     int[] sendcount,
                     int[] displs,
                     Datatype sendtype,
                     Object recvbuf,
                     int recvoffset,
                     int recvcount,
                     Datatype recvtype,
                     int root)
              throws MPJException
Inverse of the operation getherv.

Parameters:
sendbuf - send buffer array
sendoffset - initial offset in send buffer
sendcount - 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 elements in receive buffer
recvtype - datatype of receive buffer items
root - rank of sending process
Throws:
MPJException

allgather

public void allgather(Object sendbuf,
                      int sendoffset,
                      int sendcount,
                      Datatype sendtype,
                      Object recvbuf,
                      int recvoffset,
                      int recvcount,
                      Datatype recvtype)
               throws MPJException
Similar to gather, but all processes receive the result.

Parameters:
sendbuf - send buffer array
sendoffset - initial offset in send buffer
sendcount - number of items sent to each process
sendtype - datatype of send buffer items
recvbuf - receive buffer array
recvoffset - initial offset in receive buffer
recvcount - number of items in receive buffer
recvtype - datatype of receive buffer items
Throws:
MPJException

allgatherv

public void allgatherv(Object sendbuf,
                       int sendoffset,
                       int sendcount,
                       Datatype sendtype,
                       Object recvbuf,
                       int recvoffset,
                       int[] recvcount,
                       int[] displs,
                       Datatype recvtype)
                throws MPJException
Similar to gatherv, but all processes receive the result.

Parameters:
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 - numver of elements received from each process
displs - displacements at which to place incoming data
recvtype - datatype of each item in receive buffer
Throws:
MPJException

alltoall

public void alltoall(Object sendbuf,
                     int sendoffset,
                     int sendcount,
                     Datatype sendtype,
                     Object recvbuf,
                     int recvoffset,
                     int recvcount,
                     Datatype recvtype)
              throws MPJException
Extension to allgather to the case where each process sends distinct data to each of the receivers.

Parameters:
sendbuf - send buffer array
sendoffset - initial offset in send buffer
sendcount - number of items sent to each process
sendtype - datatype of send buffer items
recvbuf - receive buffer array
recvoffset - initial offset in receive buffer
recvcount - number of items received fram any process
recvtype - datatype of receive buffer items
Throws:
MPJException

alltoallv

public void alltoallv(Object sendbuf,
                      int sendoffset,
                      int[] sendcount,
                      int[] sdispls,
                      Datatype sendtype,
                      Object recvbuf,
                      int recvoffset,
                      int[] recvcount,
                      int[] rdispls,
                      Datatype recvtype)
               throws MPJException
Adds felxibility to alltoall: location of data for send is specified by sdispls and location to place the data on receive side is specified by rdispls.

Parameters:
sendbuf - send buffer array
sendoffset - initial offset in send buffer
sendcount - number of items sent to each process
sdispls - 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 elements received from each process
rdispls - displacements at which to place incoming data
recvtype - datatype of each item in receive buffer
Throws:
MPJException

reduce

public void reduce(Object sendBuf,
                   int sendOffset,
                   Object recvBuf,
                   int recvOffset,
                   int count,
                   Datatype datatype,
                   Op op,
                   int root)
            throws MPJException
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.

Parameters:
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 - datatype of each item in send buffer
op - reduce operation
root - rank of root process
Throws:
MPJException

allreduce

public void allreduce(Object sendbuf,
                      int sendoffset,
                      Object recvbuf,
                      int recvoffset,
                      int count,
                      Datatype datatype,
                      Op op)
               throws MPJException
Same as reduce except that the result appears in receive buffer of all processes in the group.

Parameters:
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
Throws:
MPJException

reduceScatter

public void reduceScatter(Object sendbuf,
                          int sendoffset,
                          Object recvbuf,
                          int recvoffset,
                          int[] recvcounts,
                          Datatype datatype,
                          Op op)
                   throws MPJException
Combine elements in input buffer of each process using the reduce operation, and scatter the combined values vover the output buffers of the processes.

Parameters:
sendbuf - send buffer array
sendoffset - initial offset in send buffer
recvbuf - receive buffer array
recvoffset - initial offset in receive buffer
recvcounts - number of result elements distributed to each process
datatype - datatype of each item in send buffer
op - reduce operation
Throws:
MPJException

scan

public void scan(Object sendbuf,
                 int sendoffset,
                 Object recvbuf,
                 int recvoffset,
                 int count,
                 Datatype datatype,
                 Op op)
          throws MPJException
Perform a prefix reduction on data distributed across the group.

Parameters:
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 - datatype of each item in input buffer
op - reduce operation
Throws:
MPJException

createGraph

public Graphcomm createGraph(int[] index,
                             int[] edges,
                             boolean reorder)
                      throws MPJException
NOT IMPLEMENTED YET. Create a graph topology communicator whose group is a subset of the group of this communicator. 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].

Parameters:
index - node degrees
edges - graph edges
reorder - true if ranking my be reordered, false if not
Returns:
new graph topology communicator
Throws:
MPJException

createCart

public Cartcomm createCart(int[] dims,
                           boolean[] periods,
                           boolean reorder)
                    throws MPJException
NOT IMPLEMENTED YET. Create a Cartesian topology communicator whose group is a subset of the group of this communicator. 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.

Parameters:
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
Throws:
MPJException


The Ibis project