serializing FastSparseVector

21 views
Skip to first unread message

waleed ammar

unread,
Jan 29, 2013, 10:50:42 AM1/29/13
to cdec-...@googlegroups.com
Recently, I've been a happy user of the FastSparseVector class, but I couldn't figure out how to make it "serializable". I get a compilation error when I call boost::mpi::broadcast (reduce gives a similar error) specializing the function template to FastSparseVector<double>. The problematic line is:

boost::mpi::broadcast< FastSparseVector<double> >(mpiWorld, mySparseVector, 0);

The error is (attached is the full error stream output):

In instantiation of function template specialization 'boost::mpi::broadcast<FastSparseVector<double, 7> >': 

In file included from /opt/tools/boost_1_52_0/boost/serialization/extended_type_info_typeid.hpp:37:
/opt/tools/boost_1_52_0/boost/serialization/access.hpp:118:11: error: no member named 'serialize' in 'FastSparseVector<double, 7>'
        t.serialize(ar, file_version);
        ~ ^

My header file contains the following subsequence of lines:

#include <boost/archive/text_oarchive.hpp>
#define HAVE_BOOST_ARCHIVE_TEXT_OARCHIVE_HPP 1
#include "cdec-utils/fast_sparse_vector.h"

I'm using the current version of cdec utils, boost v.1.52.0, LLVM 3.1

Thanks,
waleed
error.txt

waleed ammar

unread,
Jan 30, 2013, 6:38:34 AM1/30/13
to cdec-...@googlegroups.com
fixed.

it turned out there was another (earlier) header file which included fast_sparse_vector.h without defining HAVE_BOOST_ARCHIVE_TEXT_OARCHIVE_HPP

tnx,
waleed
Reply all
Reply to author
Forward
0 new messages