mpi
Class Cartcomm

java.lang.Object
  extended by mpi.Comm
      extended by mpi.Intracomm
          extended by mpi.Cartcomm

public class Cartcomm
extends Intracomm


Method Summary
 java.lang.Object clone()
          Duplicate this communicator.
 int[] Coords(int rank)
          Translate process rank to logical process coordinates.
static void Dims_create(int nnodes, int[] dims)
          Select a balanced distribution of processes per coordinate direction.
 CartParms Get()
          Returns Cartesian topology information.
 int Map(int[] dims, boolean[] periods)
          Compute an optimal placement.
 int Rank(int[] coords)
          Translate logical process coordinates to process rank.
 ShiftParms Shift(int direction, int disp)
          Compute source and destination ranks for "shift" communication.
 Cartcomm Sub(boolean[] remainDims)
          Partition Cartesian communicator into subgroups of lower dimension.
 int Topo_test()
          Returns the type of topology associated with the communicator.
 
Methods inherited from class mpi.Intracomm
Allgather, Allgatherv, Allreduce, Alltoall, Alltoallv, Barrier, Bcast, Create_cart, Create_graph, Create, Gather, Gatherv, Group, Rank, Reduce_scatter, Reduce, Scan, Scatter, Scatterv, Size, Split
 
Methods inherited from class mpi.Comm
Abort, Bsend_init, Bsend, Compare, Create_intercomm, Delete_attr, Errorhandler_get, Errorhandler_set, Free, Get_attr, Get_name, Ibsend, Iprobe, Irecv, Irsend, Is_null, Isend, Issend, Pack_size, Pack_size, Pack, Probe, Recv_init, Recv, Rsend_init, Rsend, Send_init, Send, Sendrecv_replace, Sendrecv, Set_attr, Set_name, Ssend_init, Ssend, Test_inter, Unpack
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clone

public java.lang.Object clone()
Description copied from class: Comm
Duplicate this communicator.

returns: copy of this communicator

Java binding of the MPI operation MPI_COMM_DUP.

The new communicator is "congruent" to the old one, but has a different context.

Overrides:
clone in class Intracomm

Dims_create

public static void Dims_create(int nnodes,
                               int[] dims)
                        throws MPIException
Select a balanced distribution of processes per coordinate direction.

nnodes number of nodes in a grid
dims array specifying the number of nodes in each dimension

Java binding of the MPI operation MPI_DIMS_CREATE.

The number of dimensions is taken to be size of the dims argument. The caller may further constrain the operation of this method by specifying elements of array dims. If dims[i] is set to a positive number, this method will not modify the number of nodes in dimension i; only those entries where dims[i] = 0 are modified by the call. Negative input values of dims[i] are erroneous. For dims[i] set by the call, dims[i] will be ordered in non-increasing order. Note that dims is an inout parameter.

Throws:
MPIException

Get

public CartParms Get()
              throws MPIException
Returns Cartesian topology information.

returns: object containing dimensions, periods and local coordinates

Java binding of the MPI operations MPI_CARTDIM_GET and MPI_CART_GET.

The number of dimensions can be obtained from the size of (eg) dims field of the returned object.

Throws:
MPIException

Rank

public int Rank(int[] coords)
         throws MPIException
Translate logical process coordinates to process rank.

coords Cartesian coordinates of a process
returns: rank of the specified process

Java binding of the MPI operation MPI_CART_RANK.

Throws:
MPIException

Coords

public int[] Coords(int rank)
             throws MPIException
Translate process rank to logical process coordinates.

rank rank of a process
returns: Cartesian coordinates of the specified process

Java binding of the MPI operation MPI_CART_COORDS.

Throws:
MPIException

Shift

public ShiftParms Shift(int direction,
                        int disp)
                 throws MPIException
Compute source and destination ranks for "shift" communication.

direction coordinate dimension of shift
disp displacement
returns: object containing ranks of source and destination processes

Java binding of the MPI operation MPI_CART_SHIFT.

The direction argument indicates the dimension of the shift, i.e., the coordinate which value is modified by the shift. Depending on the periodicity of the cartesian group in the specified coordinate direction, Shift provides the identifiers for a circular or an end-off shift. In the case of an end-off shift, the value MPI.PROC_NULL may be returned in the fields rankSource or rankDest of the returned ShiftParms object, indicating that the source or the destination for the shift is out of range.

Throws:
MPIException

Sub

public Cartcomm Sub(boolean[] remainDims)
             throws MPIException
Partition Cartesian communicator into subgroups of lower dimension.

remain_dims by dimension, true if dimension is to be kept, false otherwise
returns: communicator containing subgrid including this process

Java binding of the MPI operation MPI_CART_SUB.

This method can be used to partition the communicator group into subgroups that form lower-dimensional cartesian subgrids, and to build for each subgroup a communicator with the associated subgrid cartesian topology.

Throws:
MPIException

Map

public int Map(int[] dims,
               boolean[] periods)
        throws MPIException
Compute an optimal placement.

dims the number of processes in each dimension
periods true if grid is periodic, false if not, in each dimension
returns: reordered rank of calling process

Java binding of the MPI operation MPI_CART_MAP.

The number of dimensions is taken to be size of the dims argument.

Throws:
MPIException

Topo_test

public int Topo_test()
              throws MPIException
Description copied from class: Comm
Returns the type of topology associated with the communicator.

returns: topology type of communicator

Java binding of the MPI operation MPI_TOPO_TEST.

The return value will be one of MPI.GRAPH, MPI.CART or MPI.UNDEFINED.

Overrides:
Topo_test in class Comm
Throws:
MPIException