next up previous contents index
Next: Global variables Up: Java language Binding Previous: Java language Binding

Basic concepts

Key concepts in the programming model are built around the group group, process groups process groups used to describe program execution control in a parallel program. Group is a class representing a process group, typically with a grid structure and an associated set of process dimensions. It has its subclasses that represent different grid dimensionalities, such as Procs1, Procs2, etc. For example,

  Procs2 p = new Procs2(2,4);

p is a 2-dimensional, 2 by 4 grid of processes.

The second category of concepts is associated with range range, distributed ranges distributed ranges. The elements of an ordinary array can be represented by an array name and an integer sequence. There are two parameters associated with this sequence: an index to access each array element and the extent of the range this index can be chosen from. In describing a distributed array, HPJava introduces two new kinds of entity to represent the analogous concepts. A range maps an integer interval into a process dimension according to certain distribution format. Ranges describe the extent and the mapping of array dimensions. A location, or slot, is an abstract element of a range. For example,

  Range x = new BlockRange(100, p.dim(0)) ;
  Range y = new CyclicRange(200, p.dim(1)) ;

creates two ranges distributed over the two process dimensions of the group p. One is block distributed, the other is cyclic distributed. There are 100 different locations in the range x. The first one, for example, is

  x [0]

Additional related concepts are group, subgroups subgroups and range, subranges subranges. A subgroup is some slice of a process array, formed by restricting the process coordinates in one or more dimensions to single values. Suppose i is a location in a range distributed over a dimension of group p. The expression

  p / i

represents a smaller group--the slice of p to which location i is mapped. Similarly, a subrange is a section of a range, parameterized by a global index triplet. Logically, it represents a subset of the locations of the original range. The syntax for a subrange expression is

  x [1 : 49]

The symbol ``:'' is a special separator. It is used to construct a Fortran-90 style triplet, with lower- and upper-bound expressions defining an integer subset. The optional third member of a triplet is a stride.

When a process grid is defined, certain ranges and locations are also implicitly defined. As shown in figure gif, two primitive ranges are associated with dimensions of the group p:

  Range u = p.dim(0);  
  Range v = p.dim(1);

dim() is a member function that returns a range reference, directly representing a processor dimension. We can obtain a location in range v, and use it to create a new group,

  Group q = p / v [1] ;

  
Figure: Structured process group

In a traditional SPMD program, execution control is based on if statements and process id or rank numbers. In the new programming language, switching execution control is based on the structured process group. For example, it is not difficult to guess that the following code:

  on(p) {
    ...
  }

will restrict the execution control inside the bracket to processes in group p. The language also provided well-defined constructs to split execution control across processes according to data items we want to access. This will be discussed later.


next up previous contents index
Next: Global variables Up: Java language Binding Previous: Java language Binding

Guansong Zhang
Mon Feb 8 16:41:16 EST 1999