From 4fadd968fa12130524c8380f33fcfe25d4de79e5 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Wed, 13 Sep 2017 11:24:46 +0900 Subject: Imported Upstream version 1.65.0 Change-Id: Icf8400b375482cb11bcf77440a6934ba360d6ba4 Signed-off-by: DongHun Kwak --- boost/mpi/detail/antiques.hpp | 29 +++++++++++++++++++++++++++++ boost/mpi/detail/mpi_datatype_primitive.hpp | 14 +++++++------- boost/mpi/detail/packed_iprimitive.hpp | 4 ++-- boost/mpi/detail/packed_oprimitive.hpp | 7 +++++-- boost/mpi/python/serialize.hpp | 1 + 5 files changed, 44 insertions(+), 11 deletions(-) create mode 100644 boost/mpi/detail/antiques.hpp (limited to 'boost/mpi') diff --git a/boost/mpi/detail/antiques.hpp b/boost/mpi/detail/antiques.hpp new file mode 100644 index 0000000000..6ece779777 --- /dev/null +++ b/boost/mpi/detail/antiques.hpp @@ -0,0 +1,29 @@ +// Copyright Alain Miniussi 2014. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Authors: Alain Miniussi + +#ifndef BOOST_MPI_ANTIQUES_HPP +#define BOOST_MPI_ANTIQUES_HPP + +#include + +// Support for some obsolette compilers + +namespace boost { namespace mpi { + namespace detail { + // Some old gnu compiler have no support for vector<>::data + // Use this in the mean time, the cumbersome syntax should + // serve as an incentive to get rid of this when those compilers + // are dropped. + template + T* c_data(std::vector& v) { return &(v[0]); } + + template + T const* c_data(std::vector const& v) { return &(v[0]); } + +} } } + +#endif diff --git a/boost/mpi/detail/mpi_datatype_primitive.hpp b/boost/mpi/detail/mpi_datatype_primitive.hpp index c230055ab5..b2263fac4c 100644 --- a/boost/mpi/detail/mpi_datatype_primitive.hpp +++ b/boost/mpi/detail/mpi_datatype_primitive.hpp @@ -25,10 +25,10 @@ namespace std{ #include #include #include -#include #include #include #include +#include namespace boost { namespace mpi { namespace detail { @@ -80,18 +80,18 @@ public: BOOST_MPI_CHECK_RESULT(MPI_Type_create_struct, ( addresses.size(), - boost::serialization::detail::get_data(lengths), - boost::serialization::detail::get_data(addresses), - boost::serialization::detail::get_data(types), + c_data(lengths), + c_data(addresses), + c_data(types), &datatype_ )); #else BOOST_MPI_CHECK_RESULT(MPI_Type_struct, ( addresses.size(), - boost::serialization::detail::get_data(lengths), - boost::serialization::detail::get_data(addresses), - boost::serialization::detail::get_data(types), + c_data(lengths), + c_data(addresses), + c_data(types), &datatype_ )); #endif diff --git a/boost/mpi/detail/packed_iprimitive.hpp b/boost/mpi/detail/packed_iprimitive.hpp index 7080cbf53b..69d2c73a2b 100644 --- a/boost/mpi/detail/packed_iprimitive.hpp +++ b/boost/mpi/detail/packed_iprimitive.hpp @@ -16,8 +16,8 @@ #include #include #include -#include #include +#include #include namespace boost { namespace mpi { @@ -104,7 +104,7 @@ private: void load_impl(void * p, MPI_Datatype t, int l) { BOOST_MPI_CHECK_RESULT(MPI_Unpack, - (const_cast(boost::serialization::detail::get_data(buffer_)), buffer_.size(), &position, p, l, t, comm)); + (const_cast(detail::c_data(buffer_)), buffer_.size(), &position, p, l, t, comm)); } buffer_type & buffer_; diff --git a/boost/mpi/detail/packed_oprimitive.hpp b/boost/mpi/detail/packed_oprimitive.hpp index 5b6b3b2708..1cb4ba0c26 100644 --- a/boost/mpi/detail/packed_oprimitive.hpp +++ b/boost/mpi/detail/packed_oprimitive.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -98,7 +98,10 @@ private: // pack the data into the buffer BOOST_MPI_CHECK_RESULT(MPI_Pack, - (const_cast(p), l, t, boost::serialization::detail::get_data(buffer_), buffer_.size(), &position, comm)); + (const_cast(p),l,t, + detail::c_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()) diff --git a/boost/mpi/python/serialize.hpp b/boost/mpi/python/serialize.hpp index 5f9136bd5a..8933b3405f 100644 --- a/boost/mpi/python/serialize.hpp +++ b/boost/mpi/python/serialize.hpp @@ -36,6 +36,7 @@ #include #include +#include #include -- cgit v1.2.3