Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55433 - in branches/release: boost/mpi boost/mpi/detail libs/mpi/build libs/mpi/doc libs/mpi/src libs/mpi/test
From: troyer_at_[hidden]
Date: 2009-08-06 15:04:57


Author: troyer
Date: 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
New Revision: 55433
URL: http://svn.boost.org/trac/boost/changeset/55433

Log:
Moved Boost.MPI from trunk to release to make it compile with Boost.Serialization on the release branch
Text files modified:
   branches/release/boost/mpi/detail/content_oarchive.hpp | 1 +
   branches/release/boost/mpi/detail/mpi_datatype_cache.hpp | 2 ++
   branches/release/boost/mpi/detail/mpi_datatype_oarchive.hpp | 31 ++++++++++++++++++++++++++++++-
   branches/release/boost/mpi/detail/text_skeleton_oarchive.hpp | 1 +
   branches/release/boost/mpi/graph_communicator.hpp | 2 +-
   branches/release/boost/mpi/skeleton_and_content.hpp | 1 +
   branches/release/libs/mpi/build/Jamfile.v2 | 3 +--
   branches/release/libs/mpi/doc/mpi.qbk | 6 +++++-
   branches/release/libs/mpi/src/content_oarchive.cpp | 9 +++++----
   branches/release/libs/mpi/src/environment.cpp | 2 ++
   branches/release/libs/mpi/src/mpi_datatype_cache.cpp | 10 ++++++++--
   branches/release/libs/mpi/src/mpi_datatype_oarchive.cpp | 5 +++--
   branches/release/libs/mpi/src/packed_iarchive.cpp | 7 +++----
   branches/release/libs/mpi/src/packed_oarchive.cpp | 6 +++---
   branches/release/libs/mpi/src/packed_skeleton_iarchive.cpp | 9 ++++++---
   branches/release/libs/mpi/src/packed_skeleton_oarchive.cpp | 7 ++++---
   branches/release/libs/mpi/src/text_skeleton_oarchive.cpp | 5 +++--
   branches/release/libs/mpi/test/ring_test.cpp | 5 +++++
   18 files changed, 84 insertions(+), 28 deletions(-)

Modified: branches/release/boost/mpi/detail/content_oarchive.hpp
==============================================================================
--- branches/release/boost/mpi/detail/content_oarchive.hpp (original)
+++ branches/release/boost/mpi/detail/content_oarchive.hpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -14,6 +14,7 @@
 #include <boost/mpi/detail/ignore_skeleton_oarchive.hpp>
 #include <boost/mpi/detail/mpi_datatype_primitive.hpp>
 #include <boost/mpi/datatype.hpp>
