The HPJava Project


HPJava Home Page
HPspmd lectures
mpiJava
HPJava language

PCRC Home Page

NPAC Home Page



Java Grande Home

Ranges

A range is a map from the integer interval 0,...,N-1 into some process dimension (ie, some dimension of a process grid). Ranges are used to parametrize distributed arrays and the overall distributed loop.

In HPJava ranges are represented by objects of class Range. The most common way to create one is to use the constructor for one of the subclasses representing a ranges with specific distribution formats. A class hierarchy of ranges is given below:

The simple block distribution format implemented by BlockRange was used directly in the matrix multiplication example. The standard constructor for BlockRange has interface

  public BlockRange(int N, DimRange d)
In passing we also mentioned CollapsedRange. Members of this class describe sequential, undistributed dimensions of HPJava arrays. Constructors for CollapsedRange are not usually called explicitly, but in fact the standard constructor has interface
  public CollapsedRange(int N)

CyclicRange is a distribution format from High Performance Fortran. The interval is mapped to the process dimension in wraparound mode, as in this example involving three processes:

The standard constructor for CyclicRange has interface

  public CyclicRange(int N, DimRange d)

BlockCyclicRange is another distribution format from HPF. The interval is divided into blocks of some specified size which are then mapped to the process dimension in wraparound fashion. For example, with block size 2:

The standard constructor for CyclicRange has interface

  public BlockCyclicRange(int N, DimRange d,
                          int blockSize)

A DimRange represents the range of coordinates of a process dimension, as in:

Instances of the DimRange class are usually obtained from a Procs object through the inquiry dim:

  public class Procs extends Group {
    ...
    public DimRange dim(int r) {...}
  }
rather than through a constructor.

Some of the range classes have extra constructors providing special options. For example there is a BlockRange constructor that takes extra arguments defining widths of ``ghost extensions'' for arrays created using the range.

Next: Distributed arrays


Bryan Carpenter, (dbc@npac.syr.edu). Last updated January 2000.