size()An inquiry function returning the extent of the range.
dim()An inquiry function returning the underlying process dimension. For a collapsed range this is a collapsed dimension.
tem()An inquiry function returning the parent template range.
bas()An inquiry function returning the alignment base of this range in the parent template range. Element 0 of this range corresponds to element bas() in the template range.
str()An inquiry function returning the alignment stride of this range relative to the parent template range. Adjacent elements of this range correspond to elements separated by str() in the template range. The result may be positive or negative (not zero).
lev()An inquiry function returning the level of this range. Zero for (a range describing) a process dimension or subrange of a process dimension, positive for any other range.
ker()An inquiry function returning the kernel range. In general this is a range of level one lower than this range. Result is undefined for level 0 ranges.
shell()An inquiry function returning the shell range. This is a collapsed range large enough to describe any block of the parent template range. Result is undefined for level 0 ranges.
format()An inquiry function returning a code defining the distribution format of this range. The result is a member of the enumeration type:
enum Format {DIST_PRIMITIVE, DIST_COLLAPSED, DIST_BLOCK, DIST_CYCLIC, DIST_IRREG, ...} ;
subrng(const int extent, const int base, const int stride)Returns a Range object representing a subrange of this range. The size of the subrange is extent and its elements are labelled
base, base + stride, base + 2 * stride, ..., base + (extent - 1) * stride
from the parent. The elements of the subrange
are mapped to the underlying process dimension in the same way as the
corresponding elements of the parent range (they are aligned with
the corresponding elements of the parent). The value of stride
must be positive or negative (not zero). The values of base and
base + (extent - 1) * stride must be in the range size() - 1. If the stride actual argument is omitted,
it defaults to 1. If the base actual argument is also omitted,
it defaults to 0.
If this range (the parent) is itself a subrange, the alignment parameters base and stride for the new subrange are composed with those of the parent, to give a simple map to the common template range.
location(Location* loc, const int glb)Overwrites *loc with a location record corresponding to the element of the range with global subscript glb.
block(Block* blk, const int ker_glb)This function is defined only for ranges with level higher than 0. Given a kernel subscript value, ker_glb, writes the parameters of the associated block in *blk. Used in translation of parallel loops--see section 7 for examples.
The value written to blk->glb_bas is the smallest value of the global subscript contained in the block. The corresponding values of the template subscript and shell subscript overwrite blk->tem_bas and blk->sub_bas respectively. The number of active elements in the block overwrites blk->count.
The difference in the values of global, template and shell subscripts between adjacent active elements in the block overwrite blk->glb_stp, blk->tem_stp and blk->sub_stp respectively.
local(int* glb)This function is defined only for level 0 ranges, and then only if the local process is a member of the process array to which dim() belongs. It returns the value 1 if the local process holds an element of the range and zero otherwise. If the range is primitive--a complete process dimension, the result is always non-zero. For a subrange it may be zero. Used in translation of parallel loops--see section 7 for examples.
If the result is non-zero, the value of the global subscript of the local process with respect to the range overwrites *glb. If the range is primitive, the global subscript is value of the local coordinate. For a subrange of a primitive range it is (crd - bas()) / str() where crd is the local coordinate.
subker()A subrange of the kernel, including all elements of the kernel for which the function block defines a non-empty block. Used to optimize the procedure for enumerating all blocks of a range--see section 7. Result is undefined for level 0 ranges.
volume()A bound on the number of elements associated with any single process for an array allocated with this range. This member is used directly to control the allocation of memory for elements of distributed arrays.
offset(const Location& loc)Returns the total offset for the location loc. For any legal value of loc the inequality
offset(loc) < volume()
holds.
disp(const int sub)Translation from shell subscript, sub, to an offset (displacement) in a local array segment. This function is defined only for ranges with level higher than 0. It is often the identity function (returning the value of its argument), but may, for example add an offset if the range has ghost regions, or implement some more complicated packing function for arrays with strided alignment.
For a level 1 range the identity
offset(i) = disp(i.sub)
holds. Especially for collapsed ranges this formula provides a simple way to compute the offset without introducing a Location record. Note that for any range with level higher than zero we have the identity
disp(sub) = shell().disp(sub)
so for any legal value of sub the inequality
disp(sub) < shell().volume()
holds.
For level 2 ranges, the result of disp does not include the contribution to the total offset arising from the displacement of the block base (parametrized by the blk field int the location record). However a complete identity in the level 2 case is
offset(i) = disp(i.sub) + shell().volume() * ker().disp(i.blk)
step(const int sub_stp)This function returns the difference in the value of disp between two points in the same block of the range separated in shell subscript by sub_stp. This member normally implements the identity function (returning the value of its argument), but it may divide by a scaling factor if the range implements a non-trivial packing scheme for arrays with strided alignment.
idx(const Location& loc)Returns global subscript in this range associated with location loc. Equivalent to
int idx(const Location& loc) const { return (loc.tem - bas()) / str() ; }