From 3b8d127b0ccd34cd070b597f4a0f188c2d701b5e Mon Sep 17 00:00:00 2001 From: kronbichler Date: Thu, 26 Jan 2012 08:47:33 +0000 Subject: [PATCH] Include another MPI function that accidentally got lost in merge. git-svn-id: https://svn.dealii.org/trunk@24929 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/configure | 2 +- deal.II/include/deal.II/base/config.h.in | 4 ++- deal.II/include/deal.II/base/mpi.h | 39 ++++++++++++++++++++++-- deal.II/source/base/table_handler.cc | 2 +- 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/deal.II/configure b/deal.II/configure index 83c4903981..7ea06b6a69 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 24746 . +# From configure.in Revision: 24924 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for deal.II 7.2.pre. # diff --git a/deal.II/include/deal.II/base/config.h.in b/deal.II/include/deal.II/base/config.h.in index a7c85a5704..299c749fae 100644 --- a/deal.II/include/deal.II/base/config.h.in +++ b/deal.II/include/deal.II/base/config.h.in @@ -83,7 +83,9 @@ floating point computations on cygwin systems. */ #undef DEAL_II_BROKEN_SOCKETS -/* Defined if the compiler we use supports the upcoming C++1x standard. */ +/* Defined if the compiler we use supports the C++2011 standard well enough to + allow using the standard library classes instead of the corresponding BOOST + classes. */ #undef DEAL_II_CAN_USE_CXX1X /* Backward compatibility support for functions and classes that do not take diff --git a/deal.II/include/deal.II/base/mpi.h b/deal.II/include/deal.II/base/mpi.h index a7190af12b..7bb90ebc9d 100644 --- a/deal.II/include/deal.II/base/mpi.h +++ b/deal.II/include/deal.II/base/mpi.h @@ -182,7 +182,7 @@ namespace Utilities void sum (const std::vector &values, const MPI_Comm &mpi_communicator, std::vector &sums); - + /** * Return the maximum over all processors of the value @p t. This function * is collective over all processors given in the communicator. If @@ -215,6 +215,21 @@ namespace Utilities const MPI_Comm &mpi_communicator, T (&maxima)[N]); + /** + * Like the previous function, + * but take the maximum over the + * elements of a std::vector. In other words, + * the i-th element of the + * results array is the maximum over + * the i-th entries of the input + * arrays from each processor. + */ + template + inline + void max (const std::vector &values, + const MPI_Comm &mpi_communicator, + std::vector &maxima); + /** * Data structure to store the result of * min_max_avg(). @@ -392,7 +407,7 @@ namespace Utilities #endif } - + template inline void sum (const std::vector &values, @@ -410,7 +425,7 @@ namespace Utilities #endif } - + template inline T max (const T &t, @@ -445,6 +460,24 @@ namespace Utilities maxima[i] = values[i]; #endif } + + + template + inline + void max (const std::vector &values, + const MPI_Comm &mpi_communicator, + std::vector &maxima) + { +#ifdef DEAL_II_COMPILER_SUPPORTS_MPI + maxima.resize (values.size()); + MPI_Allreduce (const_cast(static_cast(&values[0])), + &maxima[0], values.size(), internal::mpi_type_id((T*)0), MPI_MAX, + mpi_communicator); +#else + (void)mpi_communicator; + maxima = values; +#endif + } } // end of namespace MPI } // end of namespace Utilities diff --git a/deal.II/source/base/table_handler.cc b/deal.II/source/base/table_handler.cc index 3bb10290f0..1042acbb71 100644 --- a/deal.II/source/base/table_handler.cc +++ b/deal.II/source/base/table_handler.cc @@ -18,7 +18,7 @@ #include #include #include -#include "../../contrib/boost-1.46.1/include/boost/mpl/string.hpp" +#include "boost/mpl/string.hpp" DEAL_II_NAMESPACE_OPEN -- 2.39.5