next up previous contents
Next: MPI Environmental Management Up: Process Topologies Previous: Overview of the Functions   Contents

Topology Constructors

Cartcomm Intracomm.Create_cart(int [] dims, boolean [] periods,
                               boolean reorder)
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



Create a Cartesian topology communicator whose group is a subset of the group of this 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.

static Cartcomm.Dims_create(int nnodes, int [] dims)
nnodes number of nodes in a grid
dims array specifying the number of nodes in each dimension



Select a balanced distribution of processes per coordinate direction. Java binding of the MPI operation MPI_DIMS_CREATE. Number of dimensions is the size of is dims. Note that dims is an inout parameter.

Graphcomm Intracomm.Create_graph(int [] index, int [] edges,
                                 boolean reorder)
index node degrees
edges graph edges
reorder true if ranking may be reordered, false if not
   
returns: new graph topology communicator



Create a graph topology communicator whose group is a subset of the group of this 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 $\mbox{\tt index}[\mbox{\em nnodes} - 1]$.

int Comm.Topo_test()
returns: topology type of communicator



Returns the type of topology associated with the communicator. Java binding of the MPI operation MPI_TOPO_TEST. The return value will be one of MPI.GRAPH, MPI.CART or MPI.UNDEFINED.

GraphParms Graphcomm.Get()
returns: object defining node degress and edges of graph



Returns graph topology information. Java binding of the MPI operations MPI_GRAPHDIMS_GET and MPI_GRAPH_GET. The class of the returned object is
  public class GraphParms {
    public int [] index ;
    public int [] edges ; 
  }
The number of nodes and number of edges can be extracted from the sizes of the index and edges arrays.

CartParms Cartcomm.Get()
returns: object containing dimensions, periods and local coordinates



Returns Cartesian topology information. Java binding of the MPI operations MPI_CARTDIM_GET and MPI_CART_GET. The class of the returned object is
  public class CartParms {
    public int [] dims ;
    public booleans [] periods ;
    public int [] coords ; 
  }
The number of dimensions can be obtained from the size of (eg) the dims array.

int Cartcomm.Rank(int [] coords)
coords Cartesian coordinates of a process
   
returns: rank of the specified process



Translate logical process coordinates to process rank. Java binding of the MPI operation MPI_CART_RANK.

int [] Cartcomm.Coords(int rank)
coords rank of a process
   
returns: Cartesian coordinates of the specified process



Translate process rank to logical process coordinates. Java binding of the MPI operation MPI_CART_COORDS.

int [] Graphcomm.Neighbours(int rank)
coords rank of a process in the group of this communicator
   
returns: array of ranks of neighbouring processes to one specified



Provides adjacency information for general graph topology. Java binding of the MPI operations MPI_GRAPH_NEIGHBOURS_COUNT and MPI_GRAPH_NEIGHBOURS. The number of neighbours can be extracted from the size of the result.

ShiftParms Cartcomm.Shift(int direction, int disp)
direction coordinate dimension of shift
disp displacement
   
returns: object containing ranks of source and destination processes



Compute source and destination ranks for ``shift'' communication. Java binding of the MPI operation MPI_CART_SHIFT. The class of the returned object is
  public class ShiftParms {
    public int rankSource ;
    public int rankDest ; 
  }

Cartcomm Cartcomm.Sub(boolean [] remainDims)
remainDims by dimension, true if dimension is to be kept, false otherwise
   
returns: communicator containing subgrid including this process



Partition Cartesian communicator into subgroups of lower dimension. Java binding of the MPI operation MPI_CART_SUB.

int Cartcomm.Map(int [] dims, boolean [] periods)
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



Compute an optimal placement. Java binding of the MPI operation MPI_CART_MAP. The number of dimensions is taken to be size of the dims argument.

int Graphcomm.Map(int [] index, int [] edges)
index node degrees
edges graph edges
   
returns: reordered rank of calling process



Compute an optimal placement. Java binding of the MPI operation MPI_GRAPH_MAP. The number of nodes is taken to be size of the index argument.


next up previous contents
Next: MPI Environmental Management Up: Process Topologies Previous: Overview of the Functions   Contents
Bryan Carpenter 2002-07-12