+#include <boost/archive/detail/register_archive.hpp>
 
 namespace boost { namespace mpi {
 

Modified: branches/release/boost/mpi/detail/mpi_datatype_cache.hpp
==============================================================================
--- branches/release/boost/mpi/detail/mpi_datatype_cache.hpp (original)
+++ branches/release/boost/mpi/detail/mpi_datatype_cache.hpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -79,6 +79,8 @@
 
     return datatype;
   }
+
+ void clear();
 
 private:
   MPI_Datatype get(const std::type_info* t);

Modified: branches/release/boost/mpi/detail/mpi_datatype_oarchive.hpp
==============================================================================
--- branches/release/boost/mpi/detail/mpi_datatype_oarchive.hpp (original)
+++ branches/release/boost/mpi/detail/mpi_datatype_oarchive.hpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -9,6 +9,8 @@
 #ifndef BOOST_MPI_DETAIL_MPI_DATATYPE_OARCHIVE_HPP
 #define BOOST_MPI_DETAIL_MPI_DATATYPE_OARCHIVE_HPP
 
+#include <boost/type_traits/is_enum.hpp>
+#include <boost/mpl/bool.hpp>
 #include <boost/archive/detail/oserializer.hpp>
 #include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/archive/basic_archive.hpp>
@@ -16,6 +18,8 @@
 #include <boost/mpi/detail/mpi_datatype_primitive.hpp>
 #include <boost/mpi/datatype_fwd.hpp>
 #include <boost/mpl/assert.hpp>
+#include <boost/integer.hpp>
+#include <boost/archive/detail/register_archive.hpp>
 
 namespace boost { namespace mpi { namespace detail {
 
@@ -33,9 +37,34 @@
     mpi_datatype_oarchive(const T& x)
          : mpi_datatype_primitive(&x) // register address
         {
- BOOST_MPL_ASSERT((is_mpi_datatype<T>));
+ BOOST_MPL_ASSERT((is_mpi_datatype<T>));
           *this << x; // serialize the object
         }
+
+ // intermediate level to support override of operators
+ // for templates in the absence of partial function
+ // template ordering
+ template<class T>
+ void save_override(T const& t, BOOST_PFTO int)
+ {
+ save_enum(t,boost::is_enum<T>());
+ }
+
+ template<class T>
+ void save_enum(T const& t, mpl::false_)
+ {
+ ignore_skeleton_oarchive<mpi_datatype_oarchive>::save_override(t, 0);
+ }
+
+ template<class T>
+ void save_enum(T const& t, mpl::true_)
+ {
+ // select the right sized integer for the enum
+ typedef typename boost::uint_t<8*sizeof(T)>::least int_type;
+ BOOST_MPL_ASSERT((sizeof(T)==sizeof(int_type)));
+ this->save(*reinterpret_cast<int_type const*>(&t));
+ }
+
 };
 
 } } } // end namespace boost::mpi::detail

Modified: branches/release/boost/mpi/detail/text_skeleton_oarchive.hpp
==============================================================================
--- branches/release/boost/mpi/detail/text_skeleton_oarchive.hpp (original)
+++ branches/release/boost/mpi/detail/text_skeleton_oarchive.hpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -13,6 +13,7 @@
 #include <boost/archive/text_oarchive.hpp>
 #include <boost/mpi/detail/forward_skeleton_oarchive.hpp>
 #include <boost/mpi/detail/ignore_oprimitive.hpp>
