Reference documentation for deal.II version Git 35565f205e 2019-09-24 08:33:37 +0200
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
Public Member Functions | List of all members
Utilities::MPI::ConsensusAlgorithmProcess< T1, T2 > Class Template Referenceabstract

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

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

Public Member Functions

virtual ~ConsensusAlgorithmProcess ()=default
 
virtual std::vector< unsigned int > compute_targets ()=0
 
virtual void pack_recv_buffer (const int other_rank, std::vector< T1 > &send_buffer)
 
virtual void prepare_recv_buffer (const int other_rank, std::vector< T2 > &recv_buffer)
 
virtual void process_request (const unsigned int other_rank, const std::vector< T1 > &buffer_recv, std::vector< T2 > &request_buffer)
 
virtual void unpack_recv_buffer (const int other_rank, const std::vector< T2 > &recv_buffer)
 

Detailed Description

template<typename T1, typename T2>
class Utilities::MPI::ConsensusAlgorithmProcess< T1, T2 >

An interface to be able to use the ConsensusAlgorithm 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.
Author
Peter Munch, 2019

Definition at line 738 of file mpi.h.

Constructor & Destructor Documentation

◆ ~ConsensusAlgorithmProcess()

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

Destructor.

Member Function Documentation

◆ compute_targets()

template<typename T1, typename T2>
virtual std::vector<unsigned int> Utilities::MPI::ConsensusAlgorithmProcess< 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::ConsensusAlgorithmProcessTargets, and Utilities::MPI::internal::ComputeIndexOwner::ConsensusAlgorithmPayload.

◆ pack_recv_buffer()

template<typename T1 , typename T2 >
void Utilities::MPI::ConsensusAlgorithmProcess< T1, T2 >::pack_recv_buffer ( const 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.

Definition at line 836 of file mpi.cc.

◆ prepare_recv_buffer()

template<typename T1 , typename T2 >
void Utilities::MPI::ConsensusAlgorithmProcess< T1, T2 >::prepare_recv_buffer ( const 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::internal::ComputeIndexOwner::ConsensusAlgorithmPayload.

Definition at line 846 of file mpi.cc.

◆ process_request()

template<typename T1 , typename T2 >
void Utilities::MPI::ConsensusAlgorithmProcess< T1, T2 >::process_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::ConsensusAlgorithmProcessTargets.

Definition at line 825 of file mpi.cc.

◆ unpack_recv_buffer()

template<typename T1 , typename T2 >
void Utilities::MPI::ConsensusAlgorithmProcess< T1, T2 >::unpack_recv_buffer ( const 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::internal::ComputeIndexOwner::ConsensusAlgorithmPayload.

Definition at line 856 of file mpi.cc.


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