deal.II version GIT relicensing-1929-g70a5450eef 2024-10-03 18:00:00+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\}}\)
Loading...
Searching...
No Matches
process_grid.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2017 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_process_grid_h
16#define dealii_process_grid_h
17
18#include <deal.II/base/config.h>
19
21#include <deal.II/base/mpi.h>
22
23#ifdef DEAL_II_WITH_SCALAPACK
24
26
27
28// Forward declaration of class ScaLAPACKMatrix for ProcessGrid
29# ifndef DOXYGEN
30template <typename NumberType>
31class ScaLAPACKMatrix;
32# endif
33
34namespace Utilities
35{
36 namespace MPI
37 {
61 {
62 public:
63 // Declare class ScaLAPACK as friend to provide access to private members.
64 template <typename NumberType>
65 friend class ::ScaLAPACKMatrix;
66
74 const unsigned int n_rows,
75 const unsigned int n_columns);
76
95 const unsigned int n_rows_matrix,
96 const unsigned int n_columns_matrix,
97 const unsigned int row_block_size,
98 const unsigned int column_block_size);
99
103 ~ProcessGrid();
104
108 unsigned int
110
114 unsigned int
116
122 int
124
130 int
132
138 template <typename NumberType>
139 void
140 send_to_inactive(NumberType *value, const int count = 1) const;
141
145 bool
147
148 private:
154 const std::pair<unsigned int, unsigned int> &grid_dimensions);
155
160
166
172
176 const unsigned int this_mpi_process;
177
181 const unsigned int n_mpi_processes;
182
187
192
199
206
211 };
212
213 /*--------------------- Inline functions --------------------------------*/
214
215# ifndef DOXYGEN
216
217 inline unsigned int
219 {
220 return n_process_rows;
221 }
222
223
224
225 inline unsigned int
227 {
228 return n_process_columns;
229 }
230
231
232
233 inline int
235 {
236 return this_process_row;
237 }
238
239
240
241 inline int
243 {
244 return this_process_column;
245 }
246
247
248
249 inline bool
251 {
253 }
254
255
256# endif // ifndef DOXYGEN
257
258 } // end of namespace MPI
259
260} // end of namespace Utilities
261
262
264
265#endif // DEAL_II_WITH_SCALAPACK
266
267#endif
MPI_Comm mpi_communicator_inactive_with_root
void send_to_inactive(NumberType *value, const int count=1) const
unsigned int get_process_grid_rows() const
const unsigned int n_mpi_processes
unsigned int get_process_grid_columns() const
int get_this_process_column() const
const unsigned int this_mpi_process
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499