+#include <boost/archive/detail/register_archive.hpp>
 
 namespace boost { namespace mpi {
 

Modified: branches/release/boost/mpi/graph_communicator.hpp
==============================================================================
--- branches/release/boost/mpi/graph_communicator.hpp (original)
+++ branches/release/boost/mpi/graph_communicator.hpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -28,7 +28,7 @@
 // Headers required to implement graph topologies
 #include <boost/graph/graph_traits.hpp>
 #include <boost/graph/properties.hpp>
-#include <boost/property_map.hpp>
+#include <boost/property_map/property_map.hpp>
 #include <boost/iterator/counting_iterator.hpp>
 #include <boost/graph/iteration_macros.hpp>
 #include <boost/shared_array.hpp>

Modified: branches/release/boost/mpi/skeleton_and_content.hpp
==============================================================================
--- branches/release/boost/mpi/skeleton_and_content.hpp (original)
+++ branches/release/boost/mpi/skeleton_and_content.hpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -32,6 +32,7 @@
 #include <boost/mpi/detail/ignore_iprimitive.hpp>
 #include <boost/mpi/detail/ignore_oprimitive.hpp>
 #include <boost/shared_ptr.hpp>
+#include <boost/archive/detail/register_archive.hpp>
 
 namespace boost { namespace mpi {
 

Modified: branches/release/libs/mpi/build/Jamfile.v2
==============================================================================
--- branches/release/libs/mpi/build/Jamfile.v2 (original)
+++ branches/release/libs/mpi/build/Jamfile.v2 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -98,7 +98,6 @@
         <link>shared:<define>BOOST_MPI_PYTHON_DYN_LINK=1
         <link>shared:<define>BOOST_PYTHON_DYN_LINK=1
         <link>shared
- <variant>release
       ;
   }
 }
@@ -112,4 +111,4 @@
       ;
 }
 
-boost-install $(libraries) ;
\ No newline at end of file
+boost-install $(libraries) ;

Modified: branches/release/libs/mpi/doc/mpi.qbk
==============================================================================
--- branches/release/libs/mpi/doc/mpi.qbk (original)
+++ branches/release/libs/mpi/doc/mpi.qbk 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -349,6 +349,7 @@
 
   #include <boost/mpi.hpp>
   #include <iostream>
+ #include <string>
   #include <boost/serialization/string.hpp>
   namespace mpi = boost::mpi;
 
@@ -420,6 +421,7 @@
 
   #include <boost/mpi.hpp>
   #include <iostream>
+ #include <string>
   #include <boost/serialization/string.hpp>
   namespace mpi = boost::mpi;
 
@@ -604,6 +606,7 @@
 
   #include <boost/mpi.hpp>
   #include <iostream>
+ #include <string>
   #include <boost/serialization/string.hpp>
   namespace mpi = boost::mpi;
 
@@ -651,6 +654,7 @@
 
   #include <boost/mpi.hpp>
   #include <iostream>
+ #include <vector>
   #include <cstdlib>
   namespace mpi = boost::mpi;
 
@@ -744,6 +748,7 @@
   #include <boost/mpi.hpp>
   #include <iostream>
   #include <string>
+ #include <functional>
   #include <boost/serialization/string.hpp>
   namespace mpi = boost::mpi;
 
@@ -2008,7 +2013,6 @@
 
 * *Boost 1.36.0*:
   * Support for non-blocking operations in Python, from Andreas Klöckner
- * Support for graph topologies.
 
 * *Boost 1.35.0*: Initial release, containing the following post-review changes
   * Support for arrays in all collective operations

Modified: branches/release/libs/mpi/src/content_oarchive.cpp
==============================================================================
--- branches/release/libs/mpi/src/content_oarchive.cpp (original)
+++ branches/release/libs/mpi/src/content_oarchive.cpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -7,13 +7,14 @@
 // Authors: Matthias Troyer
 
 #define BOOST_ARCHIVE_SOURCE
-#include <boost/archive/impl/archive_pointer_oserializer.ipp>
+#include <boost/archive/detail/archive_serializer_map.hpp>
+#include <boost/archive/impl/archive_serializer_map.ipp>
 #include <boost/mpi/skeleton_and_content.hpp>
 
 namespace boost { namespace archive { namespace detail {
 // explicitly instantiate all required template functions
 
-template class archive_pointer_oserializer<mpi::detail::content_oarchive> ;
-template class archive_pointer_oserializer<boost::mpi::detail::ignore_skeleton_oarchive<boost::mpi::detail::content_oarchive> >;
-template class archive_pointer_oserializer<boost::mpi::detail::ignore_skeleton_oarchive<boost::mpi::detail::mpi_datatype_oarchive> >;
+template class archive_serializer_map<mpi::detail::content_oarchive> ;
+template class archive_serializer_map<boost::mpi::detail::ignore_skeleton_oarchive<boost::mpi::detail::content_oarchive> >;
+template class archive_serializer_map<boost::mpi::detail::ignore_skeleton_oarchive<boost::mpi::detail::mpi_datatype_oarchive> >;
 } } }

Modified: branches/release/libs/mpi/src/environment.cpp
==============================================================================
--- branches/release/libs/mpi/src/environment.cpp (original)
+++ branches/release/libs/mpi/src/environment.cpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -7,6 +7,7 @@
 // Message Passing Interface 1.1 -- 7.1.1. Environmental Inquiries
 #include <boost/mpi/environment.hpp>
 #include <boost/mpi/exception.hpp>
+#include <boost/mpi/detail/mpi_datatype_cache.hpp>
 #include <cassert>
 #include <exception>
 #include <stdexcept>
@@ -45,6 +46,7 @@
     if (std::uncaught_exception() && abort_on_exception) {
       abort(-1);
     } else if (!finalized()) {
+ detail::mpi_datatype_cache().clear();
       BOOST_MPI_CHECK_RESULT(MPI_Finalize, ());
     }
   }

