Boost logo

Boost Users :

Subject: Re: [Boost-users] mpi/serialization: broadcasting derivedclass through base pointer
From: Matthias Troyer (troyer_at_[hidden])
Date: 2012-01-29 07:32:19


On Jan 21, 2012, at 12:16 AM, MM wrote:
>
> >
> I went with the export guid route. It builds but it seems to go into an infinite loop.
>
> This is:
>
>
>
> interface_archive.hpp
> template<class T>
> Archive & operator>>(T & t){
> >>> this->This()->load_override(t, 0);
> return * this->This();
> }
>
>
> which calls itself again after a couple of in-between calls to other functions. Here is a stack:
>
> > nhcomp.exe!boost::archive::detail::interface_iarchive<boost::mpi::packed_iarchive>::operator>><boost::archive::class_id_type>(boost::archive::class_id_type & t) Line 60 C++
> nhcomp.exe!boost::archive::detail::common_iarchive<boost::mpi::packed_iarchive>::vload(boost::archive::class_id_type & t) Line 52 C++
> nhcomp.exe!boost::archive::detail::basic_iarchive_impl::load<boost::archive::class_id_type>(boost::archive::detail::basic_iarchive & ar, boost::archive::class_id_type & t) Line 198 C++
> nhcomp.exe!boost::archive::detail::basic_iarchive_impl::load_pointer(boost::archive::detail::basic_iarchive & ar, void * & t, const boost::archive::detail::basic_pointer_iserializer * bpis_ptr, const boost::archive::detail::basic_pointer_iserializer * (const boost::serialization::extended_type_info &)* finder) Line 411 C++
> nhcomp.exe!boost::archive::detail::basic_iarchive::load_pointer(void * & t, const boost::archive::detail::basic_pointer_iserializer * bpis_ptr, const boost::archive::detail::basic_pointer_iserializer * (const boost::serialization::extended_type_info &)* finder) Line 551 C++
> nhcomp.exe!boost::archive::detail::load_pointer_type<boost::mpi::packed_iarchive>::invoke<nicohich::histodatas::historical_data_base *>(boost::mpi::packed_iarchive & ar, nicohich::histodatas::historical_data_base * & t) Line 524 + 0x15 bytes C++
> nhcomp.exe!boost::archive::load<boost::mpi::packed_iarchive,nicohich::histodatas::historical_data_base *>(boost::mpi::packed_iarchive & ar, nicohich::histodatas::historical_data_base * & t) Line 592 + 0xd bytes C++
> nhcomp.exe!boost::archive::detail::common_iarchive<boost::mpi::packed_iarchive>::load_override<nicohich::histodatas::historical_data_base *>(nicohich::histodatas::historical_data_base * & t, int __formal) Line 66 + 0x15 bytes C++
> nhcomp.exe!boost::mpi::packed_iarchive::load_override<nicohich::histodatas::historical_data_base *>(nicohich::histodatas::historical_data_base * & x, int version, boost::mpl::bool_<0> __formal) Line 102 C++
> nhcomp.exe!boost::mpi::packed_iarchive::load_override<nicohich::histodatas::historical_data_base *>(nicohich::histodatas::historical_data_base * & x, int version) Line 119 C++
> nhcomp.exe!boost::archive::detail::interface_iarchive<boost::mpi::packed_iarchive>::operator>><nicohich::histodatas::historical_data_base *>(nicohich::histodatas::historical_data_base * & t) Line 61 C++
>
> rds,

this is not an infinite loop since it calls operator>> with a different type - can you please post more if you think there is an infinite loop. I am still confused as to what the reason for your problems is.

Also, did you test whether what you want to do works if you use binary archives, to store and load the object?

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