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 = ⪫
>
>
>
>
>
>
> 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