On Wed, 2010-11-03 at 17:26 -0400, David P Grove wrote: [ . . . ] > We split Array into two classes: Array (an array that is local to a > single place) and DistArray (an array that is potentially distributed > across places).
Seems reasonable to me, since the two have different optimization capabilities. > The map methods on Array are fairly general. > > public def map[U](dst:Array[U](region), > op:(T)=>U):Array[U](region){self==dst} > public def map[S,U](dst:Array[S](region), src:Array[U](region), > op:(T,U)=>S):Array[S](region) > > They require the Arrays to be defined over the same region, but are > otherwise fairly general. I may have missed it but I think that map only allows for transform Array[T] to Array[T] it doesn't allow for Array[T] to Array[U]? > Unfortunately, the map function on DistArray didn't get updated to be > less restrictive in terms of the types involved. It still requires a > (T)=>T operation, not a (T)=>S. I don't think there is any good > reason for this, just that we were focusing on getting the Array API > to be "right" with the intention of then updating DistArray all at > once to match the improvements in the Array API and didn't do those > updates in time for 2.1.0. > > Sorry about that, we'll get the APIs of DistArray and Array in sync > for 2.1.1. You could probably do it with some minimal pain by either > modifying DistArray directly to fix its map method, or by making a > DistArray[Array[T]] and DistArray[Array[S]] and then writing an ateach > that uses the Array map function in each place on the elements of the > DistArray[Array]'s at that place. Not a pretty thing, but could be > enough to get you unblocked. In the end I went for a "just make an array using construction in parallel" rather than "set up an array and then create a new one by parallel map". I thought ateach was being deprecated? -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@russel.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder ------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users