The distributed::RowGatherer gathers the rows of distributed::Vector that are located on other processes.
More...
#include <ginkgo/core/distributed/row_gatherer.hpp>
|
|
class | EnablePolymorphicObject< RowGatherer, PolymorphicObject > |
|
template<typename ValueT, typename LocalIndexT, typename GlobalIndexT> |
| class | Matrix |
template<typename LocalIndexType = int32>
class gko::experimental::distributed::RowGatherer< LocalIndexType >
The distributed::RowGatherer gathers the rows of distributed::Vector that are located on other processes.
Example usage:
auto coll_comm = std::make_shared<mpi::neighborhood_communicator>(comm,
imap);
auto req = rg->apply_async(b, x);
req.wait();
static std::unique_ptr< RowGatherer > create(std::shared_ptr< const Executor > exec, std::shared_ptr< const mpi::CollectiveCommunicator > coll_comm, const index_map< LocalIndexType, GlobalIndexType > &imap)
Creates a distributed::RowGatherer from a given collective communicator and index map.
Definition row_gatherer.hpp:198
static std::unique_ptr< Vector > create(std::shared_ptr< const Executor > exec, mpi::communicator comm, dim< 2 > global_size, dim< 2 > local_size, size_type stride)
Creates an empty distributed vector with a specified size.
static std::unique_ptr< Dense > create(std::shared_ptr< const Executor > exec, const dim< 2 > &size={}, size_type stride=0)
Creates an uninitialized Dense matrix of the specified size.
- Note
- The output vector for the apply_async functions must use an executor that is compatible with the MPI implementation. In particular, if the MPI implementation is not GPU aware, then the output vector must use a CPU executor. Otherwise, an exception will be thrown.
- Template Parameters
-
| LocalIndexType | the index type for the stored indices |
◆ apply_async() [1/2]
template<typename LocalIndexType = int32>
Asynchronous version of LinOp::apply.
- Warning
- Only one mpi::request can be active at any given time. Calling this function again without waiting on the previous mpi::request will lead to undefined behavior.
- Parameters
-
| b | the input distributed::Vector. |
| x | the output matrix::Dense with the rows gathered from b. Its executor has to be compatible with the MPI implementation, see the class documentation. |
- Returns
- a mpi::request for this task. The task is guaranteed to be completed only after .wait() has been called on it.
◆ apply_async() [2/2]
template<typename LocalIndexType = int32>
Asynchronous version of LinOp::apply.
- Warning
- Calling this multiple times with the same workspace and without waiting on each previous request will lead to incorrect data transfers.
- Parameters
-
| b | the input distributed::Vector. |
| x | the output matrix::Dense with the rows gathered from b. Its executor has to be compatible with the MPI implementation, see the class documentation. |
| workspace | a workspace to store temporary data for the operation. This might not be modified before the request is waited on. |
- Returns
- a mpi::request for this task. The task is guaranteed to be completed only after .wait() has been called on it.
◆ create()
template<typename LocalIndexType = int32>
template<typename GlobalIndexType = int64>
Creates a distributed::RowGatherer from a given collective communicator and index map.
@TODO: using a segmented array instead of the imap would probably be more general
- Template Parameters
-
| GlobalIndexType | the global index type of the index map |
- Parameters
-
| exec | the executor |
| coll_comm | the collective communicator |
| imap | the index map defining which rows to gather |
- Note
- The coll_comm and imap have to be compatible. The coll_comm must send and recv exactly as many rows as the imap defines.
-
This is a collective operation, all participating processes have to execute this operation.
- Returns
- a shared_ptr to the created distributed::RowGatherer
The documentation for this class was generated from the following file: