![]() |
Reference documentation for deal.II version 9.5.0
|
#include <deal.II/base/mpi_consensus_algorithms.h>
Public Member Functions | |
| PEX ()=default | |
| PEX (Process< RequestType, AnswerType > &process, const MPI_Comm comm) | |
| 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 () |
| 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 |
| Process< RequestType, AnswerType > * | process |
| MPI_Comm | comm |
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 622 of file mpi_consensus_algorithms.h.
|
default |
Default constructor.
| Utilities::MPI::ConsensusAlgorithms::PEX< RequestType, AnswerType >::PEX | ( | Process< RequestType, AnswerType > & | process, |
| const MPI_Comm | comm | ||
| ) |
Constructor.
|
virtualdefault |
Destructor.
|
overridevirtual |
Run the consensus algorithm and return a vector of process ranks that have requested answers from the current process.
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 indexth 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 |
Run the consensus algorithm and return a vector of process ranks that have requested answers from the current process.
|
inherited |
|
private |
Buffers for sending requests.
Definition at line 672 of file mpi_consensus_algorithms.h.
|
private |
Buffers for receiving answers to requests.
Definition at line 677 of file mpi_consensus_algorithms.h.
|
private |
MPI request objects for sending request messages.
Definition at line 682 of file mpi_consensus_algorithms.h.
|
private |
Buffers for sending answers to requests.
Definition at line 687 of file mpi_consensus_algorithms.h.
|
private |
Requests for sending answers to requests.
Definition at line 692 of file mpi_consensus_algorithms.h.
|
private |
List of processes who have made a request to this process.
Definition at line 697 of file mpi_consensus_algorithms.h.
|
privateinherited |
Reference to the process provided by the user.
This member variable is only used in the deprecated constructor and the run() function without argument. It is a nullptr otherwise
Definition at line 330 of file mpi_consensus_algorithms.h.
|
privateinherited |
MPI communicator.
This member variable is only used in the deprecated constructor and the run() function without argument.
Definition at line 339 of file mpi_consensus_algorithms.h.