5#ifndef GKO_PUBLIC_CORE_DISTRIBUTED_DENSE_COMMUNICATOR_HPP_
6#define GKO_PUBLIC_CORE_DISTRIBUTED_DENSE_COMMUNICATOR_HPP_
9#include <ginkgo/config.hpp>
15#include <ginkgo/core/base/mpi.hpp>
16#include <ginkgo/core/distributed/collective_communicator.hpp>
17#include <ginkgo/core/distributed/index_map.hpp>
21namespace experimental {
30class DenseCommunicator final :
public CollectiveCommunicator {
34 DenseCommunicator(
const DenseCommunicator& other) =
default;
36 DenseCommunicator(DenseCommunicator&& other);
38 DenseCommunicator& operator=(
const DenseCommunicator& other) =
default;
40 DenseCommunicator& operator=(DenseCommunicator&& other);
62 template <
typename LocalIndexType,
typename GlobalIndexType>
69 const distributed::index_map_variant& imap)
const override;
94 const DenseCommunicator& b);
102 const DenseCommunicator& b);
111 request i_all_to_all_v_impl(std::shared_ptr<const Executor> exec,
112 const void* send_buffer, MPI_Datatype send_type,
114 MPI_Datatype recv_type)
const override;
119 std::vector<comm_index_type> send_sizes_;
120 std::vector<comm_index_type> send_offsets_;
121 std::vector<comm_index_type> recv_sizes_;
122 std::vector<comm_index_type> recv_offsets_;
This class defines mappings between global and local indices.
Definition index_map.hpp:68
request i_all_to_all_v(std::shared_ptr< const Executor > exec, const SendType *send_buffer, RecvType *recv_buffer) const
Non-blocking all-to-all communication.
Definition collective_communicator.hpp:118
std::unique_ptr< CollectiveCommunicator > create_inverse() const override
Creates the inverse DenseCommunicator by switching sources and destinations.
friend bool operator!=(const DenseCommunicator &a, const DenseCommunicator &b)
Compares two communicators for inequality.
DenseCommunicator(communicator base)
Default constructor with empty communication pattern.
comm_index_type get_recv_size() const override
Get the total number of received elements this communication patterns expects.
std::unique_ptr< CollectiveCommunicator > create_with_same_type(communicator base, const distributed::index_map_variant &imap) const override
Creates a new CollectiveCommunicator with the same dynamic type.
comm_index_type get_send_size() const override
Get the total number of sent elements this communication patterns expects.
friend bool operator==(const DenseCommunicator &a, const DenseCommunicator &b)
Compares two communicators for equality.
DenseCommunicator(communicator base, const distributed::index_map< LocalIndexType, GlobalIndexType > &imap)
Create a DenseCommunicator from an index map.
A thin wrapper of MPI_Comm that supports most MPI calls.
Definition mpi.hpp:416
The request class is a light, move-only wrapper around the MPI_Request handle.
Definition mpi.hpp:327
The mpi namespace, contains wrapper for many MPI functions.
Definition mpi.hpp:36
int comm_index_type
Index type for enumerating processes in a distributed application.
Definition types.hpp:967
The Ginkgo namespace.
Definition abstract_factory.hpp:20