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

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

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

Public Member Functions

 ConsensusAlgorithm_PEX (ConsensusAlgorithmProcess< T1, T2 > &process, const MPI_Comm &comm)
 
virtual ~ConsensusAlgorithm_PEX ()=default
 
virtual void run () override
 
- Public Member Functions inherited from Utilities::MPI::ConsensusAlgorithm< T1, T2 >
virtual ~ConsensusAlgorithm ()=default
 

Private Member Functions

void process_requests (int index)
 
unsigned int start_communication ()
 
void clean_up_and_end_communication ()
 

Private Attributes

std::vector< unsigned int > targets
 
std::vector< unsigned int > sources
 
std::vector< std::vector< T1 > > send_buffers
 
std::vector< std::vector< T2 > > recv_buffers
 
std::vector< MPI_Request > send_and_recv_buffers
 
std::vector< std::vector< T2 > > requests_buffers
 
std::vector< MPI_Request > requests_answers
 

Additional Inherited Members

- Protected Attributes inherited from Utilities::MPI::ConsensusAlgorithm< T1, T2 >
ConsensusAlgorithmProcess< T1, T2 > & process
 
const MPI_Comm & comm
 
const unsigned int my_rank
 
const unsigned int n_procs
 

Detailed Description

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

This class implements ConsensusAlgorithm, using a two step approach. In the first step the source ranks are determined and in the second step a static sparse data exchange is performed.

Note
In contrast to ConsensusAlgorithm_NBX, this class splits the same task into two distinct steps. In the first step, all processes are identified who want to send a request to this process. In the second step, the data is exchanged. However, since - in the second step - now it is clear how many requests have to be answered, i.e. when this process can stop waiting for requests, no IBarrier is needed.
The function compute_point_to_point_communication_pattern() is used to determine the source processes, which implements a PEX-algorithm from Hoefner et. al. "Scalable Communication Protocols for Dynamic Sparse Data Exchange"
Template Parameters
T1the type of the elements of the vector to sent
T2the type of the elements of the vector to received
Author
Peter Munch, 2019

Definition at line 1028 of file mpi.h.

Constructor & Destructor Documentation

◆ ConsensusAlgorithm_PEX()

template<typename T1 , typename T2 >
Utilities::MPI::ConsensusAlgorithm_PEX< T1, T2 >::ConsensusAlgorithm_PEX ( ConsensusAlgorithmProcess< T1, T2 > &  process,
const MPI_Comm &  comm 
)

Constructor.

Parameters
processProcess to be run during consensus algorithm.
commMPI Communicator

Definition at line 1196 of file mpi.cc.

◆ ~ConsensusAlgorithm_PEX()

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

Destructor.

Member Function Documentation

◆ run()

template<typename T1 , typename T2 >
void Utilities::MPI::ConsensusAlgorithm_PEX< T1, T2 >::run ( )
overridevirtual

Run consensus algorithm.

Implements Utilities::MPI::ConsensusAlgorithm< T1, T2 >.

Definition at line 1206 of file mpi.cc.

◆ process_requests()

template<typename T1 , typename T2 >
void Utilities::MPI::ConsensusAlgorithm_PEX< T1, T2 >::process_requests ( int  index)
private

The ith request message from another rank has been received: process the request and send an answer.

Definition at line 1224 of file mpi.cc.

◆ start_communication()

template<typename T1 , typename T2 >
unsigned int Utilities::MPI::ConsensusAlgorithm_PEX< T1, T2 >::start_communication ( )
private

Start to send all requests via ISend and post IRecvs for the incoming answer messages.

Definition at line 1274 of file mpi.cc.

◆ clean_up_and_end_communication()

template<typename T1 , typename T2 >
void Utilities::MPI::ConsensusAlgorithm_PEX< T1, T2 >::clean_up_and_end_communication ( )
private

After all answers have been exchanged, the MPI data structures can be freed and the received answers can be processed.

Definition at line 1350 of file mpi.cc.

Member Data Documentation

◆ targets

template<typename T1 , typename T2 >
std::vector<unsigned int> Utilities::MPI::ConsensusAlgorithm_PEX< T1, T2 >::targets
private

List of ranks of processes this processes wants to send a request to.

Definition at line 1060 of file mpi.h.

◆ sources

template<typename T1 , typename T2 >
std::vector<unsigned int> Utilities::MPI::ConsensusAlgorithm_PEX< T1, T2 >::sources
private

List of ranks of processes wanting to send a request to this process.

Definition at line 1065 of file mpi.h.

◆ send_buffers

template<typename T1 , typename T2 >
std::vector<std::vector<T1> > Utilities::MPI::ConsensusAlgorithm_PEX< T1, T2 >::send_buffers
private

Buffers for sending requests.

Definition at line 1072 of file mpi.h.

◆ recv_buffers

template<typename T1 , typename T2 >
std::vector<std::vector<T2> > Utilities::MPI::ConsensusAlgorithm_PEX< T1, T2 >::recv_buffers
private

Buffers for receiving answers to requests.

Definition at line 1077 of file mpi.h.

◆ send_and_recv_buffers

template<typename T1 , typename T2 >
std::vector<MPI_Request> Utilities::MPI::ConsensusAlgorithm_PEX< T1, T2 >::send_and_recv_buffers
private

Requests for sending requests and receiving answers to requests.

Definition at line 1082 of file mpi.h.

◆ requests_buffers

template<typename T1 , typename T2 >
std::vector<std::vector<T2> > Utilities::MPI::ConsensusAlgorithm_PEX< T1, T2 >::requests_buffers
private

Buffers for sending answers to requests.

Definition at line 1087 of file mpi.h.

◆ requests_answers

template<typename T1 , typename T2 >
std::vector<MPI_Request> Utilities::MPI::ConsensusAlgorithm_PEX< T1, T2 >::requests_answers
private

Requests for sending answers to requests.

Definition at line 1092 of file mpi.h.


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