Konstantina Panagiotopoulou <kwno...@hotmail.com> wrote on 06/13/2014
02:38:51 PM:
>
> The simple example works just fine.
> In the original code (using ateach over places), it only works for
> single place execution.
> With multiple places it doesn't get passed the finish(myMulReducer)
> block, (half the times it gives seg fault).
>
> Tracing back the files that use Complex I added appropriate lines in
> x10.runtime/x10rt/include/{x10rt_cpp.h, x10rt_types.h,
> x10_x10rt_TeamSupport.h}. Still no change.
>
> I assume this is a serialisation related problem.Could it be my
> naive implementation of hashCode(basic_functions)?
> (currently using the hash of the int part of the mpz number)
>

Serialization seems like a good guess.

it probably isn't hashCode, but something gone wrong in the
serialization/deserialization implementation.

Because Complex is a fixed size (like Int, Float, etc), there is a
specialized version of serialization/deserialization for it in
x10aux/serialization_buffer.h and x10aux/deserialization_buffer.h.  Since
you have a variable size type, I think you don't want to do this, but
instead provide the serialization/deserialization methods in your Mpz type.
I'd guess that looking at how we do String serialization might help
(x10/lang/String.h and .cc).  There's a block of related methods:

            static const ::x10aux::serialization_id_t _serialization_id;
            virtual ::x10aux::serialization_id_t _get_serialization_id()
{ return _serialization_id; };
            virtual void _serialize_body(::x10aux::serialization_buffer&
buf);
            static Reference* _deserializer
(::x10aux::deserialization_buffer &buf);
            void _deserialize_body(::x10aux::deserialization_buffer &buf);


To test this, I'd suggest a small program that uses x10.io.Serailizer and
Deserializer to make it easier to run under gdb and maybe figure out
exactly where it is crashing.

Something like

        val ser = new x10.io.Serializer();
        ser.writeAny(Mpz(10));
        ser.writeAny(Mpz(20));
        val dser = new x10.io.Deserializer(ser);
        val x = dser.readAny() as Mpz;
        val y = dser.readAny() as Mpz;

If that crashes, great.

It not, try something similar with a myMulReducer and see if that crashes.

If neither crashes, then we'll have to try to debug the full program.
Probably the first thing is to get the backtrace from the crash and see if
that helps nail it down.

--dave




------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to