19 #include <deal.II/base/config.h> 23 #if !defined(DEAL_II_WITH_MPI) && !defined(DEAL_II_WITH_PETSC) 28 const int MPI_COMM_SELF = 0;
29 typedef int MPI_Datatype;
32 static const int MPI_MIN = 0;
33 static const int MPI_MAX = 0;
34 static const int MPI_SUM = 0;
37 DEAL_II_NAMESPACE_OPEN
41 template <
int rank,
int dim,
typename Number>
class Tensor;
45 template <
typename Number>
class Vector;
97 std::vector<unsigned int>
99 const std::vector<unsigned int> &destinations);
135 template <
typename T>
137 const MPI_Comm &mpi_communicator);
147 template <
typename T,
unsigned int N>
148 void sum (
const T (&values)[N],
149 const MPI_Comm &mpi_communicator,
159 template <
typename T>
160 void sum (
const std::vector<T> &values,
161 const MPI_Comm &mpi_communicator,
162 std::vector<T> &sums);
170 template <
typename T>
172 const MPI_Comm &mpi_communicator,
181 template <
int rank,
int dim,
typename Number>
184 const MPI_Comm &mpi_communicator);
191 template <
int rank,
int dim,
typename Number>
194 const MPI_Comm &mpi_communicator);
215 template <
typename T>
217 const MPI_Comm &mpi_communicator);
227 template <
typename T,
unsigned int N>
228 void max (
const T (&values)[N],
229 const MPI_Comm &mpi_communicator,
240 template <
typename T>
241 void max (
const std::vector<T> &values,
242 const MPI_Comm &mpi_communicator,
243 std::vector<T> &maxima);
264 template <
typename T>
266 const MPI_Comm &mpi_communicator);
276 template <
typename T,
unsigned int N>
277 void min (
const T (&values)[N],
278 const MPI_Comm &mpi_communicator,
289 template <
typename T>
290 void min (
const std::vector<T> &values,
291 const MPI_Comm &mpi_communicator,
292 std::vector<T> &minima);
305 unsigned int min_index;
306 unsigned int max_index;
326 const MPI_Comm &mpi_communicator);
428 template <
typename T>
429 void all_reduce (
const MPI_Op &mpi_op,
430 const T *
const values,
431 const MPI_Comm &mpi_communicator,
433 const std::size_t size);
437 template <
typename T,
unsigned int N>
438 void sum (
const T (&values)[N],
439 const MPI_Comm &mpi_communicator,
442 internal::all_reduce(MPI_SUM, values, mpi_communicator, sums, N);
445 template <
typename T,
unsigned int N>
446 void max (
const T (&values)[N],
447 const MPI_Comm &mpi_communicator,
450 internal::all_reduce(MPI_MAX, values, mpi_communicator, maxima, N);
453 template <
typename T,
unsigned int N>
454 void min (
const T (&values)[N],
455 const MPI_Comm &mpi_communicator,
458 internal::all_reduce(MPI_MIN, values, mpi_communicator, minima, N);
465 DEAL_II_NAMESPACE_CLOSE
static const unsigned int invalid_unsigned_int
MPI_InitFinalize(int &argc, char **&argv, const unsigned int max_num_threads=numbers::invalid_unsigned_int)
T sum(const T &t, const MPI_Comm &mpi_communicator)
unsigned int n_mpi_processes(const MPI_Comm &mpi_communicator)
MPI_Comm duplicate_communicator(const MPI_Comm &mpi_communicator)
T min(const T &t, const MPI_Comm &mpi_communicator)
unsigned int this_mpi_process(const MPI_Comm &mpi_communicator)
MinMaxAvg min_max_avg(const double my_value, const MPI_Comm &mpi_communicator)
std::vector< unsigned int > compute_point_to_point_communication_pattern(const MPI_Comm &mpi_comm, const std::vector< unsigned int > &destinations)
T max(const T &t, const MPI_Comm &mpi_communicator)