Vijay Saraswat <vi...@saraswat.org> wrote on 12/16/2009 08:37:40 PM: > This should be straightforward, at the risk of extra copying. Something > like: > > static def copyTo[T](A:Array[T], p:Place):Array[T]{self.dist == A.region->p} {
Shouldn't it be "{self.dist == A.region->here}"? > val ACopy = ValRail.make(0..A.region.size()-1, > (i:int) => A(A.region.coord(i))); > at (p) > return Array.make[T](A.region -> p, > (p:Point) => ACopy(A.region.ord(p))); Shouldn't this be "return at (p) Array.make[T](...}"? > } > } This is more than a risk -- the code will always copy. Plus, there's an extra communication round trip, which is, in some ways, worse than copying. So, yes, the naive implementation is straightforward. But it's not clear whether the resulting library would be worth using (in terms of performance). Igor > > Hi all, > > > > I have array-structured data that is calculated in one place, which I > > then want to make available to activities running at other places. > > > > The obvious way is to make the array the return value of a remote > > expression. This creates a remote reference to the array, but then > > access to each individual element must also be done by a remote > > expression, which is hardly efficient. Importantly the array data is > > calculated once and then never updated, so what is required is a final > > read-only snapshot of the array. > > > > AFAIK the only array-like class that can be transferred between places > > is ValRail. However this does not support arbitrary Regions as do arrays. > > > > Is there an elegant way of transferring complete Array-like objects > > between places? -- Igor Peshansky (note the spelling change!) IBM T.J. Watson Research Center XJ: No More Pain for XML's Gain (http://www.research.ibm.com/xj/) X10: Parallel Productivity and Performance (http://x10.sf.net/) ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users