Christoph Pospiech <christoph.pospi...@de.ibm.com> wrote on 09/07/2010 
08:15:58 AM:

> On Tuesday, September 07, 2010, Igor Peshansky wrote:
> > If you do not get the C++ line numbers in the trace, you can also run 
your
> > program under gdb and set a breakpoint in
> > 'x10aux::throwException(x10aux::ref<x10::lang::Throwable>)'.  When you 
hit
> > this breakpoint, go up a frame and you should end up on the C++ line 
that
> > caused the exception to be thrown.  Again, the "//#line" comment above 

> > that
> > C++ line should point you to the corresponding X10 source line.
> 
> Igor,
> 
> following your suggestion above, I was able to pin the exception down to 
the 
> following single X10 statement.
> 
> 
>       finish ateach (pt in v_src ) {
>                    /* ... some lines left out ... */
>           /**
>            *  Scatter the vector v
>            */
>           v_src(pt).copyFrom(j_min(pt),
>                     v,j_min(pt),j_len(pt));
>                    /* ... some more lines left out ... */
>                 }
> 
> In this code snippet, we have the following data types.
> 
>         static type Array1D = Array[Double]{rank==1}; 
>         var v: Array1D;
>         global val v_src: DistArray[Array1D]{rank==1};
> 
>    /**
>     * v_src is generated from v by scattering
>     * the data across the MPI tasks. The following
>     * two distributed arrays describe which parts
>     * of v get where.
>     */
>     global val j_min: DistArray[Int]{rank==1};
>     global val j_len: DistArray[Int]{rank==1};
> 
> All objects of class DistArray are build on the same distribution.
>       val Dv_tmp:Dist = Dist.makeUnique(D.places());
> 
> Do you see what is wrong with this copyFrom() ? Actually, the exception 
is 
> thrown only when run on more than one place, and it is thrown when the 
place 
> v_src.dist()(pt) is not v.home(). It somehow smells like a placement 
error of 
> some sort.

Hi, Christoph,

You still did not say what *kind* of exception you're getting, but from
your description it looks like you get a ClassCastException from a
dynamic check.  I suggest you try compiling with -STATIC_CALLS and see
what compilation error you get on that line.  My suspicion is that it's
not "v" that's a problem, but rather one of "j_min" or "j_len"...

> BTW, I was using the following statement to start the gdb debugger.
> 
> mpiexec -np 2 ddd ./matmul

You can also do "mpiexec -np 2 -gdb ./matmul", and it will spawn an xterm
with a gdb session for each process.

> This gave me a GUI for each MPI task. Do you know whether the PTP 
parallel 
> debugger could be used for this as well ? At least for debugging the C++ 
code. 
> It is also based on gdb, as far as I know.

We have used the PTP debugger successfully in the past with X10, but
it took a fair bit of setup.  The problem is finding 
You could try to use the X10DT C++ backend
launch for your application in Debug mode, or even create a regular PTP
MPI launch config for your remote X10 application, and then use the
Debug mode with that, but you may have to tweak stuff by hand.
        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" -- 
Confucius


------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to