Need help in understanding Dist and DistArray

89 views Asked by At

I don't understand the following piece of code.

val array = new Array[INT](1..1000, ([i]:Point) => 0);
val dist = Dist.makeBlock(array.region);
val distArray = DistArray.make(dist, ([i]:Point) => array(i));

This is all. The expressions in () are very confusing, but also the =>, Dist and DistArray.

1

There are 1 answers

0
Josh Milthorpe On

Array initializers like ([i]:Point) => 0 are function literals (also called closures), and are described in section 10.3 of the X10 language specification. Dist and DistArray support a flexible mapping of multidimensional regions to distributed data; these classes are described in Chapter 16 of the spec.