QUDA
1.0.0
|
#include <deflation.h>
Public Member Functions | |
Deflation (DeflationParam ¶m, TimeProfile &profile) | |
virtual | ~Deflation () |
void | verify () |
void | increment (ColorSpinorField &V, int nev) |
void | reduce (double tol, int max_nev) |
void | operator() (ColorSpinorField &out, ColorSpinorField &in) |
void | loadVectors (ColorSpinorField *RV) |
Load the eigen space vectors from file. More... | |
void | saveVectors (ColorSpinorField *RV) |
Save the eigen space vectors in file. More... | |
bool | is_complete () |
Test whether the deflation space is complete and therefore cannot be further extended. More... | |
int | size () |
return deflation space size More... | |
double | flops () const |
Return the total flops done on this and all coarser levels. More... | |
Private Attributes | |
DeflationParam & | param |
TimeProfile | profile |
ColorSpinorField * | r |
ColorSpinorField * | Av |
ColorSpinorField * | r_sloppy |
ColorSpinorField * | Av_sloppy |
Deflation methods :
Definition at line 78 of file deflation.h.
quda::Deflation::Deflation | ( | DeflationParam & | param, |
TimeProfile & | profile | ||
) |
Constructor for Deflation class
param | DeflationParam struct that defines all meta data |
profile | Timeprofile instance used to profile |
Definition at line 23 of file deflation.cpp.
References Av, Av_sloppy, quda::ColorSpinorField::Component(), quda::ColorSpinorField::Create(), csParam, QudaEigParam_s::cuda_prec_ritz, quda::DeflationParam::eig_global, getVerbosity(), QudaEigParam_s::import_vectors, loadVectors(), quda::DeflationParam::location, quda::TimeProfile::Print(), printfQuda, QUDA_CUDA_FIELD_LOCATION, QUDA_DOUBLE_PRECISION, QUDA_FLOAT2_FIELD_ORDER, QUDA_FLOAT4_FIELD_ORDER, QUDA_MEMORY_DEVICE, QUDA_SUMMARIZE, QUDA_UKQCD_GAMMA_BASIS, QUDA_ZERO_FIELD_CREATE, r, r_sloppy, QudaEigParam_s::run_verify, quda::DeflationParam::RV, quda::DeflationParam::tot_dim, and verify().
|
virtual |
Destructor for Deflation class. Frees any existing Deflation instance
Definition at line 69 of file deflation.cpp.
References Av, Av_sloppy, QudaEigParam_s::cuda_prec_ritz, quda::DeflationParam::eig_global, getVerbosity(), param, quda::TimeProfile::Print(), profile, QUDA_DOUBLE_PRECISION, QUDA_SUMMARIZE, r, and r_sloppy.
double quda::Deflation::flops | ( | ) | const |
Return the total flops done on this and all coarser levels.
Definition at line 82 of file deflation.cpp.
void quda::Deflation::increment | ( | ColorSpinorField & | V, |
int | nev | ||
) |
In the incremental eigcg: expands deflation space.
V | container of new eigenvectors |
nev | number of vectors to load |
Definition at line 188 of file deflation.cpp.
References Av, Av_sloppy, quda::blas::ax(), quda::blas::caxpy(), quda::blas::cDotProduct(), quda::ColorSpinorField::Component(), quda::ColorSpinorField::Components(), quda::ColorSpinorField::CompositeDim(), quda::conj(), quda::blas::copy(), QudaEigParam_s::cuda_prec_ritz, quda::DeflationParam::cur_dim, quda::DeflationParam::eig_global, errorQuda, QudaInvertParam_s::inv_type, QudaEigParam_s::invert_param, quda::DeflationParam::ld, quda::DeflationParam::matDeflation, quda::DeflationParam::matProj, nev, quda::blas::norm2(), param, printfQuda, QUDA_DOUBLE_PRECISION, QUDA_EIGCG_INVERTER, QUDA_INC_EIGCG_INVERTER, r, quda::DeflationParam::RV, quda::sqrt(), quda::DeflationParam::tot_dim, and warningQuda.
Referenced by quda::IncEigCG::operator()().
|
inline |
Test whether the deflation space is complete and therefore cannot be further extended.
Definition at line 159 of file deflation.h.
References quda::DeflationParam::cur_dim, and quda::DeflationParam::tot_dim.
Referenced by quda::IncEigCG::operator()().
void quda::Deflation::loadVectors | ( | ColorSpinorField * | RV | ) |
Load the eigen space vectors from file.
RV | Loaded eigen-space vectors (pre-allocated) |
Definition at line 352 of file deflation.cpp.
References quda::ColorSpinorField::Components(), quda::DeflationParam::eig_global, errorQuda, quda::ColorSpinorField::IsComposite(), param, printfQuda, profile, quda::QUDA_PROFILE_INIT, quda::QUDA_PROFILE_IO, read_spinor_field(), V, and QudaEigParam_s::vec_infile.
Referenced by Deflation().
void quda::Deflation::operator() | ( | ColorSpinorField & | out, |
ColorSpinorField & | in | ||
) |
This applies deflation operation on a given spinor vector(s)
out | The projected vector |
in | The input vector (or equivalently the right hand side vector) |
Definition at line 134 of file deflation.cpp.
References quda::blas::caxpy(), quda::blas::cDotProduct(), quda::ColorSpinorField::Components(), quda::DeflationParam::cur_dim, quda::DeflationParam::eig_global, errorQuda, QudaEigParam_s::extlib_type, QudaInvertParam_s::inv_type, QudaEigParam_s::invert_param, quda::DeflationParam::invRitzVals, quda::DeflationParam::ld, magma_Xgesv(), quda::DeflationParam::matProj, quda::norm2(), param, quda::LatticeField::Precision(), printfQuda, QUDA_EIGCG_INVERTER, QUDA_EIGEN_EXTLIB, QUDA_INC_EIGCG_INVERTER, QUDA_MAGMA_EXTLIB, r_sloppy, quda::DeflationParam::RV, quda::sqrt(), and quda::DeflationParam::use_inv_ritz.
void quda::Deflation::reduce | ( | double | tol, |
int | max_nev | ||
) |
In the incremental eigcg: reduce deflation space based on the following criteria:
tol | : keep all eigenvectors with residual norm less then tol |
max_nev | : keep the lowest max_nev eigenvectors (conservative) |
Definition at line 266 of file deflation.cpp.
References Av_sloppy, quda::blas::caxpy(), quda::blas::cDotProductNormA(), quda::ColorSpinorField::Component(), quda::ColorSpinorField::Components(), quda::blas::copy(), quda::ColorSpinorField::Create(), csParam, quda::DeflationParam::cur_dim, quda::DeflationParam::eig_global, errorQuda, QudaEigParam_s::extlib_type, getVerbosity(), quda::DeflationParam::invRitzVals, quda::DeflationParam::ld, magma_Xheev(), quda::DeflationParam::matDeflation, quda::DeflationParam::matProj, quda::norm2(), param, quda::pinned_allocator, quda::pinned_deleter, printfQuda, QUDA_EIGEN_EXTLIB, QUDA_MAGMA_EXTLIB, QUDA_MEMORY_MAPPED, QUDA_VERBOSE, QUDA_ZERO_FIELD_CREATE, r, r_sloppy, quda::DeflationParam::RV, quda::sqrt(), quda::DeflationParam::tot_dim, quda::DeflationParam::use_inv_ritz, quda::blas::xpay(), and quda::blas::zero().
Referenced by quda::IncEigCG::operator()().
void quda::Deflation::saveVectors | ( | ColorSpinorField * | RV | ) |
Save the eigen space vectors in file.
RV | Save eigen-space vectors from here |
Definition at line 385 of file deflation.cpp.
References quda::ColorSpinorField::Components(), quda::DeflationParam::eig_global, errorQuda, host_free, quda::ColorSpinorField::IsComposite(), param, printfQuda, profile, quda::QUDA_PROFILE_INIT, quda::QUDA_PROFILE_IO, safe_malloc, V, QudaEigParam_s::vec_outfile, and write_spinor_field().
|
inline |
return deflation space size
Definition at line 164 of file deflation.h.
References quda::DeflationParam::cur_dim, and quda::blas::flops.
Referenced by quda::IncEigCG::operator()().
void quda::Deflation::verify | ( | ) |
This method verifies the correctness of the MG method. It checks:
Verification that the computed approximate eigenvectors are (not) valid
Definition at line 92 of file deflation.cpp.
References Av_sloppy, quda::blas::caxpy(), quda::blas::cDotProductNormA(), quda::ColorSpinorField::Components(), quda::DeflationParam::cur_dim, quda::DeflationParam::eig_global, errorQuda, QudaEigParam_s::extlib_type, quda::DeflationParam::ld, magma_Xheev(), quda::DeflationParam::matDeflation, quda::DeflationParam::matProj, quda::norm2(), param, quda::pinned_allocator, quda::pinned_deleter, printfQuda, QUDA_EIGEN_EXTLIB, QUDA_MAGMA_EXTLIB, r, r_sloppy, quda::DeflationParam::RV, quda::sqrt(), quda::blas::xpay(), and quda::zero().
Referenced by Deflation(), and quda::IncEigCG::operator()().
|
private |
High precision aux field
Definition at line 91 of file deflation.h.
Referenced by Deflation(), increment(), and ~Deflation().
|
private |
Deflation matrix operation result
Definition at line 97 of file deflation.h.
Referenced by Deflation(), increment(), reduce(), verify(), and ~Deflation().
|
private |
Local copy of the deflation metadata
Definition at line 82 of file deflation.h.
Referenced by increment(), loadVectors(), operator()(), reduce(), saveVectors(), verify(), and ~Deflation().
|
private |
TimeProfile for this level
Definition at line 85 of file deflation.h.
Referenced by loadVectors(), saveVectors(), and ~Deflation().
|
private |
High precision aux field
Definition at line 88 of file deflation.h.
Referenced by Deflation(), increment(), reduce(), verify(), and ~Deflation().
|
private |
Ritz precision residual vector
Definition at line 94 of file deflation.h.
Referenced by Deflation(), operator()(), reduce(), verify(), and ~Deflation().