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:
156  ProcessGrid(MPI_Comm mpi_communicator,
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
unsigned int get_process_grid_rows() const
const unsigned int this_mpi_process
Definition: process_grid.h:179
MPI_Comm mpi_communicator_inactive_with_root
Definition: process_grid.h:168
void send_to_inactive(NumberType *value, const int count=1) const
unsigned int get_process_grid_columns() const
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
Definition: cuda.h:31
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
const unsigned int n_mpi_processes
Definition: process_grid.h:184
ProcessGrid(MPI_Comm mpi_communicator, const unsigned int n_rows, const unsigned int n_columns)
static const bool value
int get_this_process_column() const