DFT-EFE
 
Loading...
Searching...
No Matches
ProcessGrid.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 dftefeProcessGrid_h
17#define dftefeProcessGrid_h
18
19#include <utils/MPIWrapper.h>
20
21namespace dftefe
22{
23 namespace linearAlgebra
24 {
25 // Forward declaration of class ScaLAPACKMatrix for ProcessGrid
26 // template <typename NumberType>
27 // class ScaLAPACKMatrix;
28
52 {
53 public:
54 // // Declare class ScaLAPACK as friend to provide access to private
55 // members. template <typename NumberType> friend class ScaLAPACKMatrix;
56
64 const unsigned int n_rows,
65 const unsigned int n_columns);
66
85 const unsigned int n_rows_matrix,
86 const unsigned int n_columns_matrix,
87 const unsigned int row_block_size,
88 const unsigned int column_block_size);
89
94
98 const int &
99 get_blacs_context() const;
100
101
105 const int &
106 get_process_grid_rows() const;
107
111 const int &
113
119 const int &
120 get_this_process_row() const;
121
127 const int &
129
135 template <typename NumberType>
136 void
137 send_to_inactive(NumberType *value, const int count = 1) const;
138
142 const bool &
143 is_process_active() const;
144
145 const utils::mpi::MPIComm &
146 get_mpi_communicator() const;
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 inline const int &
217 {
218 return blacs_context;
219 }
220
221 inline const int &
223 {
224 return n_process_rows;
225 }
226
227 inline const int &
229 {
230 return n_process_columns;
231 }
232
233 inline const int &
235 {
236 return this_process_row;
237 }
238
239 inline const int &
241 {
242 return this_process_column;
243 }
244
245 inline const bool &
247 {
249 }
250
251 inline const utils::mpi::MPIComm &
253 {
254 return mpi_communicator;
255 }
256
257 } // namespace linearAlgebra
258} // end of namespace dftefe
259
260#endif
Definition: ProcessGrid.h:52
utils::mpi::MPIComm mpi_communicator
Definition: ProcessGrid.h:159
int this_process_row
Definition: ProcessGrid.h:198
const bool & is_process_active() const
Definition: ProcessGrid.h:246
~ProcessGrid()
Definition: ProcessGrid.cpp:240
const unsigned int this_mpi_process
Definition: ProcessGrid.h:176
const int & get_this_process_column() const
Definition: ProcessGrid.h:240
void send_to_inactive(NumberType *value, const int count=1) const
Definition: ProcessGrid.cpp:261
int this_process_column
Definition: ProcessGrid.h:205
const int & get_process_grid_rows() const
Definition: ProcessGrid.h:222
int blacs_context
Definition: ProcessGrid.h:171
const int & get_this_process_row() const
Definition: ProcessGrid.h:234
int n_process_rows
Definition: ProcessGrid.h:186
const int & get_process_grid_columns() const
Definition: ProcessGrid.h:228
const utils::mpi::MPIComm & get_mpi_communicator() const
Definition: ProcessGrid.h:252
int n_process_columns
Definition: ProcessGrid.h:191
const int & get_blacs_context() const
Definition: ProcessGrid.h:216
const unsigned int n_mpi_processes
Definition: ProcessGrid.h:181
utils::mpi::MPIComm mpi_communicator_inactive_with_root
Definition: ProcessGrid.h:165
bool mpi_process_is_active
Definition: ProcessGrid.h:210
int MPIComm
Definition: MPITypes.h:84
dealii includes
Definition: AtomFieldDataSpherical.cpp:31