In short, the syntax is specified, but it is not currently implemented. Unfortunately, the language specification does not currently indicate that this is a future feature.
, . , , , GitHub Chapel, .
:
.
-, . , :
on Locales[1] var A: [0..10] real;
A = 1;
writeln(A);
for x in A {
write(x.locale.id, " ");
}
writeln();
on
:
on Locales[1] {
var A: [0..10] real;
on Locales[0] {
A = 1;
writeln(A);
for x in A {
write(x.locale.id, " ");
}
writeln();
}
}
, , Locale 0. , Locale , on
(, var fromLocale = here;
) on
.
on
, , , . . , - Owned/Shared, , delete
.
, , delete
.
class MyArrayWrapper {
var A: [0..10] real;
}
var myObject: MyArrayWrapper;
on Locales[1] {
myObject = new MyArrayWrapper();
}
myObject.A = 1;
writeln(myObject.A);
for x in myObject.A {
write(x.locale.id, " ");
}
writeln();
delete myObject;
, , ?
, 11 Locales the Chapel .
use BlockDist;
const MyDom = {0..10};
const MyBlockDistributedDomain = MyDom dmapped Block(boundingBox=MyDom);
var BlockDistributedA: [MyBlockDistributedDomain] real;
BlockDistributedA = 1;
writeln(BlockDistributedA);
for x in BlockDistributedA {
write(x.locale.id, " ");
}
writeln();
, . , :
use BlockDist;
const MyDom = {0..10};
const MyDistributedDomain = MyDom dmapped Block(boundingBox=MyDom,
targetLocales=[Locales[1]]);
var DistributedA: [MyDistributedDomain] real;
DistributedA = 1;
writeln(DistributedA);
for x in DistributedA {
write(x.locale.id, " ");
}
writeln();