Hi,

I use here.id to access place local data in unique distributed arrays. The code 
may look like

val myDistArray = DistArray[Int].make(Dist.makeUnique(), 0);
for (place in PlaceGroup.WORLD) at(place) async {
    val myData = myDistArray(here.id);
}


When I don't use PlaceGroup.WORLD, the code looks like:

val pg : Placegroup = new SparsePlaceGroup(...) // contains only a few random 
places (not 0..pg.size()-1) 
val myDistArray = DistArray[Int].make(Dist.makeUnique(pg), 0);
for (place in pg) at(place) async {
    val index = pg.indexOf(here.id);    // this is the critical line
    val myData = myDistArray(index);
}

This method only works as long as the implementation of UniqueDist does not 
change. I wonder if there is a faster and recommended way to determine the 
index of the data belonging to 'here'. 
Perhaps

val index = myDistArray.dist.get(here).minPoint(); ? 

Doesn't look so nice neither

Dominic



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to