Modified: branches/release/libs/mpi/src/mpi_datatype_cache.cpp
==============================================================================
--- branches/release/libs/mpi/src/mpi_datatype_cache.cpp (original)
+++ branches/release/libs/mpi/src/mpi_datatype_cache.cpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -6,7 +6,7 @@
 
 // Authors: Matthias Troyer
 
-#include <boost/archive/impl/archive_pointer_oserializer.ipp>
+#include <boost/archive/detail/archive_serializer_map.hpp>
 #include <boost/mpi/detail/mpi_datatype_cache.hpp>
 #include <map>
 
@@ -25,7 +25,7 @@
       impl = new implementation();
   }
 
- mpi_datatype_map::~mpi_datatype_map()
+ void mpi_datatype_map::clear()
   {
     // do not free after call to MPI_FInalize
     int finalized=0;
@@ -35,6 +35,12 @@
       for (stored_map_type::iterator it=impl->map.begin(); it != impl->map.end(); ++it)
         MPI_Type_free(&(it->second));
     }
+ }
+
+
+ mpi_datatype_map::~mpi_datatype_map()
+ {
+ clear();
     delete impl;
   }
 

Modified: branches/release/libs/mpi/src/mpi_datatype_oarchive.cpp
==============================================================================
--- branches/release/libs/mpi/src/mpi_datatype_oarchive.cpp (original)
+++ branches/release/libs/mpi/src/mpi_datatype_oarchive.cpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -7,12 +7,13 @@
 // Authors: Matthias Troyer
 
 #define BOOST_ARCHIVE_SOURCE
-#include <boost/archive/impl/archive_pointer_oserializer.ipp>
+#include <boost/archive/detail/archive_serializer_map.hpp>
+#include <boost/archive/impl/archive_serializer_map.ipp>
 #include <boost/mpi/detail/mpi_datatype_oarchive.hpp>
 
 namespace boost { namespace archive { namespace detail {
 // explicitly instantiate all required template functions
 
-template class archive_pointer_oserializer<mpi::detail::mpi_datatype_oarchive> ;
+template class archive_serializer_map<mpi::detail::mpi_datatype_oarchive> ;
 
 } } }

Modified: branches/release/libs/mpi/src/packed_iarchive.cpp
==============================================================================
--- branches/release/libs/mpi/src/packed_iarchive.cpp (original)
+++ branches/release/libs/mpi/src/packed_iarchive.cpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -7,10 +7,10 @@
 // Authors: Matthias Troyer
 
 #define BOOST_ARCHIVE_SOURCE
-#include <boost/archive/impl/archive_pointer_iserializer.ipp>
-#include <boost/archive/impl/archive_pointer_oserializer.ipp>
 #include <boost/mpi/packed_iarchive.hpp>
 
+#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>
@@ -20,7 +20,6 @@
 // explicitly instantiate all required templates
 
 template class basic_binary_iarchive<mpi::packed_iarchive> ;
-template class detail::archive_pointer_iserializer<mpi::packed_iarchive> ;
-//template class binary_iarchive_impl<mpi_packed_iarchive> ;
+template class detail::archive_serializer_map<mpi::packed_iarchive> ;
 
 } } // end namespace boost::archive

Modified: branches/release/libs/mpi/src/packed_oarchive.cpp
==============================================================================
--- branches/release/libs/mpi/src/packed_oarchive.cpp (original)
+++ branches/release/libs/mpi/src/packed_oarchive.cpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -9,16 +9,16 @@
 #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>
