mpi/serialization: string serialization and const char*

hello, Including I mpi::broadcast an object. Its serialization method is split into a save() and a load(). In the save(), I send: ar << "fixed_params"; where ar is a boost::mpi::packed_iarchive. At reception, the load() function : std::string paramstype; ar >> paramstype; if (paramstype=="fixed_params") /// this fails because the count of characters if 12 for 1 side and 13 for the other. The null character is there. Should this work? regards,

Hicham Mouline wrote:
hello,
Including I mpi::broadcast an object. Its serialization method is split into a save() and a load(). In the save(), I send:
ar << "fixed_params";
where ar is a boost::mpi::packed_iarchive.
At reception, the load() function :
std::string paramstype; ar >> paramstype; if (paramstype=="fixed_params") /// this fails because the count of characters if 12 for 1 side and 13 for the other. The null character is there.
Should this work?
no. The type loaded has to be identical to the type saved. Robert Ramey
regards,
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Hi Hicham
Hicham Mouline a écrit :
hello,
Including
I mpi::broadcast an object. Its serialization method is split into a save() and a load(). In the save(), I send:
ar << "fixed_params";
what about ar << std::string("fixed_params"); ? Hope it helps. regards frc --
participants (3)
-
François Mauger
-
Hicham Mouline
-
Robert Ramey