Reference documentation for deal.II version GIT c415589cf0 2022-08-14 18:50:02+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\}}\)
mpi_noncontiguous_partitioner.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2020 - 2021 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_mpi_noncontiguous_partitioner_h
17 #define dealii_mpi_noncontiguous_partitioner_h
18 
19 #include <deal.II/base/config.h>
20 
22 #include <deal.II/base/mpi.h>
24 #include <deal.II/base/mpi_tags.h>
25 
27 
28 
30 
31 namespace Utilities
32 {
33  namespace MPI
34  {
41  {
42  public:
48 
54  NoncontiguousPartitioner(const IndexSet &indexset_locally_owned,
55  const IndexSet &indexset_ghost,
56  const MPI_Comm &communicator);
57 
68  const std::vector<types::global_dof_index> &indices_locally_owned,
69  const std::vector<types::global_dof_index> &indices_ghost,
70  const MPI_Comm & communicator);
71 
88  template <typename Number>
89  void
91  const ArrayView<const Number> &locally_owned_array,
92  const ArrayView<Number> & ghost_array) const;
93 
108  template <typename Number>
109  void
111  const unsigned int communication_channel,
112  const ArrayView<const Number> &locally_owned_array,
113  const ArrayView<Number> & temporary_storage,
114  const ArrayView<Number> & ghost_array,
115  std::vector<MPI_Request> & requests) const;
116 
133  template <typename Number>
134  void
136  const unsigned int communication_channel,
137  const ArrayView<const Number> &locally_owned_array,
138  const ArrayView<Number> & temporary_storage,
139  std::vector<MPI_Request> & requests) const;
140 
155  template <typename Number>
156  void
158  const ArrayView<const Number> &temporary_storage,
159  const ArrayView<Number> & ghost_array,
160  std::vector<MPI_Request> & requests) const;
161 
166  std::pair<unsigned int, unsigned int>
167  n_targets() const;
168 
174  unsigned int
175  temporary_storage_size() const;
176 
182 
186  const MPI_Comm &
187  get_mpi_communicator() const override;
188 
192  void
193  reinit(const IndexSet &indexset_locally_owned,
194  const IndexSet &indexset_ghost,
195  const MPI_Comm &communicator) override;
196 
200  void
201  reinit(const std::vector<types::global_dof_index> &indices_locally_owned,
202  const std::vector<types::global_dof_index> &indices_ghost,
203  const MPI_Comm & communicator);
204 
205  private:
209  MPI_Comm communicator;
210 
214  std::vector<unsigned int> send_ranks;
215 
221  std::vector<types::global_dof_index> send_ptr;
222 
229  std::vector<types::global_dof_index> send_indices;
230 
234  std::vector<unsigned int> recv_ranks;
235 
241  std::vector<types::global_dof_index> recv_ptr;
242 
249  std::vector<types::global_dof_index> recv_indices;
250 
260  mutable std::vector<std::uint8_t> buffers;
261 
267  mutable std::vector<MPI_Request> requests;
268  };
269 
270  } // namespace MPI
271 } // namespace Utilities
272 
274 
275 #endif
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
const MPI_Comm & get_mpi_communicator() const override
std::vector< types::global_dof_index > recv_ptr
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
std::vector< types::global_dof_index > send_ptr
void export_to_ghosted_array_finish(const ArrayView< const Number > &temporary_storage, const ArrayView< Number > &ghost_array, std::vector< MPI_Request > &requests) const
std::vector< types::global_dof_index > recv_indices
std::pair< unsigned int, unsigned int > n_targets() const
void export_to_ghosted_array(const ArrayView< const Number > &locally_owned_array, const ArrayView< Number > &ghost_array) const
void reinit(const IndexSet &indexset_locally_owned, const IndexSet &indexset_ghost, const MPI_Comm &communicator) override
std::vector< types::global_dof_index > send_indices
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
unsigned int global_dof_index
Definition: types.h:76