Reference documentation for deal.II version Git 0277a0d32d 2021-02-27 15:20:51 +0100
\(\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\}}\)
Public Member Functions | Protected Attributes | Private Attributes | List of all members
Utilities::MPI::ConsensusAlgorithms::Selector< T1, T2 > Class Template Reference

#include <deal.II/base/mpi_consensus_algorithms.h>

Inheritance diagram for Utilities::MPI::ConsensusAlgorithms::Selector< T1, T2 >:
[legend]

Public Member Functions

 Selector (Process< T1, T2 > &process, const MPI_Comm &comm)
 
virtual ~Selector ()=default
 
virtual void run () override
 

Protected Attributes

Process< T1, T2 > & process
 
const MPI_Commcomm
 
const bool job_supports_mpi
 
const unsigned int my_rank
 
const unsigned int n_procs
 

Private Attributes

std::shared_ptr< Interface< T1, T2 > > consensus_algo
 

Detailed Description

template<typename T1, typename T2>
class Utilities::MPI::ConsensusAlgorithms::Selector< T1, T2 >

A class which delegates its task to other ConsensusAlgorithms::Interface implementations depending on the number of processes in the MPI communicator. For a small number of processes it uses PEX and for a large number of processes NBX. The threshold depends if the program is compiled in debug or release mode.

Template Parameters
T1The type of the elements of the vector to be sent.
T2The type of the elements of the vector to be received.

Definition at line 482 of file mpi_consensus_algorithms.h.

Constructor & Destructor Documentation

◆ Selector()

template<typename T1 , typename T2 >
Utilities::MPI::ConsensusAlgorithms::Selector< T1, T2 >::Selector ( Process< T1, T2 > &  process,
const MPI_Comm comm 
)

Constructor.

Parameters
processProcess to be run during consensus algorithm.
commMPI Communicator.

◆ ~Selector()

template<typename T1 , typename T2 >
virtual Utilities::MPI::ConsensusAlgorithms::Selector< T1, T2 >::~Selector ( )
virtualdefault

Destructor.

Member Function Documentation

◆ run()

template<typename T1 , typename T2 >
virtual void Utilities::MPI::ConsensusAlgorithms::Selector< T1, T2 >::run ( )
overridevirtual

Run consensus algorithm.

Note
The function call is delegated to another ConsensusAlgorithms::Interface implementation.

Implements Utilities::MPI::ConsensusAlgorithms::Interface< T1, T2 >.

Member Data Documentation

◆ consensus_algo

template<typename T1 , typename T2 >
std::shared_ptr<Interface<T1, T2> > Utilities::MPI::ConsensusAlgorithms::Selector< T1, T2 >::consensus_algo
private

Definition at line 508 of file mpi_consensus_algorithms.h.

◆ process

template<typename T1 , typename T2 >
Process<T1, T2>& Utilities::MPI::ConsensusAlgorithms::Interface< T1, T2 >::process
protectedinherited

Reference to the process provided by the user.

Definition at line 186 of file mpi_consensus_algorithms.h.

◆ comm

template<typename T1 , typename T2 >
const MPI_Comm& Utilities::MPI::ConsensusAlgorithms::Interface< T1, T2 >::comm
protectedinherited

MPI communicator.

Definition at line 191 of file mpi_consensus_algorithms.h.

◆ job_supports_mpi

template<typename T1 , typename T2 >
const bool Utilities::MPI::ConsensusAlgorithms::Interface< T1, T2 >::job_supports_mpi
protectedinherited

Cache if job supports MPI.

Definition at line 196 of file mpi_consensus_algorithms.h.

◆ my_rank

template<typename T1 , typename T2 >
const unsigned int Utilities::MPI::ConsensusAlgorithms::Interface< T1, T2 >::my_rank
protectedinherited

Rank of this process.

Definition at line 201 of file mpi_consensus_algorithms.h.

◆ n_procs

template<typename T1 , typename T2 >
const unsigned int Utilities::MPI::ConsensusAlgorithms::Interface< T1, T2 >::n_procs
protectedinherited

Number of processes in the communicator.

Definition at line 206 of file mpi_consensus_algorithms.h.


The documentation for this class was generated from the following file: