next up previous
Next: Subgroup and Subrange Up: Basic concepts Previous: Process group

Distributed dimension and index with position

For an ordinary array, its elements can be represented by an integer sequence. By doing so, we have two concepts reflected by int value here, an index to access each array element and a range where the index can be chosen from. When describing a distributed array, we use two new build-in classes in HPJava to represent the above concepts, a) A range maps an integer interval into a process dimension according to certain distribution format. Ranges describe the extent and mapping of array dimensions. b) A location, or slot, is an abstract element of a range. A range can be regarded as a set of locations, actually it is a one-to-one mapping between the global index and locations. For example,

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

will create two ranges on the different process dimensions of group p, one is block distributed, the other is cyclic distributed.

We can get 100 different items as Location references mapped by the range x from integers, for example, the first one isgif,

  Location i = x[0];



Guansong Zhang
Mon Feb 23 15:47:12 EST 1998