|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64343 - in trunk: boost/mpi libs/mpi/src
From: troyer_at_[hidden]
Date: 2010-07-25 18:53:05
Author: troyer
Date: 2010-07-25 18:53:03 EDT (Sun, 25 Jul 2010)
New Revision: 64343
URL: http://svn.boost.org/trac/boost/changeset/64343
Log:
Attempted workaround to breaking changes in Boost.Serialization and removed any remaining dependence on binary archives
Text files modified:
trunk/boost/mpi/datatype.hpp | 4 ++--
trunk/boost/mpi/datatype_fwd.hpp | 4 +++-
trunk/boost/mpi/packed_iarchive.hpp | 23 ++++++++++++++++++-----
trunk/boost/mpi/packed_oarchive.hpp | 19 ++++++++++++++-----
trunk/libs/mpi/src/packed_iarchive.cpp | 4 ----
trunk/libs/mpi/src/packed_oarchive.cpp | 5 -----
trunk/libs/mpi/src/packed_skeleton_iarchive.cpp | 8 +-------
trunk/libs/mpi/src/packed_skeleton_oarchive.cpp | 6 ------
trunk/libs/mpi/src/text_skeleton_oarchive.cpp | 5 +----
9 files changed, 39 insertions(+), 39 deletions(-)
Modified: trunk/boost/mpi/datatype.hpp
==============================================================================
--- trunk/boost/mpi/datatype.hpp (original)
+++ trunk/boost/mpi/datatype.hpp 2010-07-25 18:53:03 EDT (Sun, 25 Jul 2010)
@@ -339,8 +339,8 @@
BOOST_MPI_DATATYPE(boost::archive::object_id_type, get_mpi_datatype(uint_least32_t()), integer);
BOOST_MPI_DATATYPE(boost::archive::object_reference_type, get_mpi_datatype(uint_least32_t()), integer);
BOOST_MPI_DATATYPE(boost::archive::tracking_type, get_mpi_datatype(bool()), builtin);
-BOOST_MPI_DATATYPE(boost::serialization::collection_size_type, get_mpi_datatype(std::size_t()), builtin);
-BOOST_MPI_DATATYPE(boost::serialization::item_version_type, get_mpi_datatype(uint_least8_t()), builtin);
+BOOST_MPI_DATATYPE(boost::serialization::collection_size_type, get_mpi_datatype(std::size_t()), integer);
+BOOST_MPI_DATATYPE(boost::serialization::item_version_type, get_mpi_datatype(uint_least8_t()), integer);
#endif // Doxygen
Modified: trunk/boost/mpi/datatype_fwd.hpp
==============================================================================
--- trunk/boost/mpi/datatype_fwd.hpp (original)
+++ trunk/boost/mpi/datatype_fwd.hpp 2010-07-25 18:53:03 EDT (Sun, 25 Jul 2010)
@@ -25,7 +25,9 @@
template<typename T> struct is_mpi_complex_datatype;
template<typename T> struct is_mpi_byte_datatype;
template<typename T> struct is_mpi_datatype;
-template<typename T> MPI_Datatype get_mpi_datatype(const T& x = T());
+template<typename T> MPI_Datatype get_mpi_datatype(const T& x);
+template<typename T> MPI_Datatype get_mpi_datatype()
+ { return get_mpi_datatype(T());}
/// a dummy data type giving MPI_PACKED as its MPI_Datatype
struct packed {};
Modified: trunk/boost/mpi/packed_iarchive.hpp
==============================================================================
--- trunk/boost/mpi/packed_iarchive.hpp (original)
+++ trunk/boost/mpi/packed_iarchive.hpp 2010-07-25 18:53:03 EDT (Sun, 25 Jul 2010)
@@ -20,10 +20,13 @@
#include <boost/mpi/datatype.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
-#include <boost/archive/basic_binary_iarchive.hpp>
+#include <boost/archive/detail/common_iarchive.hpp>
#include <boost/archive/shared_ptr_helper.hpp>
#include <boost/mpi/detail/packed_iprimitive.hpp>
#include <boost/mpi/detail/binary_buffer_iprimitive.hpp>
+#include <boost/serialization/string.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
#include <boost/assert.hpp>
namespace boost { namespace mpi {
@@ -44,7 +47,7 @@
*/
class BOOST_MPI_DECL packed_iarchive
: public iprimitive
- , public archive::basic_binary_iarchive<packed_iarchive>
+ , public archive::detail::common_iarchive<packed_iarchive>
, public archive::detail::shared_ptr_helper
{
public:
@@ -67,7 +70,7 @@
*/
packed_iarchive(MPI_Comm const & comm, buffer_type & b, unsigned int flags = boost::archive::no_header, int position = 0)
: iprimitive(b,comm,position),
- archive::basic_binary_iarchive<packed_iarchive>(flags)
+ archive::detail::common_iarchive<packed_iarchive>(flags)
{}
/**
@@ -87,7 +90,7 @@
( MPI_Comm const & comm , std::size_t s=0,
unsigned int flags = boost::archive::no_header)
: iprimitive(internal_buffer_,comm)
- , archive::basic_binary_iarchive<packed_iarchive>(flags)
+ , archive::detail::common_iarchive<packed_iarchive>(flags)
, internal_buffer_(s)
{}
@@ -95,7 +98,7 @@
template<class T>
void load_override(T& x, int version, mpl::false_)
{
- archive::basic_binary_iarchive<packed_iarchive>::load_override(x,version);
+ archive::detail::common_iarchive<packed_iarchive>::load_override(x,version);
}
// Load it directly using the primnivites
@@ -115,6 +118,16 @@
load_override(x, version, use_optimized());
}
+ void load_override(archive::class_name_type & t, int)
+ {
+ std::string cn;
+ cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
+ * this->This() >> cn;
+ std::memcpy(t, cn.data(), cn.size());
+ // borland tweak
+ t.t[cn.size()] = '\0';
+ }
+
private:
/// An internal buffer to be used when the user does not supply his
/// own buffer.
Modified: trunk/boost/mpi/packed_oarchive.hpp
==============================================================================
--- trunk/boost/mpi/packed_oarchive.hpp (original)
+++ trunk/boost/mpi/packed_oarchive.hpp 2010-07-25 18:53:03 EDT (Sun, 25 Jul 2010)
@@ -20,9 +20,12 @@
#include <boost/mpi/datatype.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
-#include <boost/archive/basic_binary_oarchive.hpp>
+#include <boost/archive/detail/common_oarchive.hpp>
#include <boost/mpi/detail/packed_oprimitive.hpp>
#include <boost/mpi/detail/binary_buffer_oprimitive.hpp>
+#include <boost/serialization/string.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
namespace boost { namespace mpi {
@@ -43,7 +46,7 @@
class BOOST_MPI_DECL packed_oarchive
: public oprimitive,
- public archive::basic_binary_oarchive<packed_oarchive>
+ public archive::detail::common_oarchive<packed_oarchive>
{
public:
/**
@@ -62,7 +65,7 @@
*/
packed_oarchive( MPI_Comm const & comm, buffer_type & b, unsigned int flags = boost::archive::no_header)
: oprimitive(b,comm),
- archive::basic_binary_oarchive<packed_oarchive>(flags)
+ archive::detail::common_oarchive<packed_oarchive>(flags)
{}
/**
@@ -78,14 +81,14 @@
*/
packed_oarchive ( MPI_Comm const & comm, unsigned int flags = boost::archive::no_header)
: oprimitive(internal_buffer_,comm),
- archive::basic_binary_oarchive<packed_oarchive>(flags)
+ archive::detail::common_oarchive<packed_oarchive>(flags)
{}
// Save everything else in the usual way, forwarding on to the Base class
template<class T>
void save_override(T const& x, int version, mpl::false_)
{
- archive::basic_binary_oarchive<packed_oarchive>::save_override(x,version);
+ archive::detail::common_oarchive<packed_oarchive>::save_override(x,version);
}
// Save it directly using the primnivites
@@ -103,6 +106,12 @@
save_override(x, version, use_optimized());
}
+ // explicitly convert to char * to avoid compile ambiguities
+ void save_override(const archive::class_name_type & t, int){
+ const std::string s(t);
+ * this->This() << s;
+ }
+
private:
/// An internal buffer to be used when the user does not supply his
/// own buffer.
Modified: trunk/libs/mpi/src/packed_iarchive.cpp
==============================================================================
--- trunk/libs/mpi/src/packed_iarchive.cpp (original)
+++ trunk/libs/mpi/src/packed_iarchive.cpp 2010-07-25 18:53:03 EDT (Sun, 25 Jul 2010)
@@ -11,15 +11,11 @@
#include <boost/archive/detail/archive_serializer_map.hpp>
#include <boost/archive/impl/archive_serializer_map.ipp>
-#include <boost/archive/binary_iarchive.hpp>
-#include <boost/archive/impl/basic_binary_iprimitive.ipp>
-#include <boost/archive/impl/basic_binary_iarchive.ipp>
namespace boost { namespace archive {
// explicitly instantiate all required templates
-template class basic_binary_iarchive<mpi::packed_iarchive> ;
template class detail::archive_serializer_map<mpi::packed_iarchive> ;
} } // end namespace boost::archive
Modified: trunk/libs/mpi/src/packed_oarchive.cpp
==============================================================================
--- trunk/libs/mpi/src/packed_oarchive.cpp (original)
+++ trunk/libs/mpi/src/packed_oarchive.cpp 2010-07-25 18:53:03 EDT (Sun, 25 Jul 2010)
@@ -8,17 +8,12 @@
#define BOOST_ARCHIVE_SOURCE
#include <boost/mpi/packed_oarchive.hpp>
-
#include <boost/archive/detail/archive_serializer_map.hpp>
#include <boost/archive/impl/archive_serializer_map.ipp>
-#include <boost/archive/binary_oarchive.hpp>
-#include <boost/archive/impl/basic_binary_oprimitive.ipp>
-#include <boost/archive/impl/basic_binary_oarchive.ipp>
namespace boost { namespace archive {
// explicitly instantiate all required templates
template class detail::archive_serializer_map<mpi::packed_oarchive> ;
-template class basic_binary_oarchive<mpi::packed_oarchive> ;
} } // end namespace boost::archive
Modified: trunk/libs/mpi/src/packed_skeleton_iarchive.cpp
==============================================================================
--- trunk/libs/mpi/src/packed_skeleton_iarchive.cpp (original)
+++ trunk/libs/mpi/src/packed_skeleton_iarchive.cpp 2010-07-25 18:53:03 EDT (Sun, 25 Jul 2010)
@@ -10,22 +10,16 @@
#include <boost/archive/detail/archive_serializer_map.hpp>
#include <boost/archive/impl/archive_serializer_map.ipp>
-
#include <boost/mpi/skeleton_and_content.hpp>
-#include <boost/archive/binary_iarchive.hpp>
-#include <boost/archive/impl/basic_binary_iprimitive.ipp>
-#include <boost/archive/impl/basic_binary_iarchive.ipp>
-
namespace boost { namespace archive {
// explicitly instantiate all required templates
-template class basic_binary_iarchive<mpi::packed_skeleton_iarchive> ;
+// template class basic_binary_iarchive<mpi::packed_skeleton_iarchive> ;
template class detail::archive_serializer_map<mpi::packed_skeleton_iarchive> ;
template class detail::archive_serializer_map<
mpi::detail::forward_skeleton_iarchive<
boost::mpi::packed_skeleton_iarchive, boost::mpi::packed_iarchive> > ;
-//template class binary_iarchive_impl<packed_skeleton_iarchive> ;
} } // end namespace boost::archive
Modified: trunk/libs/mpi/src/packed_skeleton_oarchive.cpp
==============================================================================
--- trunk/libs/mpi/src/packed_skeleton_oarchive.cpp (original)
+++ trunk/libs/mpi/src/packed_skeleton_oarchive.cpp 2010-07-25 18:53:03 EDT (Sun, 25 Jul 2010)
@@ -8,12 +8,8 @@
#define BOOST_ARCHIVE_SOURCE
#include <boost/mpi/skeleton_and_content.hpp>
-
#include <boost/archive/detail/archive_serializer_map.hpp>
#include <boost/archive/impl/archive_serializer_map.ipp>
-#include <boost/archive/binary_oarchive.hpp>
-#include <boost/archive/impl/basic_binary_oprimitive.ipp>
-#include <boost/archive/impl/basic_binary_oarchive.ipp>
namespace boost { namespace archive {
// explicitly instantiate all required templates
@@ -22,7 +18,5 @@
template class detail::archive_serializer_map<
mpi::detail::forward_skeleton_oarchive<
boost::mpi::packed_skeleton_oarchive, boost::mpi::packed_oarchive> > ;
-template class basic_binary_oarchive<mpi::packed_skeleton_oarchive> ;
-//template class binary_oarchive_impl<mpi_packed_oarchive> ;
} } // end namespace boost::archive
Modified: trunk/libs/mpi/src/text_skeleton_oarchive.cpp
==============================================================================
--- trunk/libs/mpi/src/text_skeleton_oarchive.cpp (original)
+++ trunk/libs/mpi/src/text_skeleton_oarchive.cpp 2010-07-25 18:53:03 EDT (Sun, 25 Jul 2010)
@@ -11,13 +11,10 @@
#include <boost/archive/detail/archive_serializer_map.hpp>
#include <boost/archive/impl/archive_serializer_map.ipp>
-#include <boost/archive/binary_oarchive.hpp>
-#include <boost/archive/impl/basic_binary_oprimitive.ipp>
-#include <boost/archive/impl/basic_binary_oarchive.ipp>
namespace boost { namespace archive {
// explicitly instantiate all required templates
-template class detail::archive_serializer_map<text_oarchive>;
+// template class detail::archive_serializer_map<text_oarchive>;
} } // end namespace boost::archive
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk