yes i thought too,
sadly at this point changing from

Lattice* lat(filename");

to 

Lattice lat("filename");

means changing many lines of code of the algorithm asociated (which was initially a secuential program)
anyways, this whole experience and problems debugging, resulted in a lot of learning.


On Mon, Aug 30, 2010 at 5:53 PM, Robert Ramey <ramey@rrsd.com> wrote:
Cristobal Navarro wrote:
> i found the problem, and found a solution, but would be better if i
> learn some explanations of you guys which know much more.
>
>
> problem was that i was sending the pointer of my object
> {
> Lattice* lat = new Lattice("filename");
> world.send(1, 1, lat);
> }
> that generated the errors on the packing algorithms i suppose
> (correct me if im wrong)
>
>
> so instead of changing all my program i only sent the object pointed
>
>
> world.send(1, 1, *lat );
>
>
> and on the receiver process i receive it with
>
>
> Lattice lat;
> world.recv(0, 1, lat);
>
>
> then i can transform it to pointer again to keep my algorithms
> unchanged,
>
>
> Lattice plat = &lat;
>
>
>
>
>
>
> i wonder, is this a good approach to solve the error i was having??
> at least does work and i can continue programming, which makes me
> happy :) 
>
If it were me I would declare
 
world.send(?, ?,  const Lattice & lat);
world.recv(0, 1, Lattice & lat);
 
then:
Lattice lat("filename");

world.send(1, 1, lat);
and
Lattice lat;
world.recv(0, 1, lat);
 
transparent, easy and guarenteed correct.
 
Robert Ramey



 

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users