Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66067 - in branches/release: boost/archive boost/mpi boost/mpi/detail boost/serialization libs/mpi/build libs/mpi/test
From: troyer_at_[hidden]
Date: 2010-10-18 02:22:22


Author: troyer
Date: 2010-10-18 02:22:09 EDT (Mon, 18 Oct 2010)
New Revision: 66067
URL: http://svn.boost.org/trac/boost/changeset/66067

Log:
Moved Boost.MPI fixes for the 1.45 release to the release branch
Added:
   branches/release/libs/mpi/test/pointer_test.cpp
      - copied unchanged from r66042, /trunk/libs/mpi/test/pointer_test.cpp
Text files modified:
   branches/release/boost/archive/basic_archive.hpp | 15 +++++++++++++++
   branches/release/boost/mpi/datatype.hpp | 3 ++-
   branches/release/boost/mpi/detail/packed_iprimitive.hpp | 23 ++++++++++-------------
   branches/release/boost/mpi/detail/packed_oprimitive.hpp | 28 +++++++++++++---------------
   branches/release/boost/mpi/packed_iarchive.hpp | 3 +++
   branches/release/boost/mpi/packed_oarchive.hpp | 9 +++++++--
   branches/release/boost/serialization/collection_size_type.hpp | 4 +++-
   branches/release/libs/mpi/build/Jamfile.v2 | 2 +-
   branches/release/libs/mpi/test/Jamfile.v2 | 1 +
   9 files changed, 55 insertions(+), 33 deletions(-)

Modified: branches/release/boost/archive/basic_archive.hpp
==============================================================================
--- branches/release/boost/archive/basic_archive.hpp (original)
+++ branches/release/boost/archive/basic_archive.hpp 2010-10-18 02:22:09 EDT (Mon, 18 Oct 2010)
@@ -282,4 +282,19 @@
 BOOST_CLASS_IMPLEMENTATION(boost::archive::object_reference_type, primitive_type)
 BOOST_CLASS_IMPLEMENTATION(boost::archive::tracking_type, primitive_type)
 
+#include <boost/serialization/is_bitwise_serializable.hpp>
+
+// set types used internally by the serialization library
+// to be bitwise serializable
+
+BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::library_version_type)
+BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::version_type)
+BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_type)
+BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_reference_type)
+BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_optional_type)
+BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_name_type)
+BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::object_id_type)
+BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::object_reference_type)
+BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::tracking_type)
+
 #endif //BOOST_ARCHIVE_BASIC_ARCHIVE_HPP

Modified: branches/release/boost/mpi/datatype.hpp
==============================================================================
--- branches/release/boost/mpi/datatype.hpp (original)
+++ branches/release/boost/mpi/datatype.hpp 2010-10-18 02:22:09 EDT (Mon, 18 Oct 2010)
@@ -341,12 +341,13 @@
 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()), integer);
 BOOST_MPI_DATATYPE(boost::serialization::item_version_type, get_mpi_datatype(uint_least8_t()), integer);
-
 #endif // Doxygen
 
 
 } } // end namespace boost::mpi
 
+// direct support for special primitive data types of the serialization library
+// in the case of homogeneous systems
 // define a macro to make explicit designation of this more transparent
 #define BOOST_IS_MPI_DATATYPE(T) \
 namespace boost { \

Modified: branches/release/boost/mpi/detail/packed_iprimitive.hpp
==============================================================================
--- branches/release/boost/mpi/detail/packed_iprimitive.hpp (original)
+++ branches/release/boost/mpi/detail/packed_iprimitive.hpp 2010-10-18 02:22:09 EDT (Mon, 18 Oct 2010)
@@ -10,7 +10,6 @@
 #define BOOST_MPI_PACKED_IPRIMITIVE_HPP
 
 #include <boost/mpi/config.hpp>
-#include <iostream>
 #include <cstddef> // size_t
 #include <boost/config.hpp>
 #include <boost/mpi/datatype.hpp>
@@ -71,11 +70,13 @@
         load_impl(x.address(), get_mpi_datatype(*x.address()), x.count());
     }
 
