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\}}\)
process_grid.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2017 - 2019 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_process_grid_h
17 #define dealii_process_grid_h
18 
19 #include <deal.II/base/config.h>
20 
22 #include <deal.II/base/mpi.h>
23 
24 #ifdef DEAL_II_WITH_SCALAPACK
25 
27 
28 
29 // Forward declaration of class ScaLAPACKMatrix for ProcessGrid
30 # ifndef DOXYGEN
31 template <typename NumberType>
32 class ScaLAPACKMatrix;
33 # endif
34 
35 namespace Utilities
36 {
37  namespace MPI
38  {
64  {
65  public:
66  // Declare class ScaLAPACK as friend to provide access to private members.
67  template <typename NumberType>
68  friend class ::ScaLAPACKMatrix;
69 
77  const unsigned int n_rows,
78  const unsigned int n_columns);
79 
98  const unsigned int n_rows_matrix,
99  const unsigned int n_columns_matrix,
100  const unsigned int row_block_size,
101  const unsigned int column_block_size);
102 
106  ~ProcessGrid();
107 
111  unsigned int
112  get_process_grid_rows() const;
113 
117  unsigned int
118  get_process_grid_columns() const;
119 
125  int
126  get_this_process_row() const;
127 
133  int
134  get_this_process_column() const;
135 
141  template <typename NumberType>
142  void
143  send_to_inactive(NumberType *value, const int count = 1) const;
144 
148  bool
149  is_process_active() const;
150 
151  private:
157  const std::pair<unsigned int, unsigned int> &grid_dimensions);
158 
163 
169 
175 
179  const unsigned int this_mpi_process;
180 
184  const unsigned int n_mpi_processes;
185 
190 
195 
202 
209 
214  };
215 
216  /*--------------------- Inline functions --------------------------------*/
217 
218 # ifndef DOXYGEN
219 
220  inline unsigned int
222  {
223  return n_process_rows;
224  }
225 
226 
227 
228  inline unsigned int
230  {
231  return n_process_columns;
232  }
233 
234 
235 
236  inline int
238  {
239  return this_process_row;
240  }
241 
242 
243 
244  inline int
246  {
247  return this_process_column;
248  }
249 
250 
251 
252  inline bool
254  {
255  return mpi_process_is_active;
256  }
257 
258 
259 # endif // ifndef DOXYGEN
260 
261  } // end of namespace MPI
262 
263 } // end of namespace Utilities
264 
265 
267 
268 #endif // DEAL_II_WITH_SCALAPACK
269 
270 #endif
Utilities::MPI::ProcessGrid::n_mpi_processes
const unsigned int n_mpi_processes
Definition: process_grid.h:184
Utilities::MPI::ProcessGrid::n_process_rows
int n_process_rows
Definition: process_grid.h:189
Utilities::MPI::ProcessGrid::mpi_communicator
MPI_Comm mpi_communicator
Definition: process_grid.h:162
MPI_Comm
Utilities::MPI::ProcessGrid::this_mpi_process
const unsigned int this_mpi_process
Definition: process_grid.h:179
Utilities::MPI::ProcessGrid::is_process_active
bool is_process_active() const
Utilities::MPI::ProcessGrid::get_process_grid_rows
unsigned int get_process_grid_rows() const
ScaLAPACKMatrix
Definition: scalapack.h:77
Utilities::MPI::ProcessGrid
Definition: process_grid.h:63
mpi.h
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
Utilities::MPI::ProcessGrid::~ProcessGrid
~ProcessGrid()
Definition: process_grid.cc:232
Utilities::MPI::ProcessGrid::this_process_row
int this_process_row
Definition: process_grid.h:201
exceptions.h
Utilities::MPI::ProcessGrid::get_this_process_column
int get_this_process_column() const
Utilities::MPI::ProcessGrid::blacs_context
int blacs_context
Definition: process_grid.h:174
value
static const bool value
Definition: dof_tools_constraints.cc:433
Utilities::MPI::ProcessGrid::ProcessGrid
ProcessGrid(MPI_Comm mpi_communicator, const unsigned int n_rows, const unsigned int n_columns)
Definition: process_grid.cc:224
Utilities::MPI::ProcessGrid::n_process_columns
int n_process_columns
Definition: process_grid.h:194
Utilities::MPI::ProcessGrid::get_this_process_row
int get_this_process_row() const
Utilities::MPI::ProcessGrid::send_to_inactive
void send_to_inactive(NumberType *value, const int count=1) const
Definition: process_grid.cc:245
Utilities::MPI::ProcessGrid::mpi_communicator_inactive_with_root
MPI_Comm mpi_communicator_inactive_with_root
Definition: process_grid.h:168
Utilities::MPI::ProcessGrid::mpi_process_is_active
bool mpi_process_is_active
Definition: process_grid.h:213
Utilities::MPI::ProcessGrid::get_process_grid_columns
unsigned int get_process_grid_columns() const
config.h
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
Utilities::MPI::ProcessGrid::this_process_column
int this_process_column
Definition: process_grid.h:208
Utilities
Definition: cuda.h:31