Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.MPI] question about serializingcustomobject
From: Matthias Troyer (troyer_at_[hidden])
Date: 2010-08-31 03:20:04


On 30 Aug 2010, at 17:09, Cristobal Navarro wrote:

> sure,
>
> this is master process, sends objects.
> #SENDER PROCESS (rank 0)
> printf("sending latticec to worker 1\n");
> lat->print(); //to see what i am sending
> cin >> a;
> world.send(1, 1, lat);
>
> #RECEIVER PROCESS (rank 1)
> Lattice* latr;
> printf("worker%2d:: waiting master signal...\n", world.rank());
> world.recv(0, 1, latr);
> printf("OK\n");
> latr->print();
>
>
> #this is the Lattice class, i have commented almost all atributes on the serialization method except 2 integers.
> class Lattice{
>
> private:
> friend class boost::serialization::access;
> template<class Archive>
> void serialize(Archive & ar, const unsigned int version){
> ar & numNodes;
> ar & numEdges;
> //ar & nodes;
> //ar & edges;
> //ar & keyLists;
> //ar & corrupt;
> //ar & rec;
> //ar & nop;
> //ar & acumCoef;
> //ar & key;
> }
>
> public:
> int numNodes;
> int numEdges;
> map<int, Edge> edges;
> map<int, Node> nodes;
> string key;
> list< list<int> > keyLists;
> bool corrupt;
> bool rec;
> int nop;
> string acumCoef;
> }
>
>
>
> #when i send the object it has
> Nodes=2 Edges= 1
>
> #when i receive it, i get
> Nodes=131072 Edges= 65536
>

Can you please post a full program and not just fragments of your code. With those fragments I cannot reproduce your problem.

Matthias


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net