Reference documentation for deal.II version 9.3.3
\(\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 | List of all members
Utilities::MPI::ConsensusAlgorithms::Process< T1, T2 > Class Template Referenceabstract

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

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

Public Member Functions

virtual ~Process ()=default
 
virtual std::vector< unsigned intcompute_targets ()=0
 
virtual void create_request (const unsigned int other_rank, std::vector< T1 > &send_buffer)
 
virtual void prepare_buffer_for_answer (const unsigned int other_rank, std::vector< T2 > &recv_buffer)
 
virtual void answer_request (const unsigned int other_rank, const std::vector< T1 > &buffer_recv, std::vector< T2 > &request_buffer)
 
virtual void read_answer (const unsigned int other_rank, const std::vector< T2 > &recv_buffer)
 

Detailed Description

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

An interface to be able to use the Interface classes. The main functionality of the implementations is to return a list of process ranks this process wants data from and to deal with the optional payload of the messages sent/received by the ConsensusAlgorithm classes.

There are two kinds of messages:

Template Parameters
T1the type of the elements of the vector to sent
T2the type of the elements of the vector to received
Note
Since the payloads of the messages are optional, users have to deal with buffers themselves. The ConsensusAlgorithm classes 1) deliver only references to empty vectors (of size 0) the data to be sent can be inserted to or read from, and 2) communicate these vectors blindly.

Definition at line 62 of file mpi_consensus_algorithms.h.

Constructor & Destructor Documentation

◆ ~Process()

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

Destructor.

Member Function Documentation

◆ compute_targets()

template<typename T1 , typename T2 >
virtual std::vector< unsigned int > Utilities::MPI::ConsensusAlgorithms::Process< T1, T2 >::compute_targets ( )
pure virtual
Returns
A vector of ranks this process wants to send a request to.
Note
This is the only method which has to be implemented since the payloads of the messages are optional.

Implemented in Utilities::MPI::internal::ComputeIndexOwner::DictionaryPayLoad, Utilities::MPI::internal::ComputeIndexOwner::ConsensusAlgorithmsPayload, Utilities::MPI::ConsensusAlgorithms::AnonymousProcess< T1, T2 >, and Utilities::MPI::ConsensusAlgorithmsProcessTargets.

◆ create_request()

template<typename T1 , typename T2 >
virtual void Utilities::MPI::ConsensusAlgorithms::Process< T1, T2 >::create_request ( const unsigned int  other_rank,
std::vector< T1 > &  send_buffer 
)
virtual

Add to the request to the process with the specified rank a payload.

Parameters
[in]other_rankrank of the process
[out]send_bufferdata to be sent part of the request (optional)
Note
The buffer is empty. Before using it, you have to set its size.

Reimplemented in Utilities::MPI::internal::ComputeIndexOwner::DictionaryPayLoad, Utilities::MPI::internal::ComputeIndexOwner::ConsensusAlgorithmsPayload, and Utilities::MPI::ConsensusAlgorithms::AnonymousProcess< T1, T2 >.

◆ prepare_buffer_for_answer()

template<typename T1 , typename T2 >
virtual void Utilities::MPI::ConsensusAlgorithms::Process< T1, T2 >::prepare_buffer_for_answer ( const unsigned int  other_rank,
std::vector< T2 > &  recv_buffer 
)
virtual

Prepare the buffer where the payload of the answer of the request to the process with the specified rank is saved in. The most obvious task is to resize the buffer, since it is empty when the function is called.

Parameters
[in]other_rankrank of the process
[out]recv_bufferdata to be sent part of the request (optional)

Reimplemented in Utilities::MPI::ConsensusAlgorithms::AnonymousProcess< T1, T2 >, and Utilities::MPI::internal::ComputeIndexOwner::ConsensusAlgorithmsPayload.

◆ answer_request()

template<typename T1 , typename T2 >
virtual void Utilities::MPI::ConsensusAlgorithms::Process< T1, T2 >::answer_request ( const unsigned int  other_rank,
const std::vector< T1 > &  buffer_recv,
std::vector< T2 > &  request_buffer 
)
virtual

Prepare the buffer where the payload of the answer of the request to the process with the specified rank is saved in.

Parameters
[in]other_rankrank of the process
[in]buffer_recvreceived payload (optional)
[out]request_bufferpayload to be sent as part of the request (optional)
Note
The request_buffer is empty. Before using it, you have to set its size.

Reimplemented in Utilities::MPI::internal::ComputeIndexOwner::DictionaryPayLoad, Utilities::MPI::internal::ComputeIndexOwner::ConsensusAlgorithmsPayload, Utilities::MPI::ConsensusAlgorithmsProcessTargets, and Utilities::MPI::ConsensusAlgorithms::AnonymousProcess< T1, T2 >.

◆ read_answer()

template<typename T1 , typename T2 >
virtual void Utilities::MPI::ConsensusAlgorithms::Process< T1, T2 >::read_answer ( const unsigned int  other_rank,
const std::vector< T2 > &  recv_buffer 
)
virtual

Process the payload of the answer of the request to the process with the specified rank.

Parameters
[in]other_rankrank of the process
[in]recv_bufferdata to be sent part of the request (optional)

Reimplemented in Utilities::MPI::ConsensusAlgorithms::AnonymousProcess< T1, T2 >, and Utilities::MPI::internal::ComputeIndexOwner::ConsensusAlgorithmsPayload.


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