Reference documentation for deal.II version 9.6.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
mpi.h File Reference
#include <deal.II/base/config.h>
#include <deal.II/base/array_view.h>
#include <deal.II/base/init_finalize.h>
#include <deal.II/base/mpi_stub.h>
#include <deal.II/base/mpi_tags.h>
#include <deal.II/base/numbers.h>
#include <deal.II/base/template_constraints.h>
#include <deal.II/base/utilities.h>
#include <complex>
#include <limits>
#include <map>
#include <numeric>
#include <vector>

Go to the source code of this file.

Classes

class  Utilities::MPI::DuplicatedCommunicator
 
class  Utilities::MPI::CollectiveMutex
 
class  Utilities::MPI::CollectiveMutex::ScopedLock
 
class  Utilities::MPI::Future< T >
 
struct  Utilities::MPI::MinMaxAvg
 
class  Utilities::MPI::MPI_InitFinalize
 

Namespaces

namespace  Utilities
 
namespace  Utilities::MPI
 
namespace  Utilities::MPI::internal
 
namespace  Utilities::MPI::internal::MPIDataTypes
 

Macros

#define DEAL_II_MPI_CONST_CAST(expr)   (expr)
 

Functions

IndexSet Utilities::create_evenly_distributed_partitioning (const unsigned int my_partition_id, const unsigned int n_partitions, const types::global_dof_index total_size)
 
unsigned int Utilities::MPI::n_mpi_processes (const MPI_Comm mpi_communicator)
 
unsigned int Utilities::MPI::this_mpi_process (const MPI_Comm mpi_communicator)
 
std::vector< unsigned intUtilities::MPI::mpi_processes_within_communicator (const MPI_Comm comm_large, const MPI_Comm comm_small)
 
std::vector< unsigned intUtilities::MPI::compute_point_to_point_communication_pattern (const MPI_Comm mpi_comm, const std::vector< unsigned int > &destinations)
 
unsigned int Utilities::MPI::compute_n_point_to_point_communications (const MPI_Comm mpi_comm, const std::vector< unsigned int > &destinations)
 
MPI_Comm Utilities::MPI::duplicate_communicator (const MPI_Comm mpi_communicator)
 
void Utilities::MPI::free_communicator (MPI_Comm mpi_communicator)
 
int Utilities::MPI::create_group (const MPI_Comm comm, const MPI_Group &group, const int tag, MPI_Comm *new_comm)
 
std::vector< IndexSetUtilities::MPI::create_ascending_partitioning (const MPI_Comm comm, const types::global_dof_index locally_owned_size)
 
IndexSet Utilities::MPI::create_evenly_distributed_partitioning (const MPI_Comm comm, const types::global_dof_index total_size)
 
template<class Iterator , typename Number = long double>
std::pair< Number, typename numbers::NumberTraits< Number >::real_type > Utilities::MPI::mean_and_standard_deviation (const Iterator begin, const Iterator end, const MPI_Comm comm)
 
std::unique_ptr< MPI_Datatype, void(*)(MPI_Datatype *)> Utilities::MPI::create_mpi_data_type_n_bytes (const std::size_t n_bytes)
 
template<typename T >
Utilities::MPI::sum (const T &t, const MPI_Comm mpi_communicator)
 
template<typename T , typename U >
void Utilities::MPI::sum (const T &values, const MPI_Comm mpi_communicator, U &sums)
 
template<typename T >
void Utilities::MPI::sum (const ArrayView< const T > &values, const MPI_Comm mpi_communicator, const ArrayView< T > &sums)
 
template<int rank, int dim, typename Number >
SymmetricTensor< rank, dim, Number > Utilities::MPI::sum (const SymmetricTensor< rank, dim, Number > &local, const MPI_Comm mpi_communicator)
 
template<int rank, int dim, typename Number >
Tensor< rank, dim, Number > Utilities::MPI::sum (const Tensor< rank, dim, Number > &local, const MPI_Comm mpi_communicator)
 
template<typename Number >
void Utilities::MPI::sum (const SparseMatrix< Number > &local, const MPI_Comm mpi_communicator, SparseMatrix< Number > &global)
 
template<typename T >
Utilities::MPI::max (const T &t, const MPI_Comm mpi_communicator)
 
template<typename T , typename U >
void Utilities::MPI::max (const T &values, const MPI_Comm mpi_communicator, U &maxima)
 
template<typename T >
void Utilities::MPI::max (const ArrayView< const T > &values, const MPI_Comm mpi_communicator, const ArrayView< T > &maxima)
 
template<typename T >
Utilities::MPI::min (const T &t, const MPI_Comm mpi_communicator)
 
template<typename T , typename U >
void Utilities::MPI::min (const T &values, const MPI_Comm mpi_communicator, U &minima)
 
