ginkgo/core/distributed/neighborhood_communicator.hpp Source File

ginkgo/core/distributed/neighborhood_communicator.hpp Source File#

Reference API: ginkgo/core/distributed/neighborhood_communicator.hpp Source File
Reference API
neighborhood_communicator.hpp
1// SPDX-FileCopyrightText: 2017 - 2025 The Ginkgo authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef GKO_PUBLIC_CORE_DISTRIBUTED_NEIGHBORHOOD_COMMUNICATOR_HPP_
6#define GKO_PUBLIC_CORE_DISTRIBUTED_NEIGHBORHOOD_COMMUNICATOR_HPP_
7
8
9#include <ginkgo/config.hpp>
10
11
12#if GINKGO_BUILD_MPI
13
14
15#include <ginkgo/core/base/mpi.hpp>
16#include <ginkgo/core/distributed/collective_communicator.hpp>
17#include <ginkgo/core/distributed/index_map.hpp>
18
19
20namespace gko {
21namespace experimental {
22namespace mpi {
23
24
34public:
36
38
40
41 NeighborhoodCommunicator& operator=(const NeighborhoodCommunicator& other) =
42 default;
43
45
52
66 template <typename LocalIndexType, typename GlobalIndexType>
68 communicator base,
70
71 std::unique_ptr<CollectiveCommunicator> create_with_same_type(
72 communicator base,
73 const distributed::index_map_variant& imap) const override;
74
81 [[nodiscard]] std::unique_ptr<CollectiveCommunicator> create_inverse()
82 const override;
83
84 [[nodiscard]] comm_index_type get_recv_size() const override;
85
86 [[nodiscard]] comm_index_type get_send_size() const override;
87
99
106 const NeighborhoodCommunicator& b);
107
108protected:
115 request i_all_to_all_v_impl(std::shared_ptr<const Executor> exec,
116 const void* send_buffer, MPI_Datatype send_type,
117 void* recv_buffer,
118 MPI_Datatype recv_type) const override;
119
120private:
121 communicator comm_;
122
123 std::vector<comm_index_type> send_sizes_;
124 std::vector<comm_index_type> send_offsets_;
125 std::vector<comm_index_type> recv_sizes_;
126 std::vector<comm_index_type> recv_offsets_;
127};
128
129
130} // namespace mpi
131} // namespace experimental
132} // namespace gko
133
134
135#endif
136#endif // GKO_PUBLIC_CORE_DISTRIBUTED_NEIGHBORHOOD_COMMUNICATOR_HPP_
This class defines mappings between global and local indices.
Definition index_map.hpp:68
Definition collective_communicator.hpp:30
request i_all_to_all_v(std::shared_ptr< const Executor > exec, const SendType *send_buffer, RecvType *recv_buffer) const
Definition collective_communicator.hpp:118
Definition neighborhood_communicator.hpp:33
std::unique_ptr< CollectiveCommunicator > create_inverse() const override
friend bool operator!=(const NeighborhoodCommunicator &a, const NeighborhoodCommunicator &b)
friend bool operator==(const NeighborhoodCommunicator &a, const NeighborhoodCommunicator &b)
comm_index_type get_recv_size() const override
std::unique_ptr< CollectiveCommunicator > create_with_same_type(communicator base, const distributed::index_map_variant &imap) const override
request i_all_to_all_v_impl(std::shared_ptr< const Executor > exec, const void *send_buffer, MPI_Datatype send_type, void *recv_buffer, MPI_Datatype recv_type) const override
comm_index_type get_send_size() const override
NeighborhoodCommunicator(communicator base, const distributed::index_map< LocalIndexType, GlobalIndexType > &imap)
Definition mpi.hpp:327
The Ginkgo namespace.
Definition abstract_factory.hpp:20