|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r52820 - in trunk: boost/mpi/collectives boost/mpi/detail libs/mpi/src
From: troyer_at_[hidden]
Date: 2009-05-07 01:48:27
Author: troyer
Date: 2009-05-07 01:48:26 EDT (Thu, 07 May 2009)
New Revision: 52820
URL: http://svn.boost.org/trac/boost/changeset/52820
Log:
Fixes for bugs 2586 and 2594
Text files modified:
trunk/boost/mpi/collectives/all_reduce.hpp | 2 +-
trunk/boost/mpi/collectives/reduce.hpp | 4 ++--
trunk/boost/mpi/collectives/scan.hpp | 2 +-
trunk/boost/mpi/detail/mpi_datatype_cache.hpp | 2 ++
trunk/libs/mpi/src/environment.cpp | 2 ++
trunk/libs/mpi/src/mpi_datatype_cache.cpp | 8 +++++++-
6 files changed, 15 insertions(+), 5 deletions(-)
Modified: trunk/boost/mpi/collectives/all_reduce.hpp
==============================================================================
--- trunk/boost/mpi/collectives/all_reduce.hpp (original)
+++ trunk/boost/mpi/collectives/all_reduce.hpp 2009-05-07 01:48:26 EDT (Thu, 07 May 2009)
@@ -33,7 +33,7 @@
BOOST_MPI_CHECK_RESULT(MPI_Allreduce,
(const_cast<T*>(in_values), out_values, n,
boost::mpi::get_mpi_datatype<T>(*in_values),
- is_mpi_op<Op, T>::op(), comm));
+ (is_mpi_op<Op, T>::op()), comm));
}
/**********************************************************************
Modified: trunk/boost/mpi/collectives/reduce.hpp
==============================================================================
--- trunk/boost/mpi/collectives/reduce.hpp (original)
+++ trunk/boost/mpi/collectives/reduce.hpp 2009-05-07 01:48:26 EDT (Thu, 07 May 2009)
@@ -52,7 +52,7 @@
BOOST_MPI_CHECK_RESULT(MPI_Reduce,
(const_cast<T*>(in_values), out_values, n,
boost::mpi::get_mpi_datatype<T>(*in_values),
- is_mpi_op<Op, T>::op(), root, comm));
+ (is_mpi_op<Op, T>::op()), root, comm));
}
// We are reducing to the root for a type that has an associated MPI
@@ -65,7 +65,7 @@
BOOST_MPI_CHECK_RESULT(MPI_Reduce,
(const_cast<T*>(in_values), 0, n,
boost::mpi::get_mpi_datatype<T>(*in_values),
- is_mpi_op<Op, T>::op(), root, comm));
+ (is_mpi_op<Op, T>::op()), root, comm));
}
/**********************************************************************
Modified: trunk/boost/mpi/collectives/scan.hpp
==============================================================================
--- trunk/boost/mpi/collectives/scan.hpp (original)
+++ trunk/boost/mpi/collectives/scan.hpp 2009-05-07 01:48:26 EDT (Thu, 07 May 2009)
@@ -52,7 +52,7 @@
BOOST_MPI_CHECK_RESULT(MPI_Scan,
(const_cast<T*>(in_values), out_values, n,
boost::mpi::get_mpi_datatype<T>(*in_values),
- is_mpi_op<Op, T>::op(), comm));
+ (is_mpi_op<Op, T>::op()), comm));
}
/**********************************************************************
Modified: trunk/boost/mpi/detail/mpi_datatype_cache.hpp
==============================================================================
--- trunk/boost/mpi/detail/mpi_datatype_cache.hpp (original)
+++ trunk/boost/mpi/detail/mpi_datatype_cache.hpp 2009-05-07 01:48:26 EDT (Thu, 07 May 2009)
@@ -79,6 +79,8 @@
return datatype;
}
+
+ void clear();
private:
MPI_Datatype get(const std::type_info* t);
Modified: trunk/libs/mpi/src/environment.cpp
==============================================================================
--- trunk/libs/mpi/src/environment.cpp (original)
+++ trunk/libs/mpi/src/environment.cpp 2009-05-07 01:48:26 EDT (Thu, 07 May 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: trunk/libs/mpi/src/mpi_datatype_cache.cpp
==============================================================================
--- trunk/libs/mpi/src/mpi_datatype_cache.cpp (original)
+++ trunk/libs/mpi/src/mpi_datatype_cache.cpp 2009-05-07 01:48:26 EDT (Thu, 07 May 2009)
@@ -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;
}
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