deal.II version GIT relicensing-2291-g668cd86249 2024-12-24 11:30: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
22
24
25
27
28namespace Utilities
29{
30 namespace MPI
31 {
47 {
48 public:
54
60 NoncontiguousPartitioner(const IndexSet &indexset_locally_owned,
61 const IndexSet &indexset_ghost,
63
74 const std::vector<types::global_dof_index> &indices_locally_owned,
75 const std::vector<types::global_dof_index> &indices_ghost,
77
102 template <typename Number, unsigned int n_components_templated = 1>
103 void
105 const ArrayView<const Number> &locally_owned_array,
106 const ArrayView<Number> &ghost_array,
107 const unsigned int n_components = 0) const;
108
123 template <typename Number, unsigned int n_components_templated = 1>
124 void
126 const unsigned int communication_channel,
127 const ArrayView<const Number> &locally_owned_array,
128 const ArrayView<Number> &temporary_storage,
129 const ArrayView<Number> &ghost_array,
130 std::vector<MPI_Request> &requests,
131 const unsigned int n_components = 0) const;
132
149 template <typename Number, unsigned int n_components_templated = 1>
150 void
152 const unsigned int communication_channel,
153 const ArrayView<const Number> &locally_owned_array,
154 const ArrayView<Number> &temporary_storage,
155 std::vector<MPI_Request> &requests,
156 const unsigned int n_components = 0) const;
157
172 template <typename Number, unsigned int n_components_templated = 1>
173 void
175 const ArrayView<const Number> &temporary_storage,
176 const ArrayView<Number> &ghost_array,
177 std::vector<MPI_Request> &requests,
178 const unsigned int n_components = 0) const;
179
188 template <typename Number>
189 void
191 const VectorOperation::values vector_operation,
192 const ArrayView<Number> &ghost_array,
193 const ArrayView<Number> &locally_owned_storage) const;
194
201 template <typename Number>
202 void
204 const unsigned int communication_channel,
205 const ArrayView<Number> &ghost_array,
206 const ArrayView<Number> &temporary_storage,
207 const ArrayView<Number> &locally_owned_storage,
208 std::vector<MPI_Request> &requests) const;
209
214 template <typename Number>
215 void
217 const VectorOperation::values vector_operation,
218 const unsigned int communication_channel,
219 const ArrayView<Number> &ghost_array,
220 const ArrayView<Number> &temporary_storage,
221 std::vector<MPI_Request> &requests) const;
222
229 template <typename Number>
230 void
232 const VectorOperation::values vector_operation,
233 const ArrayView<const Number> &temporary_storage,
234 const ArrayView<Number> &locally_owned_storage,
235 std::vector<MPI_Request> &requests) const;
236
241 std::pair<unsigned int, unsigned int>
242 n_targets() const;
243
249 unsigned int
251
257
262 get_mpi_communicator() const override;
263
264 void
265 reinit(const IndexSet &locally_owned_indices,
266 const IndexSet &ghost_indices,
267 const MPI_Comm communicator) override;
268
274 void
275 reinit(const std::vector<types::global_dof_index> &locally_owned_indices,
276 const std::vector<types::global_dof_index> &ghost_indices,
277 const MPI_Comm communicator);
278
279 private:
284
288 std::vector<unsigned int> send_ranks;
289
295 std::vector<types::global_dof_index> send_ptr;
296
303 std::vector<types::global_dof_index> send_indices;
304
308 std::vector<unsigned int> recv_ranks;
309
315 std::vector<types::global_dof_index> recv_ptr;
316
323 std::vector<types::global_dof_index> recv_indices;
324
334 mutable std::vector<std::uint8_t> buffers;
335
341 mutable std::vector<MPI_Request> requests;
342 };
343
344 } // namespace MPI
345} // namespace Utilities
346
348
349#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:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499