![]() |
Ginkgo
Generated from pipelines/3035309441 branch based on develop. Ginkgo version 2.0.0
A numerical linear algebra library targeting many-core architectures
|
The distributed::RowScatterer scatters local values to their owning processes and accumulates received contributions into a local target. More...
#include <ginkgo/core/distributed/row_scatterer.hpp>
Public Member Functions | |
| void | apply_async (ptr_param< const LinOp > local_values) const |
| Start scattering local values to their owning ranks. More... | |
| void | wait_and_accumulate (ptr_param< LinOp > distributed_target) const |
| Wait for the scatter communication to complete and accumulate received values into the target: target += received_contributions. More... | |
| dim< 2 > | get_size () const |
| Returns the size of the row scatterer. | |
| std::shared_ptr< const mpi::CollectiveCommunicator > | get_collective_communicator () const |
| Get the used collective communicator. | |
| const LocalIndexType * | get_const_recv_idxs () const |
| Read access to the (local) row indices into which the received values are accumulated. | |
| size_type | get_num_recv_idxs () const |
| Returns the number of (local) row indices. | |
| RowScatterer (const RowScatterer &o) | |
| RowScatterer (RowScatterer &&o) | |
| RowScatterer & | operator= (const RowScatterer &o) |
| RowScatterer & | operator= (RowScatterer &&o) |
Public Member Functions inherited from gko::PolymorphicObject | |
| virtual void | validate_data () const |
| Throws gko::InvalidData exception if we found the data inside the object does not fulfill certain property up to our knowledge. | |
| PolymorphicObject & | operator= (const PolymorphicObject &) |
| std::shared_ptr< const Executor > | get_executor () const noexcept |
| Returns the Executor of the object. More... | |
Public Member Functions inherited from gko::log::EnableLogging< PolymorphicObject > | |
| void | add_logger (std::shared_ptr< const Logger > logger) override |
| void | remove_logger (const Logger *logger) override |
| void | remove_logger (ptr_param< const Logger > logger) |
| const std::vector< std::shared_ptr< const Logger > > & | get_loggers () const override |
| void | clear_loggers () override |
Public Member Functions inherited from gko::log::Loggable | |
| void | remove_logger (ptr_param< const Logger > logger) |
Public Member Functions inherited from gko::EnableCloneable< RowScatterer< LocalIndexType > > | |
| std::unique_ptr< RowScatterer< LocalIndexType > > | clone (std::shared_ptr< const Executor > exec) const |
| Creates a clone of the object. More... | |
| std::unique_ptr< RowScatterer< LocalIndexType > > | clone () const |
| Creates a clone of the object. More... | |
| void | convert_to (result_type *result) const override |
| Converts the implementer to an object of type result_type. More... | |
| void | move_to (result_type *result) override |
| Converts the implementer to an object of type result_type by moving data from this object. More... | |
| std::unique_ptr< RowScatterer< LocalIndexType > > | create_default () const |
| std::unique_ptr< RowScatterer< LocalIndexType > > | create_default (std::shared_ptr< const Executor > exec) const |
Public Member Functions inherited from gko::ConvertibleTo< ResultType > | |
| void | convert_to (ptr_param< result_type > result) const |
| void | move_to (ptr_param< result_type > result) |
Public Member Functions inherited from gko::Cloneable | |
| std::unique_ptr< Cloneable > | clone (std::shared_ptr< const Executor > exec) const |
| std::unique_ptr< Cloneable > | clone () const |
| Cloneable * | copy_from (ptr_param< const Cloneable > other) |
| Cloneable * | move_from (ptr_param< Cloneable > other) |
| std::unique_ptr< Cloneable > | create_default (std::shared_ptr< const Executor > exec) const |
| std::unique_ptr< Cloneable > | create_default () const |
Public Member Functions inherited from gko::experimental::distributed::DistributedBase | |
| DistributedBase (const DistributedBase &other)=default | |
| DistributedBase (DistributedBase &&other)=default | |
| DistributedBase & | operator= (const DistributedBase &) |
| Copy assignment that doesn't change the used mpi::communicator. More... | |
| DistributedBase & | operator= (DistributedBase &&) noexcept |
| Move assignment that doesn't change the used mpi::communicator. More... | |
| mpi::communicator | get_communicator () const |
| Access the used mpi::communicator. More... | |
Static Public Member Functions | |
| template<typename GlobalIndexType = int64, typename = std::enable_if_t<sizeof(GlobalIndexType) >= sizeof(LocalIndexType)> | |
| static std::unique_ptr< RowScatterer > | create (std::shared_ptr< const Executor > exec, std::shared_ptr< const mpi::CollectiveCommunicator > coll_comm, const index_map< LocalIndexType, GlobalIndexType > &imap) |
| Creates a distributed::RowScatterer from a given collective communicator and index map. More... | |
| static std::unique_ptr< RowScatterer > | create_from_gatherer (std::shared_ptr< const Executor > exec, ptr_param< const RowGatherer< LocalIndexType >> gatherer) |
| Creates a distributed::RowScatterer from an existing RowGatherer. More... | |
| static std::unique_ptr< RowScatterer > | create (std::shared_ptr< const Executor > exec, mpi::communicator comm) |
| Create method for an empty RowScatterer. | |
Friends | |
| class | EnableCloneable< RowScatterer > |
Additional Inherited Members | |
Public Types inherited from gko::EnableCloneable< RowScatterer< LocalIndexType > > | |
| using | result_type = RowScatterer< LocalIndexType > |
Public Types inherited from gko::ConvertibleTo< ResultType > | |
| using | result_type = ResultType |
The distributed::RowScatterer scatters local values to their owning processes and accumulates received contributions into a local target.
This is the transpose of the RowGatherer operation:
The operation is split into two phases to allow overlapping computation with communication:
apply_async packs the send buffer and initiates the MPI communication.wait_and_accumulate waits for the communication to complete, then accumulates the received values into the target vector.The scatterer keeps track of the in-flight communication, so only one scatter can be active at any given time.
Example usage:
| LocalIndexType | the index type for the stored indices |
| void gko::experimental::distributed::RowScatterer< LocalIndexType >::apply_async | ( | ptr_param< const LinOp > | local_values | ) | const |
Start scattering local values to their owning ranks.
Packs the local values into a send buffer and initiates the MPI communication. The scatter is finished by calling wait_and_accumulate.
| local_values | the local values to scatter (distributed::Vector). Its local vector must have as many rows as this process sends. It might not be modified before wait_and_accumulate is called. |
| InvalidStateError | if a previous scatter has not been finished by wait_and_accumulate. |
|
inlinestatic |
Creates a distributed::RowScatterer from a given collective communicator and index map.
| GlobalIndexType | the global index type of the index map |
| exec | the executor |
| coll_comm | the collective communicator in the gather direction, i.e. the one that would be used to create the corresponding RowGatherer. It receives the non-local rows of imap. The scatterer uses its inverse. |
| imap | the index map defining the scatter pattern |
|
static |
Creates a distributed::RowScatterer from an existing RowGatherer.
The scatterer is the transpose of the gatherer: it inverts the communication pattern and accumulates received values at the positions from which the gatherer originally sent.
| exec | the executor |
| gatherer | the RowGatherer to create the inverse from |
| void gko::experimental::distributed::RowScatterer< LocalIndexType >::wait_and_accumulate | ( | ptr_param< LinOp > | distributed_target | ) | const |
Wait for the scatter communication to complete and accumulate received values into the target: target += received_contributions.
| distributed_target | the target vector to accumulate into. It must have the same value type and number of columns as the local_values of apply_async. |
| InvalidStateError | if there is no scatter started by apply_async. |
1.8.16