PrivateDist
Usage
use PrivateDist;
or
import PrivateDist;
Warning
PrivateDist is unstable and may change in the future
- record privateDist : writeSerializable
This
privateDistdistribution maps each indexibetween0andnumLocales-1toLocales[i].The index set of a domain distributed over
privateDistis always0..numLocales-1, regardless of the domain’s rank, and cannot be changed.This module declares a module-level constant of type
privateDistnamedPrivateSpacefor use as a convenience (so that user programs do not need to declare their own).const PrivateSpace: domain(1) dmapped new privateDist();
Example
The following code declares a Private-distributed array
A. The forall loop visits each locale and sets the array element corresponding to that locale to that locale’s ID.use PrivateDist; var A: [PrivateSpace] int; forall a in A do a = a.locale.id; writeln(A);
When run on 6 locales, the output is:
0 1 2 3 4 5
Data-Parallel Iteration
A forall loop over a
privateDistdomain or array runs a single task on each locale. That task executes the loop’s iteration corresponding to that locale’s index in theLocalesarray.Limitations
Domains and arrays distributed over this distribution do not provide some standard domain/array functionality.
This distribution may perform unnecessary communication between locales.