+/*
     template<class T>
     void load(serialization::array<T> const& x)
     {
       load_array(x,0u);
     }
+*/
 
     typedef is_mpi_datatype<mpl::_1> use_array_optimization;
 
@@ -83,35 +84,31 @@
     template<class T>
     void load( T & t)
     {
- load_impl(&t, get_mpi_datatype(t), 1);
+ load_impl(&t, get_mpi_datatype(t), 1);
     }
 
     template<class CharType>
     void load(std::basic_string<CharType> & s)
     {
- unsigned int l;
+ unsigned int l;
         load(l);
- // borland de-allocator fixup
- #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101))
- if(NULL != s.data())
- #endif
         s.resize(l);
         // note breaking a rule here - could be a problem on some platform
- load_impl(const_cast<char *>(s.data()),get_mpi_datatype(CharType()),l);
+ load_impl(const_cast<CharType *>(s.data()),get_mpi_datatype(CharType()),l);
     }
 
 private:
 
     void load_impl(void * p, MPI_Datatype t, int l)
     {
- BOOST_MPI_CHECK_RESULT(MPI_Unpack,
+ 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_;
- MPI_Comm comm;
- int position;
+ buffer_type & buffer_;
+ mutable std::size_t size_;
+ MPI_Comm comm;
+ int position;
 };
 
 } } // end namespace boost::mpi

Modified: branches/release/boost/mpi/detail/packed_oprimitive.hpp
==============================================================================
--- branches/release/boost/mpi/detail/packed_oprimitive.hpp (original)
+++ branches/release/boost/mpi/detail/packed_oprimitive.hpp 2010-10-18 02:22:09 EDT (Mon, 18 Oct 2010)
@@ -10,7 +10,6 @@
 #define BOOST_MPI_PACKED_OPRIMITIVE_HPP
 
 #include <boost/mpi/config.hpp>
-#include <iostream>
 #include <cstddef> // size_t
 #include <boost/config.hpp>
 
@@ -74,7 +73,7 @@
     template<class T>
     void save(const T & t)
     {
- save_impl(&t, get_mpi_datatype<T>(t), 1);
+ save_impl(&t, get_mpi_datatype<T>(t), 1);
     }
 
     template<class CharType>
@@ -88,23 +87,22 @@
 private:
 
     void save_impl(void const * p, MPI_Datatype t, int l)
- {
- // allocate enough memory
+ {
+ // allocate enough memory
       int memory_needed;
       BOOST_MPI_CHECK_RESULT(MPI_Pack_size,(l,t,comm,&memory_needed));
 
- int position = buffer_.size();
- buffer_.resize(position + memory_needed);
+ int position = buffer_.size();
+ buffer_.resize(position + memory_needed);
 
- // pack the data into the buffer
- BOOST_MPI_CHECK_RESULT(MPI_Pack,
- (const_cast<void*>(p), l, t, boost::serialization::detail::get_data(buffer_), buffer_.size(), &position, comm));
-
- // reduce the buffer size if needed
- BOOST_ASSERT(std::size_t(position) <= buffer_.size());
- if (std::size_t(position) < buffer_.size())
- buffer_.resize(position);
- }
+ // pack the data into the buffer
+ BOOST_MPI_CHECK_RESULT(MPI_Pack,
+ (const_cast<void*>(p), l, t, boost::serialization::detail::get_data(buffer_), buffer_.size(), &position, comm));
+ // reduce the buffer size if needed
+ BOOST_ASSERT(std::size_t(position) <= buffer_.size());
+ if (std::size_t(position) < buffer_.size())
+ buffer_.resize(position);
+ }
 
   buffer_type& buffer_;
   mutable std::size_t size_;

Modified: branches/release/boost/mpi/packed_iarchive.hpp
==============================================================================
--- branches/release/boost/mpi/packed_iarchive.hpp (original)
+++ branches/release/boost/mpi/packed_iarchive.hpp 2010-10-18 02:22:09 EDT (Mon, 18 Oct 2010)
@@ -118,6 +118,9 @@
     load_override(x, version, use_optimized());
   }
 