template<typename T >
void Utilities::MPI::min (const ArrayView< const T > &values, const MPI_Comm mpi_communicator, const ArrayView< T > &minima)
 
template<typename T >
Utilities::MPI::logical_or (const T &t, const MPI_Comm mpi_communicator)
 
template<typename T , typename U >
void Utilities::MPI::logical_or (const T &values, const MPI_Comm mpi_communicator, U &results)
 
template<typename T >
void Utilities::MPI::logical_or (const ArrayView< const T > &values, const MPI_Comm mpi_communicator, const ArrayView< T > &results)
 
MinMaxAvg Utilities::MPI::min_max_avg (const double my_value, const MPI_Comm mpi_communicator)
 
std::vector< MinMaxAvgUtilities::MPI::min_max_avg (const std::vector< double > &my_value, const MPI_Comm mpi_communicator)
 
void Utilities::MPI::min_max_avg (const ArrayView< const double > &my_values, const ArrayView< MinMaxAvg > &result, const MPI_Comm mpi_communicator)
 
bool Utilities::MPI::job_supports_mpi ()
 
template<typename T >
std::map< unsigned int, T > Utilities::MPI::some_to_some (const MPI_Comm comm, const std::map< unsigned int, T > &objects_to_send)
 
template<typename T >
std::vector< T > Utilities::MPI::all_gather (const MPI_Comm comm, const T &object_to_send)
 
template<typename T >
std::vector< T > Utilities::MPI::gather (const MPI_Comm comm, const T &object_to_send, const unsigned int root_process=0)
 
template<typename T >
Utilities::MPI::scatter (const MPI_Comm comm, const std::vector< T > &objects_to_send, const unsigned int root_process=0)
 
template<typename T >
std::enable_if_t< is_mpi_type< T >==false, T > Utilities::MPI::broadcast (const MPI_Comm comm, const T &object_to_send, const unsigned int root_process=0)
 
template<typename T >
std::enable_if_t< is_mpi_type< T >==true, T > Utilities::MPI::broadcast (const MPI_Comm comm, const T &object_to_send, const unsigned int root_process=0)
 
template<typename T >
void Utilities::MPI::broadcast (T *buffer, const size_t count, const unsigned int root, const MPI_Comm comm)
 
template<typename T >
Utilities::MPI::reduce (const T &local_value, const MPI_Comm comm, const std::function< T(const T &, const T &)> &combiner, const unsigned int root_process=0)
 
template<typename T , typename = std::enable_if_t<is_mpi_type<T> == true>>
std::pair< T, T > Utilities::MPI::partial_and_total_sum (const T &value, const MPI_Comm comm)
 
template<typename T >
Utilities::MPI::all_reduce (const T &local_value, const MPI_Comm comm, const std::function< T(const T &, const T &)> &combiner)
 
template<typename T >
Future< void > Utilities::MPI::isend (const T &object, MPI_Comm communicator, const unsigned int target_rank, const unsigned int mpi_tag=0)
 
template<typename T >
Future< T > Utilities::MPI::irecv (MPI_Comm communicator, const unsigned int source_rank, const unsigned int mpi_tag=0)
 
std::vector< unsigned intUtilities::MPI::compute_index_owner (const IndexSet &owned_indices, const IndexSet &indices_to_look_up, const MPI_Comm comm)
 
template<typename T >
std::vector< T > Utilities::MPI::compute_set_union (const std::vector< T > &vec, const MPI_Comm comm)
 
template<typename T >
std::set< T > Utilities::MPI::compute_set_union (const std::set< T > &set, const MPI_Comm comm)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const bool *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const char *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const signed char *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const wchar_t *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const short *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const int *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const long int *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const long long int *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const unsigned char *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const unsigned short *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const unsigned int *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const unsigned long int *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const unsigned long long int *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const float *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const double *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const long double *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const std::complex< float > *)
 
MPI_Datatype Utilities::MPI::internal::MPIDataTypes::mpi_type_id (const std::complex< double > *)
 

Variables

template<typename T >
constexpr bool Utilities::MPI::is_mpi_type
 
template<typename T >
const MPI_Datatype Utilities::MPI::mpi_type_id_for_type
 

Macro Definition Documentation

◆ DEAL_II_MPI_CONST_CAST

#define DEAL_II_MPI_CONST_CAST ( expr)    (expr)

Helper macro to remove const from the pointer arguments to some MPI_* functions.

This is needed as the input arguments of functions like MPI_Allgather() are not marked as const in OpenMPI 1.6.5. If using MPI 3 or newer, this macro is a NOOP, while we do the following otherwise:

  1. remove * from type of expr
  2. remove const from resulting type
  3. add * to resulting type
  4. const_cast the given expression expr to this new type.

Definition at line 50 of file mpi.h.