|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
x10.lang.Object x10.array.Dist
abstract public class Dist
Declaration: Dist extends x10.lang.Object implements (a1:x10.array.Point{self.rank==this(:x10.array.Dist).region.rank})=>x10.lang.Place, x10.lang.Iterable[x10.array.Point{self.rank==this(:x10.array.Dist).region.rank}].
A distributution supports distributed arrays by providing a mapping from Points to Places. Equivalently, a distribution may be defined as a mapping from Places to Regions. The Dist class provides a set of factory methods for constructing various distributions. There are a set of methods supporting algebraic operations on distributions, such as union, intersection, difference, and so on.
Field Summary | |
---|---|
Region |
region
Property. |
Constructor Summary | |
---|---|
protected |
Dist(Region region)
Declaration: this(x10.array.Region): x10.array.Dist{self.region==region}. Construct a distribution over the specified region. |
Method Summary | |
---|---|
Int |
rank()
The rank of this distribution. |
static Dist |
makeUnique()
Declaration: makeUnique(): x10.array.Dist{self.region.rank==1}. Create a distribution over a rank-1 region that maps every point in the region to a distinct place, and which maps some point in the region to every place. |
static Dist |
makeConstant(Region r)
Declaration: makeConstant(r:x10.array.Region): x10.array.Dist{self.region==r}. Create a distribution over the specified region that maps every point in the region to here. |
static Dist |
make(Region r)
Declaration: make(r:x10.array.Region): x10.array.Dist{self.region==r}. Create a distribution over the specified region that maps every point in the region to here. |
static Dist |
makeCyclic(Region r,
Int axis)
Declaration: makeCyclic(r:x10.array.Region,axis:x10.lang.Int): x10.array.Dist{self.region==r}. Create a distribution over the specified region that varies in place only along the specified axis, and maps the ith coordinate along that axis to place i%Place.NUM_PLACES. |
static Dist |
makeBlock(Region r,
Int axis)
Declaration: makeBlock(r:x10.array.Region,axis:x10.lang.Int): x10.array.Dist{self.region==r}. Create a distribution over the specified region that varies in place only along the zeroth axis, and maps the ith coordinate along that axis to place i%Place.NUM_PLACES. |
static Dist |
makeBlockBlock(Region r,
Int axis0,
Int axis1)
Declaration: makeBlockBlock(r:x10.array.Region,axis0:x10.lang.Int,axis1:x10.lang.Int): x10.array.Dist{self.region==r}. Creates a block, block distribution across all places. |
static Dist |
makeBlock(Region r)
Declaration: makeBlock(r:x10.array.Region): x10.array.Dist{self.region==r, x10.array.PlaceGroup.WORLD!=null}. Create a distribution over the specified region that varies in place only along the 0-th axis. |
static Dist |
makeBlockCyclic(Region r,
Int axis,
Int blockSize)
Declaration: makeBlockCyclic(r:x10.array.Region,axis:x10.lang.Int,blockSize:x10.lang.Int): x10.array.Dist{self.region==r}. Create a distribution over the specified region that varies in place only along the specified axis. |
static Dist |
makeUnique(PlaceGroup pg)
Declaration: makeUnique(pg:x10.array.PlaceGroup): x10.array.Dist{self.region.rank==1}. Create a distribution over a rank-1 region that maps every point in the region to a place in pg, and which maps some point in the region to every place in ps. |
static Dist |
makeConstant(Region r,
Place p)
Declaration: makeConstant(r:x10.array.Region,p:x10.lang.Place): x10.array.Dist{self.region==r}. Create a distribution over the specified region that maps every point in the region to the specified place. |
static Dist |
makeCyclic(Region r,
Int axis,
PlaceGroup pg)
Declaration: makeCyclic(r:x10.array.Region,axis:x10.lang.Int,pg:x10.array.PlaceGroup): x10.array.Dist{self.region==r}. Create a distribution over the specified region that varies in place only along the specified axis, and maps the ith coordinate along that axis to place ps(i%ps.length). |
static Dist |
makeBlock(Region r,
Int axis,
PlaceGroup pg)
Declaration: makeBlock(r:x10.array.Region,axis:x10.lang.Int,pg:x10.array.PlaceGroup): x10.array.Dist{self.region==r}. Create a distribution over the specified region that varies in place only along the specified axis. |
static void |
makeBlockCyclic(Region r,
Int axis,
Int blockSize,
PlaceGroup pg)
Create a distribution over the specified region that varies in place only along the specified axis. |
abstract PlaceGroup |
places()
The PlaceGroup over which the distribuiton is defined |
abstract Int |
numPlaces()
How many places are included in the distribution? |
abstract Iterable<Region> |
regions()
Declaration: regions(): x10.lang.Iterable[x10.array.Region{self.rank==this(:x10.array.Dist).region.rank}]. |
abstract Region |
get(Place p)
Declaration: get(p:x10.lang.Place): x10.array.Region{self.rank==this(:x10.array.Dist).region.rank}. Return the region consisting of points which this distribution maps to the specified place. |
Region |
operator()(Place p)
Declaration: operator()(p:x10.lang.Place): x10.array.Region{self.rank==this(:x10.array.Dist).region.rank}. Return the region consisting of points which this distribution maps to the specified place. |
abstract Place |
operator()(Point pt)
Declaration: operator()(pt:x10.array.Point{self.rank==this(:x10.array.Dist).region.rank}): x10.lang.Place. Return the place which this distribution maps the specified point to. |
Place |
operator()(Int i0)
Declaration: operator()(i0:x10.lang.Int){this(:x10.array.Dist).region.rank==1}: x10.lang.Place. Return the place which this distribution maps the specified index to. |
Place |
operator()(Int i0,
Int i1)
Declaration: operator()(i0:x10.lang.Int,i1:x10.lang.Int){this(:x10.array.Dist).region.rank==2}: x10.lang.Place. Return the place which this distribution maps the specified pair of indices to. |
Place |
operator()(Int i0,
Int i1,
Int i2)
Declaration: operator()(i0:x10.lang.Int,i1:x10.lang.Int,i2:x10.lang.Int){this(:x10.array.Dist).region.rank==3}: x10.lang.Place. Return the place which this distribution maps the specified triple of indices to. |
Place |
operator()(Int i0,
Int i1,
Int i2,
Int i3)
Declaration: operator()(i0:x10.lang.Int,i1:x10.lang.Int,i2:x10.lang.Int,i3:x10.lang.Int){this(:x10.array.Dist).region.rank==4}: x10.lang.Place. Return the place which this distribution maps the specified quartet of indices to. |
abstract Int |
offset(Point pt)
Declaration: offset(pt:x10.array.Point{self.rank==this(:x10.array.Dist).region.rank}): x10.lang.Int. Return the offset in linearized place-local storage of the given point. |
Int |
offset(Int i0)
Declaration: offset(i0:x10.lang.Int){this(:x10.array.Dist).region.rank==1}: x10.lang.Int. Return the offset in linearized place-local storage of the point [i0] Throw a BadPlaceException if the given point is not mapped to the current place. |
Int |
offset(Int i0,
Int i1)
Declaration: offset(i0:x10.lang.Int,i1:x10.lang.Int){this(:x10.array.Dist).region.rank==2}: x10.lang.Int. Return the offset in linearized place-local storage of the point [i0,i1]. |
Int |
offset(Int i0,
Int i1,
Int i2)
Declaration: offset(i0:x10.lang.Int,i1:x10.lang.Int,i2:x10.lang.Int){this(:x10.array.Dist).region.rank==3}: x10.lang.Int. Return the offset in linearized place-local storage of the point [i0,i1,i2]. |
Int |
offset(Int i0,
Int i1,
Int i2,
Int i3)
Declaration: offset(i0:x10.lang.Int,i1:x10.lang.Int,i2:x10.lang.Int,i3:x10.lang.Int){this(:x10.array.Dist).region.rank==4}: x10.lang.Int. Return the offset in linearized place-local storage of the point [i0,i1,i2,i3]. |
abstract Int |
maxOffset()
|
Iterator<Point> |
iterator()
Declaration: iterator(): x10.lang.Iterator[x10.array.Point{self.rank==this(:x10.array.Dist).region.rank}]. Return an iterator for the underlying region of this distribution. |
abstract Dist |
restriction(Region r)
Declaration: restriction(r:x10.array.Region{self.rank==this(:x10.array.Dist).region.rank}): x10.array.Dist{self.region.rank==this(:x10.array.Dist).region.rank}. Return the distribution defined over r, which must be contained in this.region, and which maps every point in its region to the same place as this distribution. |
Boolean |
isSubdistribution(Dist that)
Declaration: isSubdistribution(that:x10.array.Dist{self.region.rank==this(:x10.array.Dist).region.rank}): x10.lang.Boolean. Return true iff that.region is contained in this.region, and that distribution maps every point to the same place as this distribution. |
Boolean |
equals(Any thatObj)
Return true iff that is a distribution and both distributions are defined over equal regions and place groups, and map every point in said region to the same place. |
abstract Dist |
restriction(Place p)
Declaration: restriction(p:x10.lang.Place): x10.array.Dist{self.region.rank==this(:x10.array.Dist).region.rank}. Return the distribution restricted to those points which it maps to the specified place. |
Boolean |
contains(Point p)
Return true iff this.region contains p. |
Dist |
operator|(Region r)
Declaration: operator|(r:x10.array.Region{self.rank==this(:x10.array.Dist).region.rank}): x10.array.Dist{self.region.rank==this(:x10.array.Dist).region.rank}. Restrict this distribution to the specified region. |
Dist |
operator|(Place p)
Declaration: operator|(p:x10.lang.Place): x10.array.Dist{self.region.rank==this(:x10.array.Dist).region.rank}. Restrict this distribution to the specified place. |
String |
toString()
Subtract the specified region from this distribution. |
protected static void |
raiseBoundsError(Int i0)
|
protected static void |
raiseBoundsError(Int i0,
Int i1)
|
protected static void |
raiseBoundsError(Int i0,
Int i1,
Int i2)
|
protected static void |
raiseBoundsError(Int i0,
Int i1,
Int i2,
Int i3)
|
protected static void |
raiseBoundsError(Point pt)
|
protected static void |
raisePlaceError(Int i0)
|
protected static void |
raisePlaceError(Int i0,
Int i1)
|
protected static void |
raisePlaceError(Int i0,
Int i1,
Int i2)
|
protected static void |
raisePlaceError(Int i0,
Int i1,
Int i2,
Int i3)
|
protected static void |
raisePlaceError(Point pt)
|
Dist |
x10$array$Dist$$x10$array$Dist$this()
Declaration: x10$array$Dist$$x10$array$Dist$this(): x10.array.Dist{self==this(:x10.array.Dist)}. A distributution supports distributed arrays by providing a mapping from Points to Places. |
Methods inherited from class x10.lang.Object |
---|
equals, hashCode, toString, typeName, x10$lang$Object$$x10$lang$Object$this |
Methods inherited from interface x10.lang. Fun_0_1 |
---|
operator() |
Methods inherited from interface x10.lang.Iterable |
---|
iterator |
Methods inherited from interface x10.lang.Any |
---|
toString, typeName, equals, hashCode |
Field Detail |
---|
public final Region region
Constructor Detail |
---|
protected Dist(Region region)
Construct a distribution over the specified region.
Method Detail |
---|
public final Int rank()
public static Dist makeUnique()
Create a distribution over a rank-1 region that maps every point in the region to a distinct place, and which maps some point in the region to every place.
public static Dist makeConstant(Region r)
Create a distribution over the specified region that maps every point in the region to here.
r
- the given region
public static Dist make(Region r)
Create a distribution over the specified region that maps every point in the region to here.
r
- the given region
makeConstant(Region)
public static Dist makeCyclic(Region r, Int axis)
Create a distribution over the specified region that varies in place only along the specified axis, and maps the ith coordinate along that axis to place i%Place.NUM_PLACES.
r
- the given regionaxis
- the dimension to cycle over
public static Dist makeBlock(Region r, Int axis)
Create a distribution over the specified region that varies in place only along the zeroth axis, and maps the ith coordinate along that axis to place i%Place.NUM_PLACES.
r
- the given regionr
- the given regionaxis
- the dimension to block over
public static Dist makeBlockBlock(Region r, Int axis0, Int axis1)
Creates a block, block distribution across all places. The coordinates are split along axis0 into M divisions such that M is the minimum of: - 2^q where q is the next integer above log2(P) / 2 - the length of axis0 and split along axis1 into N divisions such that M (N-1) <= P <= M N. Thus there are M N blocks of size (axis0/M, axis1/N). The blocks are not necessarily of integer size in either dimension. Places 0..(M N-P) are each assigned two such blocks, contiguous in axis0. The remaining places are assigned a single block. Block min and max coordinates are rounded to create subregions for each place, e.g. a block [1.0..1.5,2.25..2.75] is rounded to a subregion [1..2,2..2].
r
- the given regionaxis0
- the first dimension to block overaxis1
- the second dimension to block over
public static Dist makeBlock(Region r)
Create a distribution over the specified region that varies in place only along the 0-th axis. It divides the coordinates along the 0-th axis into Place.MAX_PLACES blocks, and assigns successive blocks to successive places. If the number of coordinates in the axis does not divide evenly into the number of blocks, then the first (max(axis)-min(axis)+1)%Place.MAX_PLACES blocks will be assigned one more coordinate than the remaining blocks.
r
- the given region
public static Dist makeBlockCyclic(Region r, Int axis, Int blockSize)
Create a distribution over the specified region that varies in place only along the specified axis. It divides the coordinates along that axis into blocks of the specified size, and assigns block i to place i%Place.MAX_PLACES.
r
- the given regionaxis
- the dimension to block overblockSize
- the size of the block
public static Dist makeUnique(PlaceGroup pg)
Create a distribution over a rank-1 region that maps every point in the region to a place in pg, and which maps some point in the region to every place in ps.
pg
- the set of places
public static Dist makeConstant(Region r, Place p)
Create a distribution over the specified region that maps every point in the region to the specified place.
r
- the given regionp
- the given place
public static Dist makeCyclic(Region r, Int axis, PlaceGroup pg)
Create a distribution over the specified region that varies in place only along the specified axis, and maps the ith coordinate along that axis to place ps(i%ps.length).
r
- the given regionaxis
- the dimension to cycle overpg
- the PlaceGroup over which to distribute the region
public static Dist makeBlock(Region r, Int axis, PlaceGroup pg)
Create a distribution over the specified region that varies in place only along the specified axis. It divides the coordinates along that axis into pg.numPlaces() blocks, and assigns successive blocks to successive places in pg. If the number of coordinates in the axis does not divide evenly into the number of places in pg, then the first (max(axis)-min(axis)+1)%pg.numPlaces() blocks will be assigned one more coordinate than the remaining blocks.
r
- the given regionaxis
- the dimension to block overpg
- the PlaceGroup over which to distribute the region
public static void makeBlockCyclic(Region r, Int axis, Int blockSize, PlaceGroup pg)
r
- the given regionaxis
- the dimension to block overblockSize
- the size of the blockpg
- the PlaceGroup over which to distribute the regionpublic abstract PlaceGroup places()
public abstract Int numPlaces()
public abstract Iterable<Region> regions()
public abstract Region get(Place p)
Return the region consisting of points which this distribution maps to the specified place.
p
- the given place
public Region operator()(Place p)
Return the region consisting of points which this distribution maps to the specified place. This is a shorthave for get(p).
p
- the given place
public abstract Place operator()(Point pt)
Return the place which this distribution maps the specified point to.
pt
- the given point
public Place operator()(Int i0)
Return the place which this distribution maps the specified index to. Only applies to one-dimensional distributions. Functionally equivalent to indexing the distribution via a one-dimensional point.
i0
- the given index in the first dimension
operator(Point)
public Place operator()(Int i0, Int i1)
Return the place which this distribution maps the specified pair of indices to. Only applies to two-dimensional distributions. Functionally equivalent to indexing the distribution via a two-dimensional point.
i0
- the given index in the first dimensioni1
- the given index in the second dimension
operator(Point)
public Place operator()(Int i0, Int i1, Int i2)
Return the place which this distribution maps the specified triple of indices to. Only applies to three-dimensional distributions. Functionally equivalent to indexing the distribution via a three-dimensional point.
i0
- the given index in the first dimensioni1
- the given index in the second dimensioni2
- the given index in the third dimension
operator(Point)
public Place operator()(Int i0, Int i1, Int i2, Int i3)
Return the place which this distribution maps the specified quartet of indices to. Only applies to four-dimensional distributions. Functionally equivalent to indexing the distribution via a four-dimensional point.
i0
- the given index in the first dimensioni1
- the given index in the second dimensioni2
- the given index in the third dimensioni3
- the given index in the fourth dimension
operator(Point)
public abstract Int offset(Point pt)
Return the offset in linearized place-local storage of the given point. Throw a BadPlaceException if the given point is not mapped to the current place. Primarily intended to be used by the DistArray implementation, but may be useful for other data structures as well that need to associate Points in a Distribution with a dense, zero-based numbering.
pt
- the given point
public Int offset(Int i0)
Return the offset in linearized place-local storage of the point [i0] Throw a BadPlaceException if the given point is not mapped to the current place. Primarily intended to be used by the DistArray implementation, but may be useful for other data structures as well that need to associate Points in a Distribution with a dense, zero-based numbering. Only applies to one-dimensional distributions.
i0
- the given index in the first dimension
offset(Point)
public Int offset(Int i0, Int i1)
Return the offset in linearized place-local storage of the point [i0,i1]. Throw a BadPlaceException if the given point is not mapped to the current place. Primarily intended to be used by the DistArray implementation, but may be useful for other data structures as well that need to associate Points in a Distribution with a dense, zero-based numbering. Only applies to two-dimensional distributions.
i0
- the given index in the first dimensioni1
- the given index in the second dimension
offset(Point)
public Int offset(Int i0, Int i1, Int i2)
Return the offset in linearized place-local storage of the point [i0,i1,i2]. Throw a BadPlaceException if the given point is not mapped to the current place. Primarily intended to be used by the DistArray implementation, but may be useful for other data structures as well that need to associate Points in a Distribution with a dense, zero-based numbering. Only applies to three-dimensional distributions.
i0
- the given index in the first dimensioni1
- the given index in the second dimensioni2
- the given index in the third dimension
offset(Point)
public Int offset(Int i0, Int i1, Int i2, Int i3)
Return the offset in linearized place-local storage of the point [i0,i1,i2,i3]. Throw a BadPlaceException if the given point is not mapped to the current place. Primarily intended to be used by the DistArray implementation, but may be useful for other data structures as well that need to associate Points in a Distribution with a dense, zero-based numbering. Only applies to four-dimensional distributions.
i0
- the given index in the first dimensioni1
- the given index in the second dimensioni2
- the given index in the third dimensioni3
- the given index in the fourth dimension
offset(Point)
public abstract Int maxOffset()
offset(Point)
public Iterator<Point> iterator()
Return an iterator for the underlying region of this distribution. Supports the syntax (for p:Point in d) ... p ...
x10.lang.Iterable[T]#iterator()
public abstract Dist restriction(Region r)
Return the distribution defined over r, which must be contained in this.region, and which maps every point in its region to the same place as this distribution. Functionally equivalent to
intersection(Region)
.
r
- the given region
public Boolean isSubdistribution(Dist that)
Return true iff that.region is contained in this.region, and that distribution maps every point to the same place as this distribution.
that
- the given distribution
public Boolean equals(Any thatObj)
that
- the given distribution
public abstract Dist restriction(Place p)
Return the distribution restricted to those points which it maps to the specified place.
p
- the given place
public Boolean contains(Point p)
p
- the given point
public Dist operator|(Region r)
Restrict this distribution to the specified region.
r
- the given region
public Dist operator|(Place p)
Restrict this distribution to the specified place.
p
- the given place
public String toString()
r
- the given region
protected static void raiseBoundsError(Int i0)
protected static void raiseBoundsError(Int i0, Int i1)
protected static void raiseBoundsError(Int i0, Int i1, Int i2)
protected static void raiseBoundsError(Int i0, Int i1, Int i2, Int i3)
protected static void raiseBoundsError(Point pt)
protected static void raisePlaceError(Int i0)
protected static void raisePlaceError(Int i0, Int i1)
protected static void raisePlaceError(Int i0, Int i1, Int i2)
protected static void raisePlaceError(Int i0, Int i1, Int i2, Int i3)
protected static void raisePlaceError(Point pt)
public final Dist x10$array$Dist$$x10$array$Dist$this()
A distributution supports distributed arrays by providing a mapping from Points to Places. Equivalently, a distribution may be defined as a mapping from Places to Regions. The Dist class provides a set of factory methods for constructing various distributions. There are a set of methods supporting algebraic operations on distributions, such as union, intersection, difference, and so on.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |