|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r82524 - in trunk/boost/mpi: . detail
From: troyer_at_[hidden]
Date: 2013-01-17 10:25:51
Author: troyer
Date: 2013-01-17 10:25:50 EST (Thu, 17 Jan 2013)
New Revision: 82524
URL: http://svn.boost.org/trac/boost/changeset/82524
Log:
Several minor bug fixes and updates
Text files modified:
trunk/boost/mpi/config.hpp | 7 ++++++-
trunk/boost/mpi/detail/ignore_iprimitive.hpp | 2 +-
trunk/boost/mpi/detail/ignore_oprimitive.hpp | 2 +-
trunk/boost/mpi/detail/mpi_datatype_primitive.hpp | 27 ++++++++++++++++++++++-----
trunk/boost/mpi/detail/packed_iprimitive.hpp | 4 +++-
trunk/boost/mpi/detail/packed_oprimitive.hpp | 3 ++-
6 files changed, 35 insertions(+), 10 deletions(-)
Modified: trunk/boost/mpi/config.hpp
==============================================================================
--- trunk/boost/mpi/config.hpp (original)
+++ trunk/boost/mpi/config.hpp 2013-01-17 10:25:50 EST (Thu, 17 Jan 2013)
@@ -27,7 +27,7 @@
// If this is an MPI-2 implementation, define configuration macros for
// the features we are interested in.
-#if defined(MPI_VERSION) && MPI_VERSION == 2
+#if defined(MPI_VERSION) && MPI_VERSION >= 2
/** @brief Determine if the MPI implementation has support for memory
* allocation.
*
@@ -48,6 +48,11 @@
* environment class will provide a default constructor. This macro is
* always defined for MPI-2 implementations. */
# define BOOST_MPI_HAS_NOARG_INITIALIZATION
+#else
+// If this is an MPI-1.x implementation, no arg initialization for
+// mpi environement could still be available, but not mandatory.
+// Undef this if no arg init is available:
+//# define BOOST_MPI_HAS_NOARG_INITIALIZATION
#endif
#if defined(MPIAPI)
Modified: trunk/boost/mpi/detail/ignore_iprimitive.hpp
==============================================================================
--- trunk/boost/mpi/detail/ignore_iprimitive.hpp (original)
+++ trunk/boost/mpi/detail/ignore_iprimitive.hpp 2013-01-17 10:25:50 EST (Thu, 17 Jan 2013)
@@ -44,7 +44,7 @@
/// don't do anything when loading primitive types
template<class T>
- void load(T & t)
+ void load(T &)
{
}
};
Modified: trunk/boost/mpi/detail/ignore_oprimitive.hpp
==============================================================================
--- trunk/boost/mpi/detail/ignore_oprimitive.hpp (original)
+++ trunk/boost/mpi/detail/ignore_oprimitive.hpp 2013-01-17 10:25:50 EST (Thu, 17 Jan 2013)
@@ -52,7 +52,7 @@
/// don't do anything when saving primitive types
template<class T>
- void save(const T & t)
+ void save(const T &)
{
}
};
Modified: trunk/boost/mpi/detail/mpi_datatype_primitive.hpp
==============================================================================
--- trunk/boost/mpi/detail/mpi_datatype_primitive.hpp (original)
+++ trunk/boost/mpi/detail/mpi_datatype_primitive.hpp 2013-01-17 10:25:50 EST (Thu, 17 Jan 2013)
@@ -49,7 +49,11 @@
: is_committed(false),
origin()
{
+#if defined(MPI_VERSION) && MPI_VERSION >= 2
+ BOOST_MPI_CHECK_RESULT(MPI_Get_address,(const_cast<void*>(orig), &origin));
+#else
BOOST_MPI_CHECK_RESULT(MPI_Address,(const_cast<void*>(orig), &origin));
+#endif
}
void save_binary(void const *address, std::size_t count)
@@ -72,7 +76,8 @@
{
if (!is_committed)
{
- BOOST_MPI_CHECK_RESULT(MPI_Type_struct,
+#if defined(MPI_VERSION) && MPI_VERSION >= 2
+ BOOST_MPI_CHECK_RESULT(MPI_Type_create_struct,
(
addresses.size(),
boost::serialization::detail::get_data(lengths),
@@ -80,9 +85,18 @@
boost::serialization::detail::get_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),
+ &datatype_
+ ));
+#endif
BOOST_MPI_CHECK_RESULT(MPI_Type_commit,(&datatype_));
-
+
is_committed = true;
}
@@ -105,8 +119,11 @@
// store address, type and length
MPI_Aint a;
- BOOST_MPI_CHECK_RESULT(MPI_Address,(const_cast<void*>(p), &a));
-
+#if defined(MPI_VERSION) && MPI_VERSION >= 2
+ BOOST_MPI_CHECK_RESULT(MPI_Get_address,(const_cast<void*>(p), &a));
+#else
+ BOOST_MPI_CHECK_RESULT(MPI_Address,(const_cast<void*>(p), &a));
+#endif
addresses.push_back(a-origin);
types.push_back(t);
lengths.push_back(l);
Modified: trunk/boost/mpi/detail/packed_iprimitive.hpp
==============================================================================
--- trunk/boost/mpi/detail/packed_iprimitive.hpp (original)
+++ trunk/boost/mpi/detail/packed_iprimitive.hpp 2013-01-17 10:25:50 EST (Thu, 17 Jan 2013)
@@ -94,7 +94,9 @@
load(l);
s.resize(l);
// note breaking a rule here - could be a problem on some platform
- load_impl(const_cast<CharType *>(s.data()),get_mpi_datatype(CharType()),l);
+ if (l)
+ load_impl(const_cast<CharType *>(s.data()),
+ get_mpi_datatype(CharType()),l);
}
private:
Modified: trunk/boost/mpi/detail/packed_oprimitive.hpp
==============================================================================
--- trunk/boost/mpi/detail/packed_oprimitive.hpp (original)
+++ trunk/boost/mpi/detail/packed_oprimitive.hpp 2013-01-17 10:25:50 EST (Thu, 17 Jan 2013)
@@ -81,7 +81,8 @@
{
unsigned int l = static_cast<unsigned int>(s.size());
save(l);
- save_impl(s.data(),get_mpi_datatype(CharType()),s.size());
+ if (l)
+ save_impl(s.data(),get_mpi_datatype(CharType()),s.size());
}
private:
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