+ // input archives need to ignore the optional information
+ void load_override(archive::class_id_optional_type & /*t*/, int){}
+
   void load_override(archive::class_name_type & t, int)
   {
     std::string cn;

Modified: branches/release/boost/mpi/packed_oarchive.hpp
==============================================================================
--- branches/release/boost/mpi/packed_oarchive.hpp (original)
+++ branches/release/boost/mpi/packed_oarchive.hpp 2010-10-18 02:22:09 EDT (Mon, 18 Oct 2010)
@@ -21,6 +21,7 @@
 #include <boost/mpi/datatype.hpp>
 #include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/archive/detail/common_oarchive.hpp>
+#include <boost/archive/shared_ptr_helper.hpp>
 #include <boost/mpi/detail/packed_oprimitive.hpp>
 #include <boost/mpi/detail/binary_buffer_oprimitive.hpp>
 #include <boost/serialization/string.hpp>
@@ -45,8 +46,9 @@
  */
   
 class BOOST_MPI_DECL packed_oarchive
- : public oprimitive,
- public archive::detail::common_oarchive<packed_oarchive>
+ : public oprimitive
+ , public archive::detail::common_oarchive<packed_oarchive>
+ , public archive::detail::shared_ptr_helper
 {
 public:
   /**
@@ -106,6 +108,9 @@
     save_override(x, version, use_optimized());
   }
 
+ // input archives need to ignore the optional information
+ void save_override(const archive::class_id_optional_type & /*t*/, int){}
+
   // explicitly convert to char * to avoid compile ambiguities
   void save_override(const archive::class_name_type & t, int){
       const std::string s(t);

Modified: branches/release/boost/serialization/collection_size_type.hpp
==============================================================================
--- branches/release/boost/serialization/collection_size_type.hpp (original)
+++ branches/release/boost/serialization/collection_size_type.hpp 2010-10-18 02:22:09 EDT (Mon, 18 Oct 2010)
@@ -10,6 +10,7 @@
 #include <boost/serialization/strong_typedef.hpp>
 #include <boost/serialization/level.hpp>
 #include <boost/serialization/split_free.hpp>
+#include <boost/serialization/is_bitwise_serializable.hpp>
 
 namespace boost {
 namespace serialization {
@@ -37,7 +38,7 @@
         return *this;
     }
     // used for text output
- operator const base_type () const {
+ operator base_type () const {
         return t;
     }
     // used for text input
@@ -56,5 +57,6 @@
 } } // end namespace boost::serialization
 
 BOOST_CLASS_IMPLEMENTATION(collection_size_type, primitive_type)
+BOOST_IS_BITWISE_SERIALIZABLE(collection_size_type)
 
 #endif //BOOST_SERIALIZATION_COLLECTION_SIZE_TYPE_HPP

Modified: branches/release/libs/mpi/build/Jamfile.v2
==============================================================================
--- branches/release/libs/mpi/build/Jamfile.v2 (original)
+++ branches/release/libs/mpi/build/Jamfile.v2 2010-10-18 02:22:09 EDT (Mon, 18 Oct 2010)
@@ -117,7 +117,7 @@
         <link>shared:<define>BOOST_MPI_DYN_LINK=1
         <link>shared:<define>BOOST_MPI_PYTHON_DYN_LINK=1
         <link>shared:<define>BOOST_PYTHON_DYN_LINK=1
- <link>shared
+ <link>shared <runtime-link>shared
       ;
   }
 }

Modified: branches/release/libs/mpi/test/Jamfile.v2
==============================================================================
--- branches/release/libs/mpi/test/Jamfile.v2 (original)
+++ branches/release/libs/mpi/test/Jamfile.v2 2010-10-18 02:22:09 EDT (Mon, 18 Oct 2010)
@@ -32,5 +32,6 @@
   # Note: Microsoft MPI fails all skeleton-content tests
   [ mpi-test skeleton_content_test : : : 2 3 4 7 8 13 17 ]
   [ mpi-test graph_topology_test : : : 2 7 13 ]
+ [ mpi-test pointer_test : : : 2 ]
   ;
 }


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