[MPICH] Sending, receiving and braodcasting a user defined C++ class

Alain.Miniussi at obs-nice.fr Alain.Miniussi at obs-nice.fr
Wed Dec 21 17:07:58 CST 2005


On Wed, 21 Dec 2005 17:00:50 +0100, Yann Golanski <yann at kierun.org> wrote:

> I'm looking for advice here and hopefully this could be included into
> an FAQ or whatnot.
>
> The attached code move data from a class in processor 0 to all the
> other in such a way as said data ends up in the same type of class at
> the end.
>
> My questions are:
>   1- Is there a better way of doing this?
>   2- How can my code be optimised?
>   3- Any other comments?

Looks like a general serialization problem, you might want
to split the problem into
1) serialize/deserialize the object to/from a flat representation
2) send that flat representation over the network.
  1 is the tricky one obviously, but a lot of work have been
done in that area, you could start by looking here:
http://www.boost.org/libs/serialization/doc/index.html
 Another technique is to write a tool that parse the class
and generate that serialization code, which is what is
usualy done in CORBA based tools (you can look into the code
of omniorb http://omniorb.sourceforge.net/) but that
probably overkill.

Regards,

Alain




More information about the mpich-discuss mailing list