|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55438 - trunk/boost/mpi/detail
From: troyer_at_[hidden]
Date: 2009-08-06 16:41:30
Author: troyer
Date: 2009-08-06 16:41:28 EDT (Thu, 06 Aug 2009)
New Revision: 55438
URL: http://svn.boost.org/trac/boost/changeset/55438
Log:
Fixed trac issue 3261
Text files modified:
trunk/boost/mpi/detail/forward_skeleton_iarchive.hpp | 7 +++++++
trunk/boost/mpi/detail/forward_skeleton_oarchive.hpp | 5 +++++
trunk/boost/mpi/detail/ignore_iprimitive.hpp | 2 +-
trunk/boost/mpi/detail/ignore_oprimitive.hpp | 4 ++--
trunk/boost/mpi/detail/ignore_skeleton_oarchive.hpp | 7 +++++++
trunk/boost/mpi/detail/packed_iprimitive.hpp | 6 +++---
trunk/boost/mpi/detail/packed_oprimitive.hpp | 6 +++---
7 files changed, 28 insertions(+), 9 deletions(-)
Modified: trunk/boost/mpi/detail/forward_skeleton_iarchive.hpp
==============================================================================
--- trunk/boost/mpi/detail/forward_skeleton_iarchive.hpp (original)
+++ trunk/boost/mpi/detail/forward_skeleton_iarchive.hpp 2009-08-06 16:41:28 EDT (Thu, 06 Aug 2009)
@@ -65,6 +65,13 @@
BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_name_type)
BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(serialization::collection_size_type)
+ void load_override(std::string & s , int)
+ {
+ serialization::collection_size_type length(s.size());
+ load_override(length,0);
+ s.resize(length);
+ }
+
#undef BOOST_ARCHIVE_FORWARD_IMPLEMENTATION
protected:
/// the actual archive used to serialize the information we actually want to store
Modified: trunk/boost/mpi/detail/forward_skeleton_oarchive.hpp
==============================================================================
--- trunk/boost/mpi/detail/forward_skeleton_oarchive.hpp (original)
+++ trunk/boost/mpi/detail/forward_skeleton_oarchive.hpp 2009-08-06 16:41:28 EDT (Thu, 06 Aug 2009)
@@ -66,6 +66,11 @@
BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_name_type)
BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(serialization::collection_size_type)
+ void save_override(std::string const & t , int)
+ {
+ save_override(serialization::collection_size_type(t.size()),0);
+ }
+
#undef BOOST_ARCHIVE_FORWARD_IMPLEMENTATION
protected:
Modified: trunk/boost/mpi/detail/ignore_iprimitive.hpp
==============================================================================
--- trunk/boost/mpi/detail/ignore_iprimitive.hpp (original)
+++ trunk/boost/mpi/detail/ignore_iprimitive.hpp 2009-08-06 16:41:28 EDT (Thu, 06 Aug 2009)
@@ -52,7 +52,7 @@
/// don't do anything when loading primitive types
template<class T>
void load(T & t)
- {
+ {
}
};
Modified: trunk/boost/mpi/detail/ignore_oprimitive.hpp
==============================================================================
--- trunk/boost/mpi/detail/ignore_oprimitive.hpp (original)
+++ trunk/boost/mpi/detail/ignore_oprimitive.hpp 2009-08-06 16:41:28 EDT (Thu, 06 Aug 2009)
@@ -31,8 +31,8 @@
/// don't do anything when saving binary data
void save_binary(const void *, std::size_t )
- {
- }
+ {
+ }
/// don't do anything when saving arrays
template<class T>
Modified: trunk/boost/mpi/detail/ignore_skeleton_oarchive.hpp
==============================================================================
--- trunk/boost/mpi/detail/ignore_skeleton_oarchive.hpp (original)
+++ trunk/boost/mpi/detail/ignore_skeleton_oarchive.hpp 2009-08-06 16:41:28 EDT (Thu, 06 Aug 2009)
@@ -16,6 +16,7 @@
#include <boost/archive/basic_archive.hpp>
#include <boost/archive/detail/oserializer.hpp>
#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/array.hpp>
namespace boost { namespace mpi { namespace detail {
@@ -60,6 +61,12 @@
BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_name_type)
BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(serialization::collection_size_type)
+ void save_override(std::string const & s, int)
+ {
+ if (s.size())
+ save_override(serialization::make_array(s.data(),s.size()),0);
+ }
+
#undef BOOST_ARCHIVE_IGNORE_IMPLEMENTATION
};
Modified: trunk/boost/mpi/detail/packed_iprimitive.hpp
==============================================================================
--- trunk/boost/mpi/detail/packed_iprimitive.hpp (original)
+++ trunk/boost/mpi/detail/packed_iprimitive.hpp 2009-08-06 16:41:28 EDT (Thu, 06 Aug 2009)
@@ -97,15 +97,15 @@
s.resize(l);
// note breaking a rule here - could be a problem on some platform
load_impl(const_cast<char *>(s.data()),MPI_CHAR,l);
- }
+ }
private:
void load_impl(void * p, MPI_Datatype t, int l)
- {
+ {
BOOST_MPI_CHECK_RESULT(MPI_Unpack,
(const_cast<char*>(boost::serialization::detail::get_data(buffer_)), buffer_.size(), &position, p, l, t, comm));
- }
+ }
buffer_type & buffer_;
mutable std::size_t size_;
Modified: trunk/boost/mpi/detail/packed_oprimitive.hpp
==============================================================================
--- trunk/boost/mpi/detail/packed_oprimitive.hpp (original)
+++ trunk/boost/mpi/detail/packed_oprimitive.hpp 2009-08-06 16:41:28 EDT (Thu, 06 Aug 2009)
@@ -77,12 +77,12 @@
save_impl(&t, get_mpi_datatype<T>(t), 1);
}
- void save(const std::string &s)
- {
+ void save(const std::string &s)
+ {
unsigned int l = static_cast<unsigned int>(s.size());
save(l);
save_impl(s.data(),MPI_CHAR,s.size());
- }
+ }
private:
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