Reference documentation for deal.II version GIT a3f17f8a20 2023-06-02 10: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\}}\)
process_grid.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2017 - 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_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  {
62  {
63  public:
64  // Declare class ScaLAPACK as friend to provide access to private members.
65  template <typename NumberType>
66  friend class ::ScaLAPACKMatrix;
67 
74  ProcessGrid(const MPI_Comm mpi_communicator,
75  const unsigned int n_rows,
76  const unsigned int n_columns);
77 
95  ProcessGrid(const MPI_Comm mpi_communicator,
96  const unsigned int n_rows_matrix,
97  const unsigned int n_columns_matrix,
98  const unsigned int row_block_size,
99  const unsigned int column_block_size);
100 
104  ~ProcessGrid();
105 
109  unsigned int
111 
115  unsigned int
117 
123  int
125 
131  int
133 
139  template <typename NumberType>
140  void
141  send_to_inactive(NumberType *value, const int count = 1) const;
142 
146  bool
148 
149  private:
154  ProcessGrid(const MPI_Comm mpi_communicator,
155  const std::pair<unsigned int, unsigned int> &grid_dimensions);
156 
161 
167 
173 
177  const unsigned int this_mpi_process;
178 
182  const unsigned int n_mpi_processes;
183 
188 
193 
200 
207 
212  };
213 
214  /*--------------------- Inline functions --------------------------------*/
215 
216 # ifndef DOXYGEN
217 
218  inline unsigned int
220  {
221  return n_process_rows;
222  }
223 
224 
225 
226  inline unsigned int
228  {
229  return n_process_columns;
230  }
231 
232 
233 
234  inline int
236  {
237  return this_process_row;
238  }
239 
240 
241 
242  inline int
244  {
245  return this_process_column;
246  }
247 
248 
249 
250  inline bool
252  {
253  return mpi_process_is_active;
254  }
255 
256 
257 # endif // ifndef DOXYGEN
258 
259  } // end of namespace MPI
260 
261 } // end of namespace Utilities
262 
263 
265 
266 #endif // DEAL_II_WITH_SCALAPACK
267 
268 #endif
ProcessGrid(const MPI_Comm mpi_communicator, const unsigned int n_rows, const unsigned int n_columns)
MPI_Comm mpi_communicator_inactive_with_root
Definition: process_grid.h:166
void send_to_inactive(NumberType *value, const int count=1) const
unsigned int get_process_grid_rows() const
const unsigned int n_mpi_processes
Definition: process_grid.h:182
unsigned int get_process_grid_columns() const
int get_this_process_column() const
const unsigned int this_mpi_process
Definition: process_grid.h:177
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:474
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:475