Reference documentation for deal.II version 9.3.3
|
#include <deal.II/base/mpi_consensus_algorithms.h>
Public Member Functions | |
AnonymousProcess (const std::function< std::vector< unsigned int >()> &function_compute_targets, const std::function< void(const unsigned int, std::vector< T1 > &)> &function_create_request=[](const unsigned int, std::vector< T1 > &) {}, const std::function< void(const unsigned int, const std::vector< T1 > &, std::vector< T2 > &)> &function_answer_request=[](const unsigned int, const std::vector< T1 > &, std::vector< T2 > &) {}, const std::function< void(const unsigned int, std::vector< T2 > &)> &function_prepare_buffer_for_answer=[](const unsigned int, std::vector< T2 > &) {}, const std::function< void(const unsigned int, const std::vector< T2 > &)> &function_read_answer=[](const unsigned int, const std::vector< T2 > &) {}) | |
std::vector< unsigned int > | compute_targets () override |
void | create_request (const unsigned int other_rank, std::vector< T1 > &send_buffer) override |
void | answer_request (const unsigned int other_rank, const std::vector< T1 > &buffer_recv, std::vector< T2 > &request_buffer) override |
void | prepare_buffer_for_answer (const unsigned int other_rank, std::vector< T2 > &recv_buffer) override |
void | read_answer (const unsigned int other_rank, const std::vector< T2 > &recv_buffer) override |
Private Attributes | |
const std::function< std::vector< unsigned int >()> | function_compute_targets |
const std::function< void(const int, std::vector< T1 > &)> | function_create_request |
const std::function< void(const unsigned int, const std::vector< T1 > &, std::vector< T2 > &)> | function_answer_request |
const std::function< void(const int, std::vector< T2 > &)> | function_prepare_buffer_for_answer |
const std::function< void(const int, const std::vector< T2 > &)> | function_read_answer |
This class implements Utilities::MPI::ConsensusAlgorithms::Process, using user-provided function wrappers. The advantage of this class is that users do not have to write their own implementation but can register lambda functions directly.
Definition at line 517 of file mpi_consensus_algorithms.h.
Utilities::MPI::ConsensusAlgorithms::AnonymousProcess< T1, T2 >::AnonymousProcess | ( | const std::function< std::vector< unsigned int >()> & | function_compute_targets, |
const std::function< void(const unsigned int, std::vector< T1 > &)> & | function_create_request = [](const unsigned int, std::vector<T1> &) {} , |
||
const std::function< void(const unsigned int, const std::vector< T1 > &, std::vector< T2 > &)> & | function_answer_request = [](const unsigned int, const std::vector<T1> &, std::vector<T2> &) {} , |
||
const std::function< void(const unsigned int, std::vector< T2 > &)> & | function_prepare_buffer_for_answer = [](const unsigned int, std::vector<T2> &) {} , |
||
const std::function< void(const unsigned int, const std::vector< T2 > &)> & | function_read_answer = [](const unsigned int, const std::vector<T2> &) {} |
||
) |
Register functions that should be called for implementing the interface of Process.
function_compute_targets | called during compute_targets . |
function_create_request | called during create_request . |
function_answer_request | called during answer_request . |
function_prepare_buffer_for_answer | called during prepare_buffer_for_answer . |
function_read_answer | called during read_answer . |
Definition at line 602 of file mpi_consensus_algorithms.h.
|
overridevirtual |
Implements Utilities::MPI::ConsensusAlgorithms::Process< T1, T2 >.
Definition at line 625 of file mpi_consensus_algorithms.h.
|
overridevirtual |
Add to the request to the process with the specified rank a payload.
[in] | other_rank | rank of the process |
[out] | send_buffer | data to be sent part of the request (optional) |
Reimplemented from Utilities::MPI::ConsensusAlgorithms::Process< T1, T2 >.
Definition at line 634 of file mpi_consensus_algorithms.h.
|
overridevirtual |
Prepare the buffer where the payload of the answer of the request to the process with the specified rank is saved in.
[in] | other_rank | rank of the process |
[in] | buffer_recv | received payload (optional) |
[out] | request_buffer | payload to be sent as part of the request (optional) |
Reimplemented from Utilities::MPI::ConsensusAlgorithms::Process< T1, T2 >.
Definition at line 644 of file mpi_consensus_algorithms.h.
|
overridevirtual |
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.
[in] | other_rank | rank of the process |
[out] | recv_buffer | data to be sent part of the request (optional) |
Reimplemented from Utilities::MPI::ConsensusAlgorithms::Process< T1, T2 >.
Definition at line 656 of file mpi_consensus_algorithms.h.
|
overridevirtual |
Process the payload of the answer of the request to the process with the specified rank.
[in] | other_rank | rank of the process |
[in] | recv_buffer | data to be sent part of the request (optional) |
Reimplemented from Utilities::MPI::ConsensusAlgorithms::Process< T1, T2 >.
Definition at line 667 of file mpi_consensus_algorithms.h.
|
private |
Definition at line 587 of file mpi_consensus_algorithms.h.
|
private |
Definition at line 589 of file mpi_consensus_algorithms.h.
|
private |
Definition at line 592 of file mpi_consensus_algorithms.h.
|
private |
Definition at line 594 of file mpi_consensus_algorithms.h.
|
private |
Definition at line 596 of file mpi_consensus_algorithms.h.