Yes, I can help. In this line: r_loc = new Array[RemoteArray[Double]](Dv_tmp.region(), (r:Point(1)) => {(new RemoteArray(*v_loc*(r)))});
you created a closure that references a field of "this". If this closure is passed to another place, then "this" will be serialized. However, "this" is still half-baked, i.e., it's constructor didn't finish yet. Therefore, "this" cannot escape to closures in a constructor. Work-around: you need to use a local (not a field): val v_loc = ...; and use that local in the closure: (r:Point(1)) => {(new RemoteArray(*v_loc*(r)))}); Cheers, Yoav On Tue, Jan 18, 2011 at 1:42 PM, Christoph Pospiech < christoph.pospi...@de.ibm.com> wrote: > Hi, > > the following code snippet > > public class matmul { > [...] > static type Array1D = Array[Double]{rank==1}; > [...] > val v_loc: Array[Array1D]{rank==1}; > val r_loc: Array[RemoteArray[Double]]{rank==1}; > > /** > * special constructor > */ > public def this(n:Int, axis:Int, Dprint: Boolean) { > [...] > v_loc = new Array[Array1D](Dv_tmp.region(), > (r:Point(1)) => {(new Array[Double]((0..n-1), > ( 0.0 as Double))) } ); > r_loc = new Array[RemoteArray[Double]](Dv_tmp.region(), > (r:Point(1)) => {(new RemoteArray(v_loc(r)))}); > /* the line above is line 93 */ > } > [...] > } > > produces this compiler error message with X10 v.2.1.1. > > /home/cp/xample/MatMul/mm_X10/src/matmul.x10:93: 'this' or 'super' cannot > escape via a closure during construction. > > Perhaps this message is obvious or clear for others but I am lost here. Can > anyone explain what it means ? Sorry for this dumb question ! > > -- > > Mit freundlichen Grüßen / Kind regards > > Dr. Christoph Pospiech > High Performance & Parallel Computing > Phone: +49-351 86269826 > Mobile: +49-171-765 5871 > E-Mail: christoph.pospi...@de.ibm.com > ------------------------------------- > IBM Deutschland GmbH > Vorsitzender des Aufsichtsrats: Erich Clementi > Geschäftsführung: Martin Jetter (Vorsitzender), > Reinhard Reschke, Dieter Scholz, > Gregor Pillen, Michael Diemer, Martina Koederitz > Sitz der Gesellschaft: Ehningen / Registergericht: Amtsgericht Stuttgart, > HRB > 14562 WEEE-Reg.-Nr. DE 99369940 > > > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > X10-users mailing list > X10-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/x10-users > ------------------------------------------------------------------------------ Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users