deal.II version GIT relicensing-2583-g40dc1f37f4 2025-02-09 02:10:00+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
mpi_noncontiguous_partitioner.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2020 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_mpi_noncontiguous_partitioner_h
16#define dealii_mpi_noncontiguous_partitioner_h
17
18#include <deal.II/base/config.h>
19
23
25
26
28
29namespace Utilities
30{
31 namespace MPI
32 {
48 {
49 public:
55
61 NoncontiguousPartitioner(const IndexSet &indexset_locally_owned,
62 const IndexSet &indexset_ghost,
64
75 const std::vector<types::global_dof_index> &indices_locally_owned,
76 const std::vector<types::global_dof_index> &indices_ghost,
78
103 template <typename Number, unsigned int n_components_templated = 1>
104 void
106 const ArrayView<const Number> &locally_owned_array,
107 const ArrayView<Number> &ghost_array,
108 const unsigned int n_components = 0) const;
109
124 template <typename Number, unsigned int n_components_templated = 1>
125 void
127 const unsigned int communication_channel,
128 const ArrayView<const Number> &locally_owned_array,
129 const ArrayView<Number> &temporary_storage,
130 const ArrayView<Number> &ghost_array,
131 std::vector<MPI_Request> &requests,
132 const unsigned int n_components = 0) const;
133
150 template <typename Number, unsigned int n_components_templated = 1>
151 void
153 const unsigned int communication_channel,
154 const ArrayView<const Number> &locally_owned_array,
155 const ArrayView<Number> &temporary_storage,
156 std::vector<MPI_Request> &requests,
157 const unsigned int n_components = 0) const;
158
173 template <typename Number, unsigned int n_components_templated = 1>
174 void
176 const ArrayView<const Number> &temporary_storage,
177 const ArrayView<Number> &ghost_array,
178 std::vector<MPI_Request> &requests,
179 const unsigned int n_components = 0) const;
180
189 template <typename Number>
190 void
192 const VectorOperation::values vector_operation,
193 const ArrayView<Number> &ghost_array,
194 const ArrayView<Number> &locally_owned_storage) const;
195
202 template <typename Number>
203 void
205 const unsigned int communication_channel,
206 const ArrayView<Number> &ghost_array,
207 const ArrayView<Number> &temporary_storage,
208 const ArrayView<Number> &locally_owned_storage,
209 std::vector<MPI_Request> &requests) const;
210
215 template <typename Number>
216 void
218 const VectorOperation::values vector_operation,
219 const unsigned int communication_channel,
220 const ArrayView<Number> &ghost_array,
221 const ArrayView<Number> &temporary_storage,
222 std::vector<MPI_Request> &requests) const;
223
230 template <typename Number>
231 void
233 const VectorOperation::values vector_operation,
234 const ArrayView<const Number> &temporary_storage,
235 const ArrayView<Number> &locally_owned_storage,
236 std::vector<MPI_Request> &requests) const;
237
242 std::pair<unsigned int, unsigned int>
243 n_targets() const;
244
250 unsigned int
252
258
263 get_mpi_communicator() const override;
264
265 void
266 reinit(const IndexSet &locally_owned_indices,
267 const IndexSet &ghost_indices,
268 const MPI_Comm communicator) override;
269
275 void
276 reinit(const std::vector<types::global_dof_index> &locally_owned_indices,
277 const std::vector<types::global_dof_index> &ghost_indices,
278 const MPI_Comm communicator);
279
280 private:
285
289 std::vector<unsigned int> send_ranks;
290
296 std::vector<types::global_dof_index> send_ptr;
297
304 std::vector<types::global_dof_index> send_indices;
305
309 std::vector<unsigned int> recv_ranks;
310
316 std::vector<types::global_dof_index> recv_ptr;
317
324 std::vector<types::global_dof_index> recv_indices;
325
335 mutable std::vector<std::uint8_t> buffers;
336
342 mutable std::vector<MPI_Request> requests;
343 };
344
345 } // namespace MPI
346} // namespace Utilities
347
349
350#endif
void reinit(const IndexSet &locally_owned_indices, const IndexSet &ghost_indices, const MPI_Comm communicator) override
void export_to_ghosted_array_start(const unsigned int communication_channel, const ArrayView< const Number > &locally_owned_array, const ArrayView< Number > &temporary_storage, std::vector< MPI_Request > &requests, const unsigned int n_components=0) const
void export_to_ghosted_array(const ArrayView< const Number > &locally_owned_array, const ArrayView< Number > &ghost_array, const unsigned int n_components=0) const
void import_from_ghosted_array(const VectorOperation::values vector_operation, const ArrayView< Number > &ghost_array, const ArrayView< Number > &locally_owned_storage) const
void import_from_ghosted_array_start(const VectorOperation::values vector_operation, const unsigned int communication_channel, const ArrayView< Number > &ghost_array, const ArrayView< Number > &temporary_storage, std::vector< MPI_Request > &requests) const
std::vector< types::global_dof_index > recv_ptr
std::vector< types::global_dof_index > send_ptr
void import_from_ghosted_array_finish(const VectorOperation::values vector_operation, const ArrayView< const Number > &temporary_storage, const ArrayView< Number > &locally_owned_storage, std::vector< MPI_Request > &requests) const
void export_to_ghosted_array(const unsigned int communication_channel, const ArrayView< const Number > &locally_owned_array, const ArrayView< Number > &temporary_storage, const ArrayView< Number > &ghost_array, std::vector< MPI_Request > &requests, const unsigned int n_components=0) const
std::vector< types::global_dof_index > recv_indices
std::pair< unsigned int, unsigned int > n_targets() const
std::vector< types::global_dof_index > send_indices
void export_to_ghosted_array_finish(const ArrayView< const Number > &temporary_storage, const ArrayView< Number > &ghost_array, std::vector< MPI_Request > &requests, const unsigned int n_components=0) const
void import_from_ghosted_array(const VectorOperation::values vector_operation, const unsigned int communication_channel, const ArrayView< Number > &ghost_array, const ArrayView< Number > &temporary_storage, const ArrayView< Number > &locally_owned_storage, std::vector< MPI_Request > &requests) const
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:518
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:519