::load_object_data(boost::archive::detail::basic_iarchive&, void*,
unsigned int) const ()
#13 0x00007ffff79416fa in load_object (this=0x7fffffffcae0, t=<value
optimized out>, bis=...) at libs/serialization/src/basic_iarchive.cpp:399
#14 boost::archive::detail::basic_iarchive::load_object
(this=0x7fffffffcae0, t=<value optimized out>, bis=...) at
::load_object_data(boost::archive::detail::basic_iarchive&, void*,
unsigned int) const ()
#16 0x00007ffff79416fa in load_object (this=0x7fffffffcae0, t=<value
optimized out>, bis=...) at libs/serialization/src/basic_iarchive.cpp:399
#17 boost::archive::detail::basic_iarchive::load_object
(this=0x7fffffffcae0, t=<value optimized out>, bis=...) at
&, mpl_::bool_<false>) const ()
#19 0x000000000044982d in recv<ParticleArray> (this=0x66b150,
slice=0x8779e0, pack_type=<value optimized out>, sendnum=1) at
/usr/include/boost/mpi/communicator.hpp:1201
#20 Communicator::receive (this=0x66b150, slice=0x8779e0,
Hello, I'm working on a parallel physical simulation involving particles
in a 3D grid.
In addition to Boost libraries, I use the Eigen3 template library for
holding numerical data in small 3-vectors.
I'm trying to send a 3D boost::multi_array containing std::list of
pointers to particle structs via boost::mpi and keep getting a segfault
on receive.
Sending and receiving boost::multi_array of V3D Eigen3 vectors works fine.
Serialization functions for multi_array are from
http://tinyurl.com/3koafmr (edited for 3 dimensions, seems to work)
Serializing Eigen Vector3d type (seems to work):
friend class boost::serialization::access;
template<class Archive>
inline void serialize(Archive & ar, const unsigned int file_version) {
ar & m_coeffs.x();
ar & m_coeffs.y();
ar & m_coeffs.z();
}
typedef Vector3d V3D; //Convenience typedef for Eigen3 vector
struct Particle {
V3D r, u;
double m, q;
unsigned number;
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int file_version) {
ar & r; ar & u;
ar & m; ar & q;
ar & number;
}
};
Sending point:
typedef boost::multi_array, 3> ParticleArray;
ParticleArray part_array(boost::extents[x][y][z]);
...fill the array with particles, some cells might be empty...
world->isend(recnum, pack_type, part_array);
Receiving point:
ParticleArray
part_array(boost::extents[slice->shape()[0]][slice->shape()[1]][slice->shape()[2]]);
world->recv(sendnum, pack_type, part_array);
When I get here, it segfaults:
terminate called after throwing an instance of
'boost::archive::archive_exception'
what(): class version
# 0 0
Program received signal SIGABRT, Aborted.
0x00007ffff5a29a25 in raise () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff5a29a25 in raise () from /lib64/libc.so.6
#1 0x00007ffff5a2b0af in abort () from /lib64/libc.so.6
#2 0x00007ffff64fb695 in __gnu_cxx::__verbose_terminate_handler () at
/var/tmp/portage/sys-devel/gcc-4.4.5/work/gcc-4.4.5/libstdc++-v3/libsupc++/vterminate.cc:93
#3 0x00007ffff64f9ac6 in __cxxabiv1::__terminate (handler=0x70d) at
/var/tmp/portage/sys-devel/gcc-4.4.5/work/gcc-4.4.5/libstdc++-v3/libsupc++/eh_terminate.cc:38
#4 0x00007ffff64f9af3 in std::terminate () at
/var/tmp/portage/sys-devel/gcc-4.4.5/work/gcc-4.4.5/libstdc++-v3/libsupc++/eh_terminate.cc:48
#5 0x00007ffff64f9bee in __cxxabiv1::__cxa_throw (obj=<value optimized
out>, tinfo=<value optimized out>, dest=<value optimized out>) at
/var/tmp/portage/sys-devel/gcc-4.4.5/work/gcc-4.4.5/libstdc++-v3/libsupc++/eh_throw.cc:83
#6 0x000000000044f7d5 in
boost::archive::detail::iserializer::load_object_data(boost::archive::detail::basic_iarchive&,
void*, unsigned int) const ()
#7 0x00007ffff794173b in load_object (this=0x7fffffffcae0, t=<value
optimized out>, bis=...) at libs/serialization/src/basic_iarchive.cpp:367
#8 boost::archive::detail::basic_iarchive::load_object
(this=0x7fffffffcae0, t=<value optimized out>, bis=...) at
libs/serialization/src/basic_iarchive.cpp:547
#9 0x000000000044f662 in
boost::archive::detail::pointer_iserializer::load_object_ptr(boost::archive::detail::basic_iarchive&,
void*&, unsigned int) const ()
#10 0x00007ffff7941c50 in load_pointer (this=0x7fffffffcae0,
t=@0x7fffffffc880, bpis_ptr=0x668060, finder=<value optimized out>) at
libs/serialization/src/basic_iarchive.cpp:494
#11 boost::archive::detail::basic_iarchive::load_pointer
(this=0x7fffffffcae0, t=@0x7fffffffc880, bpis_ptr=0x668060,
finder=<value optimized out>) at
libs/serialization/src/basic_iarchive.cpp:560
#12 0x000000000044ed6f in
boost::archive::detail::iserializer >
libs/serialization/src/basic_iarchive.cpp:547
#15 0x000000000044ffb4 in
boost::archive::detail::iserializer >,
3ul, std::allocator > > >
libs/serialization/src/basic_iarchive.cpp:547
#18 0x00000000004516f9 in boost::mpi::status
boost::mpi::communicator::recv_impl >, 3ul, std::allocator > > > >(int, int,
boost::multi_array >,
3ul, std::allocator > >
pack_type=<value optimized out>, sendnum=1) at
/home/strazce/prog/opice/opice/src/communicator.cpp:62
#21 0x000000000043d512 in Experiment::run (this=0x66b0c0) at
/home/strazce/prog/opice/opice/src/experiment.cpp:96
#22 0x000000000042c13c in main (argc=1, argv=0x7fffffffd158) at
/home/strazce/prog/opice/opice/src/opice.cpp:29
(gdb)
Again, this error only shows when receiving the multi_array of
std::list. multi_array of V3D is received fine.
Thanks for any help,
Jiri Vyskocil