![]() |
Reference documentation for deal.II version 9.6.0
|
#include <deal.II/base/mpi_consensus_algorithms.h>
Public Member Functions | |
PEX ()=default | |
virtual | ~PEX ()=default |
virtual std::vector< unsigned int > | run (const std::vector< unsigned int > &targets, const std::function< RequestType(const unsigned int)> &create_request, const std::function< AnswerType(const unsigned int, const RequestType &)> &answer_request, const std::function< void(const unsigned int, const AnswerType &)> &process_answer, const MPI_Comm comm) override |
std::vector< unsigned int > | run (Process< RequestType, AnswerType > &process, const MPI_Comm comm) |
Private Member Functions | |
unsigned int | start_communication (const std::vector< unsigned int > &targets, const std::function< RequestType(const unsigned int)> &create_request, const MPI_Comm comm) |
void | answer_one_request (const unsigned int index, const std::function< AnswerType(const unsigned int, const RequestType &)> &answer_request, const MPI_Comm comm) |
void | process_incoming_answers (const unsigned int n_targets, const std::function< void(const unsigned int, const AnswerType &)> &process_answer, const MPI_Comm comm) |
void | clean_up_and_end_communication () |
Private Attributes | |
std::vector< std::vector< char > > | send_buffers |
std::vector< std::vector< char > > | recv_buffers |
std::vector< MPI_Request > | send_request_requests |
std::vector< std::vector< char > > | requests_buffers |
std::vector< MPI_Request > | send_answer_requests |
std::set< unsigned int > | requesting_processes |
This class implements a concrete algorithm for the ConsensusAlgorithms::Interface base class, 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. This algorithm is most suitable for relatively small process counts – say, less than 100.
RequestType | The type of the elements of the vector to be sent. |
AnswerType | The type of the elements of the vector to be received. |
Definition at line 555 of file mpi_consensus_algorithms.h.
|
default |
Default constructor.
|
virtualdefault |
Destructor.
|
overridevirtual |
Run the consensus algorithm and return a vector of process ranks that have requested answers from the current process.
This version of the run() function simply unpacks the functions packaged in process
and calls the version of the run() function that takes a number of std::function
arguments.
Implements Utilities::MPI::ConsensusAlgorithms::Interface< RequestType, AnswerType >.
|
private |
Start to send all requests via ISend and post IRecvs for the incoming answer messages.
|
private |
The index
th request message from another rank has been received: process the request and send an answer.
|
private |
Receive and process all of the incoming responses to the requests we sent.
|
private |
After all answers have been exchanged, the MPI data structures can be freed and the received answers can be processed.
|
inherited |
|
private |
Buffers for sending requests.
Definition at line 589 of file mpi_consensus_algorithms.h.
|
private |
Buffers for receiving answers to requests.
Definition at line 594 of file mpi_consensus_algorithms.h.
|
private |
MPI request objects for sending request messages.
Definition at line 599 of file mpi_consensus_algorithms.h.
|
private |
Buffers for sending answers to requests.
Definition at line 604 of file mpi_consensus_algorithms.h.
|
private |
Requests for sending answers to requests.
Definition at line 609 of file mpi_consensus_algorithms.h.
|
private |
List of processes who have made a request to this process.
Definition at line 614 of file mpi_consensus_algorithms.h.