Christoph Pospiech <christoph.pospi...@de.ibm.com> wrote on 01/04/2011 
01:38:25 PM:

> On Tuesday, January 04, 2011 06:07:20 pm Igor Peshansky wrote:
> > I would look for hints in the following part of the message:
> > 
> >     init: (a1:x10.array.Point{self.rank==reg.rank})=> 
> > x10.array.RemoteArray
> > 
> > You are passing in a closure of type (Point)=>RemoteArray, and the
> > constructor expects a closure of type
> > (Point{rank==Dv_tmp.region().rank})=>RemoteArray .
> > Of course, the type system cannot express the above constraint 
directly,
> > so you would have to write the code in the following manner:
> > 
> > [...]
> >     val r_tmp = Dv_tmp.region();
> >     v_loc = new Array[Array1D](r_tmp,
> >             (r:Point(r_tmp.rank))=>
> >                 (new Array[Double](0..(n-1), (0.0 as Double))) );
> >     r_loc = new Array[RemoteArray](r_tmp,
> >             (r:Point(r_tmp.rank)) => (new RemoteArray(v_loc(r))) );
> > [...]
> > 
> > or, if Dv_tmp is statically known to be of rank 1, you can also write:
> > 
> > [...]
> >     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](Dv_tmp.region(),
> >             (r:Point(1)) => (new RemoteArray(v_loc(r))) );
> > [...]
> > 
> > Hope this helps,
> >         Igor
> 
> Igor,
> 
> I tried the first option, and the error message changed to the 
following.
> 
> /home/cp/xample/MatMul/mm_X10/src/matmul.x10:93-94: Constructor 
this(reg: 
> x10.array.Region, init: (a1:x10.array.Point{self.rank==reg.rank})=> 
> x10.array.RemoteArray): x10.array.Array[x10.array.RemoteArray]
> {self.region==reg} 
>      cannot be invoked with arguments 
>      (x10.array.Region{self==r_tmp, Dv_tmp.region==r_tmp}, <anonymous 
class>).
> 
> Any suggestion on how to proceed ? 

Umm, the error message in this case is obviously inadequate, since it does
not give you any way of figuring out what's wrong with the closure type
(because the closure type is not included in any useful form).  If you 
send
me the complete piece of code off-list (or open a JIRA), I could debug the
compiler and tell you exactly why it's complaining.  Unfortunately, that's
the only option I can offer at the moment, though we will be working on
fixing the error message shortly (again, a JIRA would help).

> BTW, Dv_tmp is defined as follows.
>                 // Finally, we set up a distribution
>       // with one point per place
>       val Dv_tmp:Dist = Dist.makeUnique(D.places());
>       val r_tmp = Dv_tmp.region();
> 
> So, I know that it has rank 1. How can I make that known to the compiler 
? 
> Once that is accomplished, I can try your second suggestion.

Try omitting the explicit type on Dv_tmp, namely:

      val Dv_tmp = Dist.makeUnique(D.places());

or telling the compiler that the distribution is of rank 1:

      val Dv_tmp:Dist(1) = Dist.makeUnique(D.places());

Hope this helps,
        Igor
-- 
Igor Peshansky  (note the spelling change!)
IBM T.J. Watson Research Center
X10: Parallel Productivity and Performance (http://x10-lang.org/)
XJ: No More Pain for XML's Gain (http://www.research.ibm.com/xj/)
"I hear and I forget.  I see and I remember.  I do and I understand" -- 
Xun Zi


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to