-#include <boost/archive/impl/archive_pointer_oserializer.ipp>
 
 namespace boost { namespace archive {
 // explicitly instantiate all required templates
 
-template class detail::archive_pointer_oserializer<mpi::packed_oarchive> ;
+template class detail::archive_serializer_map<mpi::packed_oarchive> ;
 template class basic_binary_oarchive<mpi::packed_oarchive> ;
-//template class binary_oarchive_impl<mpi_packed_oarchive> ;
 
 } } // end namespace boost::archive

Modified: branches/release/libs/mpi/src/packed_skeleton_iarchive.cpp
==============================================================================
--- branches/release/libs/mpi/src/packed_skeleton_iarchive.cpp (original)
+++ branches/release/libs/mpi/src/packed_skeleton_iarchive.cpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -7,7 +7,10 @@
 // Authors: Matthias Troyer
 
 #define BOOST_ARCHIVE_SOURCE
-#include <boost/archive/impl/archive_pointer_iserializer.ipp>
+
+#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>
@@ -19,8 +22,8 @@
 // explicitly instantiate all required templates
 
 template class basic_binary_iarchive<mpi::packed_skeleton_iarchive> ;
-template class detail::archive_pointer_iserializer<mpi::packed_skeleton_iarchive> ;
-template class detail::archive_pointer_iserializer<
+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> ;

Modified: branches/release/libs/mpi/src/packed_skeleton_oarchive.cpp
==============================================================================
--- branches/release/libs/mpi/src/packed_skeleton_oarchive.cpp (original)
+++ branches/release/libs/mpi/src/packed_skeleton_oarchive.cpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -9,16 +9,17 @@
 #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>
-#include <boost/archive/impl/archive_pointer_oserializer.ipp>
 
 namespace boost { namespace archive {
 // explicitly instantiate all required templates
 
-template class detail::archive_pointer_oserializer<mpi::packed_skeleton_oarchive> ;
-template class detail::archive_pointer_oserializer<
+template class detail::archive_serializer_map<mpi::packed_skeleton_oarchive> ;
+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> ;

Modified: branches/release/libs/mpi/src/text_skeleton_oarchive.cpp
==============================================================================
--- branches/release/libs/mpi/src/text_skeleton_oarchive.cpp (original)
+++ branches/release/libs/mpi/src/text_skeleton_oarchive.cpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -9,14 +9,15 @@
 #define BOOST_ARCHIVE_SOURCE
 #include <boost/mpi/detail/text_skeleton_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>
-#include <boost/archive/impl/archive_pointer_oserializer.ipp>
 
 namespace boost { namespace archive {
 // explicitly instantiate all required templates
 
-template class detail::archive_pointer_oserializer<mpi::text_skeleton_oarchive> ;
+template class detail::archive_serializer_map<text_oarchive>;
 
 } } // end namespace boost::archive

Modified: branches/release/libs/mpi/test/ring_test.cpp
==============================================================================
--- branches/release/libs/mpi/test/ring_test.cpp (original)
+++ branches/release/libs/mpi/test/ring_test.cpp 2009-08-06 15:04:54 EDT (Thu, 06 Aug 2009)
@@ -81,6 +81,9 @@
   delete [] transferred_values;
 }
 
+enum color_t {red, green, blue};
+BOOST_IS_MPI_DATATYPE(color_t)
+
 int test_main(int argc, char* argv[])
 {
   boost::mpi::environment env(argc, argv);
@@ -95,6 +98,8 @@
   // Check transfer of individual objects
   ring_test(comm, 17, "integers", 0);
   ring_test(comm, 17, "integers", 1);
+ ring_test(comm, red, "enums", 1);
+ ring_test(comm, red, "enums", 1);
   ring_test(comm, gps_position(39,16,20.2799), "GPS positions", 0);
   ring_test(comm, gps_position(26,25,30.0), "GPS positions", 1);
   ring_test(comm, std::string("Rosie"), "string", 0);


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