DFT-EFE
 
Loading...
Searching...
No Matches
ChebyshevFilteredEigenSolver.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2021. *
3 * The Regents of the University of Michigan and DFT-EFE developers. *
4 * *
5 * This file is part of the DFT-EFE code. *
6 * *
7 * DFT-EFE is free software: you can redistribute it and/or modify *
8 * it under the terms of the Lesser GNU General Public License as *
9 * published by the Free Software Foundation, either version 3 of *
10 * the License, or (at your option) any later version. *
11 * *
12 * DFT-EFE is distributed in the hope that it will be useful, but *
13 * WITHOUT ANY WARRANTY; without even the implied warranty *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
15 * See the Lesser GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License at the top level of DFT-EFE distribution. If not, see *
19 * <https://www.gnu.org/licenses/>. *
20 ******************************************************************************/
21
22/*
23 * @author Avirup Sircar
24 */
25
26#ifndef dftefeChebyshevFilteredEigenSolver_h
27#define dftefeChebyshevFilteredEigenSolver_h
28
38#include <memory>
39#include <utils/Profiler.h>
41
42namespace dftefe
43{
44 namespace linearAlgebra
45 {
47 {
51 };
52
64 template <typename ValueTypeOperator,
65 typename ValueTypeOperand,
66 utils::MemorySpace memorySpace>
68 : public HermitianIterativeEigenSolver<ValueTypeOperator,
69 ValueTypeOperand,
70 memorySpace>
71 {
72 public:
79 using ValueType =
82 using OpContext =
83 typename HermitianIterativeEigenSolver<ValueTypeOperator,
84 ValueTypeOperand,
85 memorySpace>::OpContext;
86
87 public:
92 const double wantedSpectrumLowerBound,
93 const double wantedSpectrumUpperBound,
94 const double unWantedSpectrumUpperBound,
95 const double polynomialDegree,
96 const double illConditionTolerance,
97 std::shared_ptr<const utils::mpi::MPIPatternP2P<memorySpace>>
98 mpiPatternP2P,
99 std::shared_ptr<LinAlgOpContext<memorySpace>> linAlgOpContext,
100 const ElpaScalapackManager & elpaScala,
101 bool isResidualChebyshevFilter = true,
102 const size_type eigenVectorBatchSize = 0,
103 bool isGHEP = true,
104 OrthogonalizationType orthoType =
106 bool storeIntermediateSubspaces = false,
107 std::shared_ptr<MultivectorScratch<ValueType, memorySpace>> scratch =
108 nullptr);
109
115
116 void
117 reinit(const double wantedSpectrumLowerBound,
118 const double wantedSpectrumUpperBound,
119 const double unWantedSpectrumUpperBound,
120 const double polynomialDegree,
121 const double illConditionTolerance,
122 std::shared_ptr<const utils::mpi::MPIPatternP2P<memorySpace>>
123 mpiPatternP2P,
124 std::shared_ptr<LinAlgOpContext<memorySpace>> linAlgOpContext);
125
127 solve(const OpContext & A,
128 std::vector<RealType> & eigenValues,
130 bool computeEigenVectors = false,
131 const OpContext &B = IdentityOperatorContext<ValueTypeOperator,
132 ValueTypeOperand,
133 memorySpace>(),
134 const OpContext &BInv =
135 IdentityOperatorContext<ValueTypeOperator,
136 ValueTypeOperand,
137 memorySpace>()) override;
138
141
144
145 void
147
148 private:
157
158 std::shared_ptr<MultiVector<ValueType, memorySpace>> d_filteredSubspace,
160
161 std::shared_ptr<MultiVector<ValueType, memorySpace>> d_XinBatchSmall,
163
164 std::shared_ptr<MultiVector<ValueType, memorySpace>> d_chfsiScratch1,
166 std::shared_ptr<MultiVector<ValueType, memorySpace>> d_chfsiScratch1Small,
169
170 std::shared_ptr<
173
174 std::shared_ptr<
177
181
182 std::shared_ptr<const utils::mpi::MPIPatternP2P<memorySpace>>
186
188
189 const bool d_isGHEP;
190
191 std::shared_ptr<MultivectorScratch<ValueType, memorySpace>> d_scratch;
192
193 }; // end of class ChebyshevFilteredEigenSolver
194 } // end of namespace linearAlgebra
195} // end of namespace dftefe
197#endif // dftefeChebyshevFilteredEigenSolver_h
A derived class of OperatorContext to encapsulate the action of a discrete operator on vectors,...
Definition: ChebyshevFilteredEigenSolver.h:71
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_XinBatchSmall
Definition: ChebyshevFilteredEigenSolver.h:161
std::shared_ptr< RayleighRitzEigenSolver< ValueTypeOperator, ValueType, memorySpace > > d_rr
Definition: ChebyshevFilteredEigenSolver.h:172
const bool d_isResidualChebyFilter
Definition: ChebyshevFilteredEigenSolver.h:179
MultiVector< ValueTypeOperand, memorySpace > * d_eigenSubspaceGuess
Definition: ChebyshevFilteredEigenSolver.h:154
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_filteredSubspace
Definition: ChebyshevFilteredEigenSolver.h:158
double d_polynomialDegree
Definition: ChebyshevFilteredEigenSolver.h:152
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_chfsiResidualScratch1
Definition: ChebyshevFilteredEigenSolver.h:165
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_filteredSubspaceOrtho
Definition: ChebyshevFilteredEigenSolver.h:159
double d_wantedSpectrumUpperBound
Definition: ChebyshevFilteredEigenSolver.h:150
MultiVector< ValueType, memorySpace > & getFilteredSubspace()
Definition: ChebyshevFilteredEigenSolver.t.cpp:639
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_chfsiResidualScratch2
Definition: ChebyshevFilteredEigenSolver.h:165
void printTotalInScopeTimings()
Definition: ChebyshevFilteredEigenSolver.t.cpp:679
MultiVector< ValueType, memorySpace > & getOrthogonalizedFilteredSubspace()
Definition: ChebyshevFilteredEigenSolver.t.cpp:660
double d_unWantedSpectrumUpperBound
Definition: ChebyshevFilteredEigenSolver.h:151
blasLapack::real_type< ValueType > RealType
Definition: ChebyshevFilteredEigenSolver.h:81
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_chfsiResidualScratch2Small
Definition: ChebyshevFilteredEigenSolver.h:168
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_XoutBatch
Definition: ChebyshevFilteredEigenSolver.h:162
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_XoutBatchSmall
Definition: ChebyshevFilteredEigenSolver.h:162
bool d_printL2Norms
Definition: ChebyshevFilteredEigenSolver.h:184
utils::Profiler< memorySpace > d_pTotal
Definition: ChebyshevFilteredEigenSolver.h:178
double d_wantedSpectrumLowerBound
Definition: ChebyshevFilteredEigenSolver.h:149
size_type d_batchSizeSmall
Definition: ChebyshevFilteredEigenSolver.h:180
typename HermitianIterativeEigenSolver< ValueTypeOperator, ValueTypeOperand, memorySpace >::OpContext OpContext
Definition: ChebyshevFilteredEigenSolver.h:85
const bool d_isGHEP
Definition: ChebyshevFilteredEigenSolver.h:189
EigenSolverError solve(const OpContext &A, std::vector< RealType > &eigenValues, MultiVector< ValueType, memorySpace > &eigenVectors, bool computeEigenVectors=false, const OpContext &B=IdentityOperatorContext< ValueTypeOperator, ValueTypeOperand, memorySpace >(), const OpContext &BInv=IdentityOperatorContext< ValueTypeOperator, ValueTypeOperand, memorySpace >()) override
Definition: ChebyshevFilteredEigenSolver.t.cpp:261
const bool d_storeIntermediateSubspaces
Definition: ChebyshevFilteredEigenSolver.h:156
const size_type d_eigenVecBatchSize
Definition: ChebyshevFilteredEigenSolver.h:155
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_chfsiScratch2
Definition: ChebyshevFilteredEigenSolver.h:165
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_chfsiScratch1Small
Definition: ChebyshevFilteredEigenSolver.h:166
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_XinBatch
Definition: ChebyshevFilteredEigenSolver.h:162
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_chfsiScratch1
Definition: ChebyshevFilteredEigenSolver.h:164
void reinit(const double wantedSpectrumLowerBound, const double wantedSpectrumUpperBound, const double unWantedSpectrumUpperBound, const double polynomialDegree, const double illConditionTolerance, std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > > mpiPatternP2P, std::shared_ptr< LinAlgOpContext< memorySpace > > linAlgOpContext)
Definition: ChebyshevFilteredEigenSolver.t.cpp:173
double d_illConditionTolerance
Definition: ChebyshevFilteredEigenSolver.h:153
OrthogonalizationType d_orthoType
Definition: ChebyshevFilteredEigenSolver.h:185
utils::Profiler< memorySpace > d_p
Definition: ChebyshevFilteredEigenSolver.h:178
std::shared_ptr< OrthonormalizationFunctions< ValueTypeOperator, ValueType, memorySpace > > d_ortho
Definition: ChebyshevFilteredEigenSolver.h:176
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_chfsiResidualScratch1Small
Definition: ChebyshevFilteredEigenSolver.h:167
blasLapack::scalar_type< ValueTypeOperator, ValueTypeOperand > ValueType
define ValueType as the superior (bigger set) of the ValueTypeOperator and ValueTypeOperand (e....
Definition: ChebyshevFilteredEigenSolver.h:80
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_chfsiScratch2Small
Definition: ChebyshevFilteredEigenSolver.h:167
const ElpaScalapackManager * d_elpaScala
Definition: ChebyshevFilteredEigenSolver.h:187
std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > > d_mpiPatternP2P
Definition: ChebyshevFilteredEigenSolver.h:183
std::shared_ptr< MultivectorScratch< ValueType, memorySpace > > d_scratch
Definition: ChebyshevFilteredEigenSolver.h:191
Manager class for ELPA and ScaLAPACK.
Definition: ElpaScalapackManager.h:43
Abstract class to encapsulate the action of a discrete operator on vectors, matrices,...
Definition: IdentityOperatorContext.h:53
Definition: LinAlgOpContext.h:52
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition: MultiVector.h:134
Shared scratch MultiVectors (large-batch and small-batch variants) that can be reused across Chebyshe...
Definition: MultivectorScratch.h:52
Definition: OrthonormalizationFunctions.h:49
A derived class of OperatorContext to encapsulate the action of a discrete operator on vectors,...
Definition: RayleighRitzEigenSolver.h:59
Definition: Profiler.h:50
A class template to store the communication pattern (i.e., which entries/nodes to receive from which ...
Definition: MPIPatternP2P.h:197
typeInternal::real_type< ValueType > real_type
Definition: BlasLapackTypedef.h:177
typeInternal::scalar_type< ValueType1, ValueType2 > scalar_type
Definition: BlasLapackTypedef.h:183
OrthogonalizationType
Definition: ChebyshevFilteredEigenSolver.h:47
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
std::uint64_t size_type
Definition: TypeConfig.h:9
Definition: LinearAlgebraTypes.h:147