diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-09-13 11:24:46 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-09-13 11:25:39 +0900 |
commit | 4fadd968fa12130524c8380f33fcfe25d4de79e5 (patch) | |
tree | fd26a490cd15388d42fc6652b3c5c13012e7f93e /boost/mpi | |
parent | b5c87084afaef42b2d058f68091be31988a6a874 (diff) | |
download | boost-4fadd968fa12130524c8380f33fcfe25d4de79e5.tar.gz boost-4fadd968fa12130524c8380f33fcfe25d4de79e5.tar.bz2 boost-4fadd968fa12130524c8380f33fcfe25d4de79e5.zip |
Imported Upstream version 1.65.0upstream/1.65.0
Change-Id: Icf8400b375482cb11bcf77440a6934ba360d6ba4
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/mpi')
-rw-r--r-- | boost/mpi/detail/antiques.hpp | 29 | ||||
-rw-r--r-- | boost/mpi/detail/mpi_datatype_primitive.hpp | 14 | ||||
-rw-r--r-- | boost/mpi/detail/packed_iprimitive.hpp | 4 | ||||
-rw-r--r-- | boost/mpi/detail/packed_oprimitive.hpp | 7 | ||||
-rw-r--r-- | boost/mpi/python/serialize.hpp | 1 |
5 files changed, 44 insertions, 11 deletions
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 <vector> + +// 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 <typename T, typename A> + T* c_data(std::vector<T,A>& v) { return &(v[0]); } + + template <typename T, typename A> + T const* c_data(std::vector<T,A> 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 <boost/assert.hpp> #include <boost/mpl/placeholders.hpp> #include <boost/serialization/array.hpp> -#include <boost/serialization/detail/get_data.hpp> #include <stdexcept> #include <iostream> #include <vector> +#include <boost/mpi/detail/antiques.hpp> 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 <boost/mpi/exception.hpp> #include <boost/assert.hpp> #include <boost/serialization/array.hpp> -#include <boost/serialization/detail/get_data.hpp> #include <vector> +#include <boost/mpi/detail/antiques.hpp> #include <boost/mpi/allocator.hpp> 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<char*>(boost::serialization::detail::get_data(buffer_)), buffer_.size(), &position, p, l, t, comm)); + (const_cast<char*>(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 <boost/mpi/datatype.hpp> #include <boost/mpi/exception.hpp> -#include <boost/serialization/detail/get_data.hpp> +#include <boost/mpi/detail/antiques.hpp> #include <boost/serialization/array.hpp> #include <boost/assert.hpp> #include <vector> @@ -98,7 +98,10 @@ private: // 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)); + (const_cast<void*>(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 <boost/serialization/split_free.hpp> #include <boost/serialization/array.hpp> +#include <boost/serialization/array_wrapper.hpp> #include <boost/assert.hpp> |