* of @p t. This function corresponds to the <code>MPI_Allreduce</code>
* function, i.e. all processors receive the result of this operation.
*
- * @note Sometimes, not all processors need a results and in that case one
+ * @note Sometimes, not all processors need a result and in that case one
* would call the <code>MPI_Reduce</code> function instead of the
* <code>MPI_Allreduce</code> function. The latter is at most twice as
* expensive, so if you are concerned about performance, it may be
* worthwhile investigating whether your algorithm indeed needs the result
- * everywhere or whether you could get away with calling the current
- * function and getting the result everywhere.
+ * everywhere.
*
* @note This function is only implemented for certain template arguments
* <code>T</code>, namely <code>float, double, int, unsigned int</code>.
* <code>MPI_Allreduce</code> function, i.e. all processors receive the
* result of this operation.
*
- * @note Sometimes, not all processors need a results and in that case one
+ * @note Sometimes, not all processors need a result and in that case one
* would call the <code>MPI_Reduce</code> function instead of the
* <code>MPI_Allreduce</code> function. The latter is at most twice as
* expensive, so if you are concerned about performance, it may be
* worthwhile investigating whether your algorithm indeed needs the result
- * everywhere or whether you could get away with calling the current
- * function and getting the result everywhere.
+ * everywhere.
*
* @note This function is only implemented for certain template arguments
* <code>T</code>, namely <code>float, double, int, unsigned int</code>.
* <code>MPI_Allreduce</code> function, i.e. all processors receive the
* result of this operation.
*
- * @note Sometimes, not all processors need a results and in that case one
+ * @note Sometimes, not all processors need a result and in that case one
* would call the <code>MPI_Reduce</code> function instead of the
* <code>MPI_Allreduce</code> function. The latter is at most twice as
* expensive, so if you are concerned about performance, it may be
* worthwhile investigating whether your algorithm indeed needs the result
- * everywhere or whether you could get away with calling the current
- * function and getting the result everywhere.
+ * everywhere.
*
* @note This function is only implemented for certain template arguments
* <code>T</code>, namely <code>float, double, int, unsigned int</code>.
* mpi_communicator . Each processor's value is given in @p my_value and
* the result will be returned. The result is available on all machines.
*
- * @note Sometimes, not all processors need a results and in that case one
+ * @note Sometimes, not all processors need a result and in that case one
* would call the <code>MPI_Reduce</code> function instead of the
* <code>MPI_Allreduce</code> function. The latter is at most twice as
* expensive, so if you are concerned about performance, it may be
* worthwhile investigating whether your algorithm indeed needs the result
- * everywhere or whether you could get away with calling the current
- * function and getting the result everywhere.
+ * everywhere.
*/
MinMaxAvg
min_max_avg (const double my_value,
template <typename T>
inline
- T op (const MPI_Op &mpi_op,
- const T &t,
- const MPI_Comm &mpi_communicator)
+ T all_reduce (const MPI_Op &mpi_op,
+ const T &t,
+ const MPI_Comm &mpi_communicator)
{
#ifdef DEAL_II_WITH_MPI
if (job_supports_mpi())
template <typename T, unsigned int N>
inline
- void op (const MPI_Op &mpi_op,
- const T (&values)[N],
- const MPI_Comm &mpi_communicator,
- T (&output)[N])
+ void all_reduce (const MPI_Op &mpi_op,
+ const T (&values)[N],
+ const MPI_Comm &mpi_communicator,
+ T (&output)[N])
{
#ifdef DEAL_II_WITH_MPI
if (job_supports_mpi())
template <typename T>
inline
- void op (const MPI_Op &mpi_op,
- const std::vector<T> &values,
- const MPI_Comm &mpi_communicator,
- std::vector<T> &output)
+ void all_reduce (const MPI_Op &mpi_op,
+ const std::vector<T> &values,
+ const MPI_Comm &mpi_communicator,
+ std::vector<T> &output)
{
#ifdef DEAL_II_WITH_MPI
if (job_supports_mpi())
T sum (const T &t,
const MPI_Comm &mpi_communicator)
{
- return internal::op(MPI_SUM, t, mpi_communicator);
+ return internal::all_reduce(MPI_SUM, t, mpi_communicator);
}
const MPI_Comm &mpi_communicator,
T (&sums)[N])
{
- internal::op(MPI_SUM, values, mpi_communicator, sums);
+ internal::all_reduce(MPI_SUM, values, mpi_communicator, sums);
}
const MPI_Comm &mpi_communicator,
std::vector<T> &sums)
{
- internal::op(MPI_SUM, values, mpi_communicator, sums);
+ internal::all_reduce(MPI_SUM, values, mpi_communicator, sums);
}
template <int rank, int dim, typename Number>
T max (const T &t,
const MPI_Comm &mpi_communicator)
{
- return internal::op(MPI_MAX, t, mpi_communicator);
+ return internal::all_reduce(MPI_MAX, t, mpi_communicator);
}
const MPI_Comm &mpi_communicator,
T (&maxima)[N])
{
- internal::op(MPI_MAX, values, mpi_communicator, maxima);
+ internal::all_reduce(MPI_MAX, values, mpi_communicator, maxima);
}
const MPI_Comm &mpi_communicator,
std::vector<T> &maxima)
{
- internal::op(MPI_MAX, values, mpi_communicator, maxima);
+ internal::all_reduce(MPI_MAX, values, mpi_communicator, maxima);
}
T min (const T &t,
const MPI_Comm &mpi_communicator)
{
- return internal::op(MPI_MIN, t, mpi_communicator);
+ return internal::all_reduce(MPI_MIN, t, mpi_communicator);
}
const MPI_Comm &mpi_communicator,
T (&minima)[N])
{
- internal::op(MPI_MIN, values, mpi_communicator, minima);
+ internal::all_reduce(MPI_MIN, values, mpi_communicator, minima);
}
const MPI_Comm &mpi_communicator,
std::vector<T> &minima)
{
- internal::op(MPI_MIN, values, mpi_communicator, minima);
+ internal::all_reduce(MPI_MIN, values, mpi_communicator, minima);
}