updated boost on windows

This commit is contained in:
Bassem Girgis
2019-08-13 21:48:48 -05:00
parent 7d77d485fd
commit b40a3bee82
5162 changed files with 473027 additions and 116452 deletions

View File

@@ -0,0 +1,40 @@
// 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]); }
// Some old MPI implementation (OpenMPI 1.6 for example) have non
// conforming API w.r.t. constness.
// We choose to fix this trhough this converter in order to
// explain/remember why we're doing this and remove it easilly
// when support for those MPI is dropped.
// The fix is as specific (un templatized, for one) as possible
// in order to encourage it usage for the probleme at hand.
// Problematic API include MPI_Send
inline
void *unconst(void const* addr) { return const_cast<void*>(addr); }
} } }
#endif

View File

@@ -47,7 +47,12 @@ public:
{
return size_ = buffer_.size();
}
const std::size_t* size_ptr() const
{
return &size();
}
void save_binary(void const *address, std::size_t count)
{
save_impl(address,count);

View File

@@ -21,14 +21,15 @@ namespace std{
#include <boost/mpi/datatype_fwd.hpp>
#include <boost/mpi/exception.hpp>
#include <boost/mpi/detail/antiques.hpp>
#include <boost/throw_exception.hpp>
#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 +81,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
@@ -129,6 +130,12 @@ private:
lengths.push_back(l);
}
template <class T>
static T* get_data(std::vector<T>& v)
{
return v.empty() ? 0 : &(v[0]);
}
std::vector<MPI_Aint> addresses;
std::vector<MPI_Datatype> types;
std::vector<int> lengths;

View File

@@ -0,0 +1,47 @@
// 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_OFFSETS_HPP
#define BOOST_MPI_OFFSETS_HPP
#include <vector>
#include <boost/mpi/communicator.hpp>
namespace boost { namespace mpi {
namespace detail {
// Convert a sequence of sizes [S0..Sn] to a sequence displacement
// [O0..On] where O[0] = 0 and O[k+1] = O[k]+S[k].
void sizes2offsets(int const* sizes, int* offsets, int n);
// Same as size2offset(sizes.data(), offsets.data(), sizes.size())
void sizes2offsets(std::vector<int> const& sizes, std::vector<int>& offsets);
// Given a sequence of sizes (typically the number of records dispatched
// to each process in a scater) and a sequence of displacements (typically the
// slot index at with those record starts), convert the later to a number
// of skipped slots.
void offsets2skipped(int const* sizes, int const* offsets, int* skipped, int n);
// Reconstruct offsets from sizes assuming no padding.
// Only takes place if on the root process and if
// displs are not already provided.
// If memory was allocated, returns a pointer to it
// otherwise null.
int* make_offsets(communicator const& comm, int const* sizes, int const* displs, int root = -1);
// Reconstruct skip slots from sizes and offsets.
// Only takes place if on the root process and if
// displs are provided.
// If memory was allocated, returns a pointer to it
// otherwise null.
int* make_skipped_slots(communicator const& comm, int const* sizes, int const* displs, int root = -1);
}
}}// end namespace boost::mpi
#endif // BOOST_MPI_OFFSETS_HPP

View File

@@ -14,10 +14,10 @@
#include <boost/config.hpp>
#include <boost/mpi/datatype.hpp>
#include <boost/mpi/exception.hpp>
#include <boost/assert.hpp>
#include <boost/mpi/detail/antiques.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_;

View File

@@ -12,10 +12,9 @@
#include <boost/mpi/config.hpp>
#include <cstddef> // size_t
#include <boost/config.hpp>
#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>
@@ -47,6 +46,11 @@ public:
return size_ = buffer_.size();
}
const std::size_t* size_ptr() const
{
return &size();
}
void save_binary(void const *address, std::size_t count)
{
save_impl(address,MPI_BYTE,count);
@@ -98,13 +102,21 @@ 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())
buffer_.resize(position);
}
static buffer_type::value_type* get_data(buffer_type& b)
{
return b.empty() ? 0 : &(b[0]);
}
buffer_type& buffer_;
mutable std::size_t size_;
MPI_Comm comm;