QUDA
v1.1.0
A library for QCD on GPUs
|
#include <invert_quda.h>
Public Member Functions | |
Solver (const DiracMatrix &mat, const DiracMatrix &matSloppy, const DiracMatrix &matPrecon, const DiracMatrix &matEig, SolverParam ¶m, TimeProfile &profile) | |
virtual | ~Solver () |
virtual void | operator() (ColorSpinorField &out, ColorSpinorField &in)=0 |
virtual void | blocksolve (ColorSpinorField &out, ColorSpinorField &in) |
const DiracMatrix & | M () |
const DiracMatrix & | Msloppy () |
const DiracMatrix & | Mprecon () |
const DiracMatrix & | Meig () |
virtual bool | hermitian ()=0 |
bool | convergence (double r2, double hq2, double r2_tol, double hq_tol) |
bool | convergenceHQ (double r2, double hq2, double r2_tol, double hq_tol) |
Test for HQ solver convergence – ignore L2 residual. More... | |
bool | convergenceL2 (double r2, double hq2, double r2_tol, double hq_tol) |
Test for L2 solver convergence – ignore HQ residual. More... | |
void | PrintStats (const char *name, int k, double r2, double b2, double hq2) |
Prints out the running statistics of the solver (requires a verbosity of QUDA_VERBOSE) More... | |
void | PrintSummary (const char *name, int k, double r2, double b2, double r2_tol, double hq_tol) |
Prints out the summary of the solver convergence (requires a verbosity of QUDA_SUMMARIZE). Assumes SolverParam.true_res and SolverParam.true_res_hq has been set. More... | |
double | precisionEpsilon (QudaPrecision prec=QUDA_INVALID_PRECISION) const |
Returns the epsilon tolerance for a given precision, by default returns the solver precision. More... | |
void | constructDeflationSpace (const ColorSpinorField &meta, const DiracMatrix &mat) |
Constructs the deflation space and eigensolver. More... | |
void | destroyDeflationSpace () |
Destroy the allocated deflation space. More... | |
void | extendSVDDeflationSpace () |
Extends the deflation space to twice its size for SVD deflation. More... | |
void | injectDeflationSpace (std::vector< ColorSpinorField * > &defl_space) |
Injects a deflation space into the solver from the vector argument. Note the input space is reduced to zero size as a result of calling this function, with responsibility for the space transferred to the solver. More... | |
void | extractDeflationSpace (std::vector< ColorSpinorField * > &defl_space) |
Extracts the deflation space from the solver to the vector argument. Note the solver deflation space is reduced to zero size as a result of calling this function, with responsibility for the space transferred to the argument. More... | |
int | deflationSpaceSize () const |
Returns the size of deflation space. More... | |
void | setDeflateCompute (bool flag) |
Sets the deflation compute boolean. More... | |
void | setRecomputeEvals (bool flag) |
Sets the recompute evals boolean. More... | |
virtual double | flops () const |
Return flops. More... | |
Static Public Member Functions | |
static Solver * | create (SolverParam ¶m, const DiracMatrix &mat, const DiracMatrix &matSloppy, const DiracMatrix &matPrecon, const DiracMatrix &matEig, TimeProfile &profile) |
Solver factory. More... | |
static double | stopping (double tol, double b2, QudaResidualType residual_type) |
Set the solver L2 stopping condition. More... | |
Protected Attributes | |
const DiracMatrix & | mat |
const DiracMatrix & | matSloppy |
const DiracMatrix & | matPrecon |
const DiracMatrix & | matEig |
SolverParam & | param |
TimeProfile & | profile |
int | node_parity |
EigenSolver * | eig_solve |
bool | deflate_init |
bool | deflate_compute |
bool | recompute_evals |
std::vector< ColorSpinorField * > | evecs |
std::vector< Complex > | evals |
Definition at line 462 of file invert_quda.h.
quda::Solver::Solver | ( | const DiracMatrix & | mat, |
const DiracMatrix & | matSloppy, | ||
const DiracMatrix & | matPrecon, | ||
const DiracMatrix & | matEig, | ||
SolverParam & | param, | ||
TimeProfile & | profile | ||
) |
Holds the eigenvalues.
Definition at line 14 of file solver.cpp.
|
virtual |
Definition at line 33 of file solver.cpp.
|
virtual |
Reimplemented in quda::CG.
Definition at line 302 of file solver.cpp.
void quda::Solver::constructDeflationSpace | ( | const ColorSpinorField & | meta, |
const DiracMatrix & | mat | ||
) |
Constructs the deflation space and eigensolver.
[in] | meta | A sample ColorSpinorField with which to instantiate the eigensolver |
[in] | mat | The operator to eigensolve |
[in] | Whether | to compute the SVD |
Definition at line 168 of file solver.cpp.
bool quda::Solver::convergence | ( | double | r2, |
double | hq2, | ||
double | r2_tol, | ||
double | hq_tol | ||
) |
@briefTest for solver convergence
[in] | r2 | L2 norm squared of the residual |
[in] | hq2 | Heavy quark residual |
[in] | r2_tol | Solver L2 tolerance |
[in] | hq_tol | Solver heavy-quark tolerance |
Definition at line 328 of file solver.cpp.
bool quda::Solver::convergenceHQ | ( | double | r2, |
double | hq2, | ||
double | r2_tol, | ||
double | hq_tol | ||
) |
Test for HQ solver convergence – ignore L2 residual.
[in] | r2 | L2 norm squared of the residual |
[in] | hq2 | Heavy quark residual |
[in] | r2_tol | Solver L2 tolerance |
[in[ | hq_tol Solver heavy-quark tolerance |
Definition at line 348 of file solver.cpp.
bool quda::Solver::convergenceL2 | ( | double | r2, |
double | hq2, | ||
double | r2_tol, | ||
double | hq_tol | ||
) |
Test for L2 solver convergence – ignore HQ residual.
[in] | r2 | L2 norm squared of the residual |
[in] | hq2 | Heavy quark residual |
[in] | r2_tol | Solver L2 tolerance |
[in] | hq_tol | Solver heavy-quark tolerance |
Definition at line 361 of file solver.cpp.
|
static |
Solver factory.
Definition at line 42 of file solver.cpp.
|
inline |
Returns the size of deflation space.
Definition at line 615 of file invert_quda.h.
void quda::Solver::destroyDeflationSpace | ( | ) |
Destroy the allocated deflation space.
Definition at line 229 of file solver.cpp.
void quda::Solver::extendSVDDeflationSpace | ( | ) |
Extends the deflation space to twice its size for SVD deflation.
Definition at line 287 of file solver.cpp.
void quda::Solver::extractDeflationSpace | ( | std::vector< ColorSpinorField * > & | defl_space | ) |
Extracts the deflation space from the solver to the vector argument. Note the solver deflation space is reduced to zero size as a result of calling this function, with responsibility for the space transferred to the argument.
[in,out] | defl_space | the extracted deflation space. On input, this vector should have zero size. |
Definition at line 276 of file solver.cpp.
|
inlinevirtual |
Return flops.
Reimplemented in quda::MG.
Definition at line 633 of file invert_quda.h.
|
pure virtual |
Implemented in quda::MG, quda::GMResDR, quda::IncEigCG, quda::PreconditionedSolver, quda::XSD, quda::SD, quda::CAGCR, quda::CACGNR, quda::CACGNE, quda::CACG, quda::MR, quda::GCR, quda::BiCGstabL, quda::MPBiCGstab, quda::SimpleBiCGstab, quda::BiCGstab, quda::PreconCG, quda::MPCG, quda::CG3NR, quda::CG3NE, quda::CG3, quda::CGNR, quda::CGNE, and quda::CG.
void quda::Solver::injectDeflationSpace | ( | std::vector< ColorSpinorField * > & | defl_space | ) |
Injects a deflation space into the solver from the vector argument. Note the input space is reduced to zero size as a result of calling this function, with responsibility for the space transferred to the solver.
[in,out] | defl_space | the deflation space we wish to transfer to the solver. |
Definition at line 266 of file solver.cpp.
|
inline |
Definition at line 489 of file invert_quda.h.
|
inline |
Definition at line 492 of file invert_quda.h.
|
inline |
Definition at line 491 of file invert_quda.h.
|
inline |
Definition at line 490 of file invert_quda.h.
|
pure virtual |
Implemented in quda::PreconditionedSolver, quda::MG, quda::GMResDR, quda::IncEigCG, quda::XSD, quda::SD, quda::CAGCR, quda::CACGNR, quda::CACGNE, quda::CACG, quda::MR, quda::GCR, quda::BiCGstabL, quda::MPBiCGstab, quda::SimpleBiCGstab, quda::BiCGstab, quda::PreconCG, quda::MPCG, quda::CG3NR, quda::CG3NE, quda::CG3, quda::CGNR, quda::CGNE, and quda::CG.
double quda::Solver::precisionEpsilon | ( | QudaPrecision | prec = QUDA_INVALID_PRECISION | ) | const |
Returns the epsilon tolerance for a given precision, by default returns the solver precision.
[in] | prec | Input precision, default value is solver precision |
Definition at line 412 of file solver.cpp.
void quda::Solver::PrintStats | ( | const char * | name, |
int | k, | ||
double | r2, | ||
double | b2, | ||
double | hq2 | ||
) |
Prints out the running statistics of the solver (requires a verbosity of QUDA_VERBOSE)
[in] | name | Name of solver that called this |
[in] | k | iteration count |
[in] | r2 | L2 norm squared of the residual |
[in] | hq2 | Heavy quark residual |
Definition at line 373 of file solver.cpp.
void quda::Solver::PrintSummary | ( | const char * | name, |
int | k, | ||
double | r2, | ||
double | b2, | ||
double | r2_tol, | ||
double | hq_tol | ||
) |
Prints out the summary of the solver convergence (requires a verbosity of QUDA_SUMMARIZE). Assumes SolverParam.true_res and SolverParam.true_res_hq has been set.
[in] | name | Name of solver that called this |
[in] | k | iteration count |
[in] | r2 | L2 norm squared of the residual |
[in] | hq2 | Heavy quark residual |
[in] | r2_tol | Solver L2 tolerance |
[in] | hq_tol | Solver heavy-quark tolerance |
Definition at line 386 of file solver.cpp.
|
inline |
Sets the deflation compute boolean.
[in] | flag | Set to this boolean value |
Definition at line 621 of file invert_quda.h.
|
inline |
Sets the recompute evals boolean.
[in] | flag | Set to this boolean value |
Definition at line 627 of file invert_quda.h.
|
static |
Set the solver L2 stopping condition.
[in] | Desired | solver tolerance |
[in] | b2 | L2 norm squared of the source vector |
[in] | residual_type | The type of residual we want to solve for |
Definition at line 311 of file solver.cpp.
|
protected |
If true, the deflation space has been computed.
Definition at line 475 of file invert_quda.h.
|
protected |
Eigensolver object.
Definition at line 474 of file invert_quda.h.
|
protected |
Definition at line 473 of file invert_quda.h.
|
protected |
Holds the eigenvectors.
Definition at line 478 of file invert_quda.h.
|
protected |
If true, instruct the solver to recompute evals from an existing deflation space.
Definition at line 477 of file invert_quda.h.
|
protected |
Definition at line 465 of file invert_quda.h.
|
protected |
Definition at line 468 of file invert_quda.h.
|
protected |
Definition at line 467 of file invert_quda.h.
|
protected |
Definition at line 466 of file invert_quda.h.
|
protected |
Definition at line 472 of file invert_quda.h.
|
protected |
Definition at line 470 of file invert_quda.h.
|
protected |
Definition at line 471 of file invert_quda.h.
|
protected |
If true, instruct the solver to create a deflation space.
Definition at line 476 of file invert_quda.h.