Remote Arrays

19 views
Skip to first unread message

Mohan

unread,
Dec 12, 2010, 4:50:44 PM12/12/10
to coms49...@googlegroups.com
Has anyone been able to use remote arrays? I am trying to run the code below and was not able to get the desired results.

val arr = new Array[Int](1);
arr(0) = 0;
val remArr = new RemoteArray(arr);
Console.OUT.println(remArr(0));
val glob = GlobalRef(remArr);
val home = here;
for(p in Place.places()) {
if(p != home)  {
at (p) {
arr(0) = 1;
Console.OUT.println(arr(0));
finish Array.asyncCopy(arr, at(glob.home()) glob.apply());
}
break;
}

}
Console.OUT.println(remArr(0));

I was hoping the last println would print 1.
--
Mohan

Vijay Saraswat

unread,
Dec 13, 2010, 6:00:43 AM12/13/10
to coms49...@googlegroups.com
Mohan, you dont need to create glob etc.

Here is code that works -- see attachments.
R.x10
logR.txt
Reply all
Reply to author
Forward
0 new messages