Yes this should be straightforward to do -- provided you are willing to write a wrapper clause.
In fact this would be a good exercise to work through. You may want to think carefully about the methods on the class. e.g. it might be best to view the new class as having some synchronous methods (called simultaneously on multiple threads, one at each place) for the communication of ghost regions. Once this is done, the remote state will be local and can now be operated upon by purely local code. Asynchronous boundary exchangers are also possible. However, not sure why you would like the new class to subclass Array or Distr On 1/20/2012 6:35 AM, TAJCHMAN Marc wrote: > Hi, > > I have the following problem > > Let's consider a distributed array : a(0) .. a(n) (1D version for > simplicity): > > a(1) .. a(10) on place 0 > a(11) .. a(20) on place 1 > a(21) .. a(30) on place 2 > .. > > I want to apply a stencil (e.g. from the heat equation : b_(i) = f(a_(i+1), > a(i), a_(i-1))). > where b has the same distribution as a > > Is it possible to define a class (that inherits from array) so that > __________________________________________________________ > - at each place p, the local part of the array a(1 + 10*p) ... a(10*(p+1)) is > surrounded > by a layer of "ghost components" that are copies of a(10*p) and a(10*(p+1) > + 1) > > __________________________________________________________ > - at a place p: > > if you write : > > a(1+10*p) = a(10*p), > > you read the local copy (ghost value) of the distant component a(10*p) > > if you write : > > a(1+10*p) = at (p-1) a(10*p), > > you have a remote access to the real component > > __________________________________________________________ > - the class has a method (e.g. ghosts_synchronize) that efficiently > duplicates selected distant values in ghost values > > Maybe this kind of arrays have already been implemented somewhere ? > > __________________________________________________________ > Thanks in advance, > Marc > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > X10-users mailing list > X10-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/x10-users > ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users