Dear All,
I have encountered a problem I cannot go through
regarding boost::mpi and shared_ptr.
Please consider the following code:
class Foo
{
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive &ar, const unsigned int
version)
{
//...
}
};
//...
mpi::communicator world;
boost::shared_ptr<Foo> pFoo;
if (world.rank() == 0)
pFoo = boost::shared_ptr<Foo>(new Foo);
mpi::broadcast(world, pFoo, 0);
//...
Now unfortunately this doesn't compile, I get the
following error message:
/home/jooam/usr/include/boost-1_35/boost/serialization/shared_ptr.hpp:
In function 'void boost::serialization::load(Archive&,
boost::shared_ptr<U>&, unsigned int) [with Archive =
boost::mpi::packed_iarchive, T = Foo]':
/home/jooam/usr/include/boost-1_35/boost/serialization/split_free.hpp:58:
instantiated from 'static void
boost::serialization::free_loader
This should also be fixed in the current CVS version. Can you check? On 6 Jul 2007, at 04:56, Andras Joo wrote:
Dear All, I have encountered a problem I cannot go through regarding boost::mpi and shared_ptr.
Please consider the following code:
class Foo { friend class boost::serialization::access; template<class Archive> void serialize(Archive &ar, const unsigned int version) { //... } };
//... mpi::communicator world; boost::shared_ptr<Foo> pFoo;
if (world.rank() == 0) pFoo = boost::shared_ptr<Foo>(new Foo);
mpi::broadcast(world, pFoo, 0); //...
Now unfortunately this doesn't compile, I get the following error message:
/home/jooam/usr/include/boost-1_35/boost/serialization/shared_ptr.hpp: In function 'void boost::serialization::load(Archive&, boost::shared_ptr<U>&, unsigned int) [with Archive = boost::mpi::packed_iarchive, T = Foo]': /home/jooam/usr/include/boost-1_35/boost/serialization/ split_free.hpp:58: instantiated from 'static void boost::serialization::free_loader
::invoke(Archive&, T&, unsigned int) [with Archive = boost::mpi::packed_iarchive, T = boost::shared_ptr<Foo>]' /home/jooam/usr/include/boost-1_35/boost/serialization/ split_free.hpp:74: instantiated from 'void boost::serialization::split_free(Archive&, T&, unsigned int) [with Archive = boost::mpi::packed_iarchive, T = boost::shared_ptr<Foo>]' /home/jooam/usr/include/boost-1_35/boost/serialization/ shared_ptr.hpp:152: instantiated from 'void boost::serialization::serialize(Archive&, boost::shared_ptr<U>&, unsigned int) [with Archive = boost::mpi::packed_iarchive, T = Foo]' /home/jooam/usr/include/boost-1_35/boost/serialization/ serialization.hpp:140: instantiated from 'void boost::serialization::serialize_adl(Archive&, T&, unsigned int) [with Archive = boost::mpi::packed_iarchive, T = boost::shared_ptr<Foo>]' /home/jooam/usr/include/boost-1_35/boost/archive/detail/ iserializer.hpp:161: instantiated from 'void boost::archive::detail::iserializer ::load_object_data(boost::archive::detail::basic_iarchive&, void*, unsigned int) const [with Archive = boost::mpi::packed_iarchive, T = boost::shared_ptr<Foo>]' /home/jooam/evolearn/src/evolearn.cpp:75: instantiated from here /home/jooam/usr/include/boost-1_35/boost/serialization/ shared_ptr.hpp:137: error: 'class boost::mpi::packed_iarchive' has no member named 'reset' Could you tell me please, what I'm doing wrong? I would appreciate any help.
Have a nice day, Andras
______________________________________________________________________ ______________ Don't get soaked. Take a quick peak at the forecast with the Yahoo! Search weather shortcut. http://tools.search.yahoo.com/shortcuts/#loc_weather _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Andras Joo
-
Matthias Troyer