Ginkgo Generated from branch based on main. Ginkgo version 1.9.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
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:
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_
A base class for distributed objects.
Definition base.hpp:32
DistributedBase & operator=(const DistributedBase &)
Copy assignment that doesn't change the used mpi::communicator.
Definition base.hpp:44
DistributedBase & operator=(DistributedBase &&) noexcept
Move assignment that doesn't change the used mpi::communicator.
Definition base.hpp:50
mpi::communicator get_communicator() const
Access the used mpi::communicator.
Definition base.hpp:56
A thin wrapper of MPI_Comm that supports most MPI calls.
Definition mpi.hpp:408
The Ginkgo namespace.
Definition abstract_factory.hpp:20
STL namespace.