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
partition_helpers.hpp
1// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef GKO_PUBLIC_CORE_DISTRIBUTED_PARTITION_HELPERS_HPP_
6#define GKO_PUBLIC_CORE_DISTRIBUTED_PARTITION_HELPERS_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/base/range.hpp>
17
18
19namespace gko {
20namespace experimental {
21namespace distributed {
22
23template <typename LocalIndexType, typename GlobalIndexType>
24class Partition;
25
26
43template <typename LocalIndexType, typename GlobalIndexType>
44std::unique_ptr<Partition<LocalIndexType, GlobalIndexType>>
45build_partition_from_local_range(std::shared_ptr<const Executor> exec,
46 mpi::communicator comm, span local_range);
47
48
61template <typename LocalIndexType, typename GlobalIndexType>
62std::unique_ptr<Partition<LocalIndexType, GlobalIndexType>>
63build_partition_from_local_size(std::shared_ptr<const Executor> exec,
64 mpi::communicator comm, size_type local_size);
65
66
67} // namespace distributed
68} // namespace experimental
69} // namespace gko
70
71
72#endif // GINKGO_BUILD_MPI
73#endif // GKO_PUBLIC_CORE_DISTRIBUTED_PARTITION_HELPERS_HPP_
Represents a partition of a range of indices [0, size) into a disjoint set of parts.
Definition partition.hpp:82
A thin wrapper of MPI_Comm that supports most MPI calls.
Definition mpi.hpp:408
The distributed namespace.
Definition precision_dispatch.hpp:309
std::unique_ptr< Partition< LocalIndexType, GlobalIndexType > > build_partition_from_local_size(std::shared_ptr< const Executor > exec, mpi::communicator comm, size_type local_size)
Builds a partition from a local size.
std::unique_ptr< Partition< LocalIndexType, GlobalIndexType > > build_partition_from_local_range(std::shared_ptr< const Executor > exec, mpi::communicator comm, span local_range)
Builds a partition from a local range.
The Ginkgo namespace.
Definition abstract_factory.hpp:20
std::size_t size_type
Integral type used for allocation quantities.
Definition types.hpp:89
A span is a lightweight structure used to create sub-ranges from other ranges.
Definition range.hpp:46