Reference documentation for deal.II version 9.2.0
\(\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 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 
21 #include <deal.II/base/mpi.h>
23 #include <deal.II/base/mpi_tags.h>
24 
27 
28 
30 
31 namespace Utilities
32 {
33  namespace MPI
34  {
43  {
44  public:
49  NoncontiguousPartitioner() = default;
50 
56  NoncontiguousPartitioner(const IndexSet &indexset_locally_owned,
57  const IndexSet &indexset_ghost,
58  const MPI_Comm &communicator);
59 
70  const std::vector<types::global_dof_index> &indices_locally_owned,
71  const std::vector<types::global_dof_index> &indices_ghost,
72  const MPI_Comm & communicator);
73 
90  template <typename Number>
91  void
93  const ArrayView<const Number> &locally_owned_array,
94  const ArrayView<Number> & ghost_array) const;
95 
109  template <typename Number>
110  void
112  const unsigned int communication_channel,
113  const ArrayView<const Number> &locally_owned_array,
114  const ArrayView<Number> & temporary_storage,
115  const ArrayView<Number> & ghost_array,
116  std::vector<MPI_Request> & requests) const;
117 
131  template <typename Number>
132  void
134  const unsigned int communication_channel,
135  const ArrayView<const Number> &locally_owned_array,
136  const ArrayView<Number> & temporary_storage,
137  std::vector<MPI_Request> & requests) const;
138 
153  template <typename Number>
154  void
156  const ArrayView<const Number> &temporary_storage,
157  const ArrayView<Number> & ghost_array,
158  std::vector<MPI_Request> & requests) const;
159 
164  std::pair<unsigned int, unsigned int>
165  n_targets();
166 
172 
176  const MPI_Comm &
177  get_mpi_communicator() const override;
178 
182  void
183  reinit(const IndexSet &indexset_locally_owned,
184  const IndexSet &indexset_ghost,
185  const MPI_Comm &communicator) override;
186 
190  void
191  reinit(const std::vector<types::global_dof_index> &indices_locally_owned,
192  const std::vector<types::global_dof_index> &indices_ghost,
193  const MPI_Comm & communicator);
194 
195  private:
200 
204  std::vector<unsigned int> send_ranks;
205 
211  std::vector<types::global_dof_index> send_ptr;
212 
219  std::vector<types::global_dof_index> send_indices;
220 
224  std::vector<unsigned int> recv_ranks;
225 
231  std::vector<types::global_dof_index> recv_ptr;
232 
239  std::vector<types::global_dof_index> recv_indices;
240 
250  mutable std::vector<uint8_t> buffers;
251 
257  mutable std::vector<MPI_Request> requests;
258  };
259 
260  } // namespace MPI
261 } // namespace Utilities
262 
264 
265 #endif
IndexSet
Definition: index_set.h:74
ArrayView
Definition: array_view.h:77
Utilities::MPI::NoncontiguousPartitioner::recv_ranks
std::vector< unsigned int > recv_ranks
Definition: mpi_noncontiguous_partitioner.h:224
MPI_Comm
Utilities::MPI::NoncontiguousPartitioner::memory_consumption
types::global_dof_index memory_consumption()
vector_space_vector.h
Utilities::MPI::NoncontiguousPartitioner::n_targets
std::pair< unsigned int, unsigned int > n_targets()
communication_pattern_base.h
Utilities::MPI::NoncontiguousPartitioner::send_ranks
std::vector< unsigned int > send_ranks
Definition: mpi_noncontiguous_partitioner.h:204
mpi_tags.h
mpi.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
Utilities::MPI::NoncontiguousPartitioner::recv_ptr
std::vector< types::global_dof_index > recv_ptr
Definition: mpi_noncontiguous_partitioner.h:231
Utilities::MPI::NoncontiguousPartitioner
Definition: mpi_noncontiguous_partitioner.h:41
Utilities::MPI::NoncontiguousPartitioner::NoncontiguousPartitioner
NoncontiguousPartitioner()=default
Utilities::MPI::NoncontiguousPartitioner::buffers
std::vector< uint8_t > buffers
Definition: mpi_noncontiguous_partitioner.h:250
Utilities::MPI::NoncontiguousPartitioner::export_to_ghosted_array
void export_to_ghosted_array(const ArrayView< const Number > &locally_owned_array, const ArrayView< Number > &ghost_array) const
Utilities::MPI::NoncontiguousPartitioner::export_to_ghosted_array_start
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
Utilities::MPI::NoncontiguousPartitioner::recv_indices
std::vector< types::global_dof_index > recv_indices
Definition: mpi_noncontiguous_partitioner.h:239
Utilities::MPI::NoncontiguousPartitioner::send_indices
std::vector< types::global_dof_index > send_indices
Definition: mpi_noncontiguous_partitioner.h:219
Utilities::MPI::NoncontiguousPartitioner::get_mpi_communicator
const MPI_Comm & get_mpi_communicator() const override
unsigned int
Utilities::MPI::NoncontiguousPartitioner::send_ptr
std::vector< types::global_dof_index > send_ptr
Definition: mpi_noncontiguous_partitioner.h:211
Utilities::MPI::NoncontiguousPartitioner::requests
std::vector< MPI_Request > requests
Definition: mpi_noncontiguous_partitioner.h:257
Utilities::MPI::NoncontiguousPartitioner::reinit
void reinit(const IndexSet &indexset_locally_owned, const IndexSet &indexset_ghost, const MPI_Comm &communicator) override
Utilities::MPI::NoncontiguousPartitioner::communicator
MPI_Comm communicator
Definition: mpi_noncontiguous_partitioner.h:199
config.h
Utilities::MPI::NoncontiguousPartitioner::export_to_ghosted_array_finish
void export_to_ghosted_array_finish(const ArrayView< const Number > &temporary_storage, const ArrayView< Number > &ghost_array, std::vector< MPI_Request > &requests) const
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
LinearAlgebra::CommunicationPatternBase
Definition: communication_pattern_base.h:42
Utilities
Definition: cuda.h:31
mpi_compute_index_owner_internal.h