Ginkgo: ginkgo/core/distributed/base.hpp Source File

| Ginkgo Generated from branch based on main. Ginkgo version 1.11.0 A numerical linear algebra library targeting many-core architectures

Loading...
Searching...
No Matches
base.hpp
1// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef GKO_PUBLIC_CORE_DISTRIBUTED_BASE_HPP_
6#define GKO_PUBLIC_CORE_DISTRIBUTED_BASE_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
17
18namespace gko {
19namespace experimental {
20namespace distributed {
21
22
32 class DistributedBase {
33public:
34 virtual ~DistributedBase() = default;
35
36 DistributedBase(const DistributedBase& other) = default;
37
38 DistributedBase(DistributedBase&& other) = default;
39
44 DistributedBase& operator=(const DistributedBase&) { return *this; }
45
50 DistributedBase& operator=(DistributedBase&&) noexcept { return *this; }
51
56 mpi::communicator get_communicator() const { return comm_; }
57
58protected:
63 explicit DistributedBase(mpi::communicator comm) : comm_{std::move(comm)} {}
64
65private:
66 mpi::communicator comm_;
67};
68
69
70} // namespace distributed
71} // namespace experimental
72} // namespace gko
73
74
75#endif // GINKGO_BUILD_MPI
76
77
78#endif // GKO_PUBLIC_CORE_DISTRIBUTED_BASE_HPP_
gko::experimental::distributed::DistributedBase
A base class for distributed objects.
Definition base.hpp:32
gko::experimental::distributed::DistributedBase::operator=
DistributedBase & operator=(const DistributedBase &)
Copy assignment that doesn't change the used mpi::communicator.
Definition base.hpp:44
gko::experimental::distributed::DistributedBase::operator=
DistributedBase & operator=(DistributedBase &&) noexcept
Move assignment that doesn't change the used mpi::communicator.
Definition base.hpp:50
gko::experimental::distributed::DistributedBase::get_communicator
mpi::communicator get_communicator() const
Access the used mpi::communicator.
Definition base.hpp:56
gko::experimental::mpi::communicator
A thin wrapper of MPI_Comm that supports most MPI calls.
Definition mpi.hpp:419
gko::experimental::distributed
The distributed namespace.
Definition polymorphic_object.hpp:19
gko
The Ginkgo namespace.
Definition abstract_factory.hpp:20
std
STL namespace.