QUDA
1.0.0
|
Communication-avoiding CG solver. This solver does un-preconditioned CG, running in steps of nKrylov, build up a polynomial in the linear operator of length nKrylov, and then performs a steepest descent minimization on the resulting basis vectors. For now only implemented using the power basis so is only useful as a preconditioner. More...
#include <invert_quda.h>
Public Member Functions | |
CACG (DiracMatrix &mat, DiracMatrix &matSloppy, SolverParam ¶m, TimeProfile &profile) | |
virtual | ~CACG () |
void | operator() (ColorSpinorField &out, ColorSpinorField &in) |
![]() | |
Solver (SolverParam ¶m, TimeProfile &profile) | |
virtual | ~Solver () |
virtual void | blocksolve (ColorSpinorField &out, ColorSpinorField &in) |
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... | |
void | constructDeflationSpace (const ColorSpinorField &meta, const DiracMatrix &mat, bool svd) |
Constructs the deflation space. More... | |
virtual double | flops () const |
Private Member Functions | |
void | create (ColorSpinorField &b) |
Initiate the fields needed by the solver. More... | |
void | compute_alpha () |
Compute the alpha coefficients. More... | |
void | compute_beta () |
Compute the beta coefficients. More... | |
int | reliable (double &rNorm, double &maxrr, int &rUpdate, const double &r2, const double &delta) |
Private Attributes | |
const DiracMatrix & | mat |
const DiracMatrix & | matSloppy |
bool | init |
bool | lambda_init |
QudaCABasis | basis |
Complex * | Q_AQandg |
Complex * | Q_AS |
Complex * | alpha |
Complex * | beta |
ColorSpinorField * | rp |
ColorSpinorField * | tmpp |
ColorSpinorField * | tmpp2 |
ColorSpinorField * | tmp_sloppy |
ColorSpinorField * | tmp_sloppy2 |
std::vector< ColorSpinorField * > | S |
std::vector< ColorSpinorField * > | AS |
std::vector< ColorSpinorField * > | Q |
std::vector< ColorSpinorField * > | Qtmp |
std::vector< ColorSpinorField * > | AQ |
Additional Inherited Members | |
![]() | |
static Solver * | create (SolverParam ¶m, DiracMatrix &mat, DiracMatrix &matSloppy, DiracMatrix &matPrecon, TimeProfile &profile) |
static double | stopping (double tol, double b2, QudaResidualType residual_type) |
Set the solver L2 stopping condition. More... | |
![]() | |
EigenSolver * | eig_solve |
bool | deflate_init = false |
std::vector< ColorSpinorField * > | defl_tmp1 |
std::vector< ColorSpinorField * > | defl_tmp2 |
![]() | |
SolverParam & | param |
TimeProfile & | profile |
int | node_parity |
Communication-avoiding CG solver. This solver does un-preconditioned CG, running in steps of nKrylov, build up a polynomial in the linear operator of length nKrylov, and then performs a steepest descent minimization on the resulting basis vectors. For now only implemented using the power basis so is only useful as a preconditioner.
Definition at line 891 of file invert_quda.h.
quda::CACG::CACG | ( | DiracMatrix & | mat, |
DiracMatrix & | matSloppy, | ||
SolverParam & | param, | ||
TimeProfile & | profile | ||
) |
Definition at line 15 of file inv_ca_cg.cpp.
|
virtual |
Definition at line 21 of file inv_ca_cg.cpp.
References alpha, AQ, AS, basis, beta, quda::Solver::defl_tmp1, quda::Solver::defl_tmp2, quda::Solver::deflate_init, quda::SolverParam::evecs, init, quda::SolverParam::is_preconditioner, quda::SolverParam::Nkrylov, quda::Solver::param, quda::Solver::profile, Q, Q_AQandg, Q_AS, Qtmp, QUDA_POWER_BASIS, quda::QUDA_PROFILE_FREE, rp, tmp_sloppy, tmp_sloppy2, tmpp, and tmpp2.
|
private |
Compute the alpha coefficients.
Definition at line 302 of file inv_ca_cg.cpp.
References alpha, quda::SolverParam::is_preconditioner, quda::TimeProfile::Last(), quda::Solver::param, quda::Solver::profile, Q, Q_AQandg, quda::QUDA_PROFILE_COMPUTE, quda::QUDA_PROFILE_EIGEN, and quda::SolverParam::secs.
Referenced by operator()().
|
private |
Compute the beta coefficients.
Definition at line 376 of file inv_ca_cg.cpp.
References beta, quda::SolverParam::is_preconditioner, quda::TimeProfile::Last(), quda::Solver::param, quda::Solver::profile, Q, Q_AQandg, Q_AS, quda::QUDA_PROFILE_COMPUTE, quda::QUDA_PROFILE_EIGEN, and quda::SolverParam::secs.
Referenced by operator()().
|
private |
Initiate the fields needed by the solver.
[in] | b | Source vector used for solver meta data. If we're not preserving the source vector and we have a uni-precision solver, we set p[0] = b to save memory and memory copying. |
Definition at line 208 of file inv_ca_cg.cpp.
References alpha, AQ, AS, basis, beta, quda::Solver::constructDeflationSpace(), quda::ColorSpinorParam::create, quda::ColorSpinorField::Create(), csParam, quda::SolverParam::deflate, quda::Solver::deflate_init, quda::blas::flops, quda::CACGNR::init, quda::SolverParam::is_preconditioner, mat, quda::SolverParam::Nkrylov, quda::Solver::param, quda::SolverParam::precision, quda::SolverParam::precision_sloppy, quda::Solver::profile, Q, Q_AQandg, Q_AS, Qtmp, QUDA_NULL_FIELD_CREATE, QUDA_POWER_BASIS, quda::QUDA_PROFILE_INIT, rp, quda::ColorSpinorParam::setPrecision(), tmp_sloppy, tmp_sloppy2, tmpp, and tmpp2.
Referenced by operator()().
|
virtual |
Implements quda::Solver.
Reimplemented in quda::CACGNR, and quda::CACGNE.
Definition at line 450 of file inv_ca_cg.cpp.
References alpha, AQ, AS, quda::blas::ax(), quda::blas::axpy(), basis, beta, quda::SolverParam::ca_lambda_max, quda::SolverParam::ca_lambda_min, quda::blas::caxpy(), quda::blas::caxpyz(), quda::blas::cDotProduct(), checkPrecision, compute_alpha(), compute_beta(), quda::SolverParam::compute_null_vector, quda::SolverParam::compute_true_res, quda::Solver::convergence(), quda::blas::copy(), create(), quda::Solver::defl_tmp1, quda::Solver::defl_tmp2, quda::SolverParam::deflate, quda::EigenSolver::deflate(), quda::SolverParam::delta, quda::Solver::eig_solve, errorQuda, quda::SolverParam::evals, quda::SolverParam::evecs, quda::blas::flops, quda::DiracMatrix::flops(), getVerbosity(), quda::SolverParam::gflops, quda::blas::HeavyQuarkResidualNorm(), quda::SolverParam::is_preconditioner, quda::SolverParam::iter, lambda_init, quda::TimeProfile::Last(), mat, matSloppy, quda::SolverParam::max_res_increase, quda::SolverParam::max_res_increase_total, quda::SolverParam::maxiter, quda::SolverParam::Nkrylov, quda::blas::norm2(), quda::Solver::param, quda::SolverParam::precision, quda::SolverParam::preserve_source, printfQuda, quda::Solver::PrintStats(), quda::Solver::PrintSummary(), quda::Solver::profile, Q, Q_AQandg, Q_AS, Qtmp, QUDA_CHEBYSHEV_BASIS, QUDA_COMPUTE_NULL_VECTOR_NO, QUDA_HEAVY_QUARK_RESIDUAL, QUDA_POWER_BASIS, QUDA_PRESERVE_SOURCE_YES, quda::QUDA_PROFILE_COMPUTE, quda::QUDA_PROFILE_EPILOGUE, quda::QUDA_PROFILE_INIT, quda::QUDA_PROFILE_PREAMBLE, QUDA_SUMMARIZE, QUDA_USE_INIT_GUESS_NO, QUDA_USE_INIT_GUESS_YES, QUDA_VERBOSE, qudaDeviceSynchronize, R, reliable(), quda::SolverParam::residual_type, quda::SolverParam::return_residual, rp, quda::SolverParam::secs, quda::SolverParam::sloppy_converge, quda::sqrt(), quda::Solver::stopping(), swap(), tmp, tmp2, tmp_sloppy, tmp_sloppy2, tmpp, tmpp2, quda::SolverParam::tol, quda::SolverParam::tol_hq, quda::SolverParam::true_res, quda::SolverParam::true_res_hq, quda::SolverParam::use_init_guess, warningQuda, X, quda::blas::xmyNorm(), quda::blas::xpay(), and quda::blas::zero().
Referenced by quda::CACGNE::operator()(), and quda::CACGNR::operator()().
|
private |
@ brief Check if it's time for a reliable update
Definition at line 426 of file inv_ca_cg.cpp.
References quda::sqrt(), and updateR().
Referenced by operator()().
|
private |
Definition at line 903 of file invert_quda.h.
Referenced by compute_alpha(), create(), operator()(), and ~CACG().
|
private |
Definition at line 916 of file invert_quda.h.
Referenced by create(), operator()(), and ~CACG().
|
private |
Definition at line 913 of file invert_quda.h.
Referenced by create(), operator()(), and ~CACG().
|
private |
Definition at line 899 of file invert_quda.h.
Referenced by create(), operator()(), and ~CACG().
|
private |
Definition at line 904 of file invert_quda.h.
Referenced by compute_beta(), create(), operator()(), and ~CACG().
|
private |
Definition at line 896 of file invert_quda.h.
Referenced by ~CACG().
|
private |
Definition at line 898 of file invert_quda.h.
Referenced by operator()().
|
private |
Definition at line 894 of file invert_quda.h.
Referenced by create(), and operator()().
|
private |
Definition at line 895 of file invert_quda.h.
Referenced by operator()().
|
private |
Definition at line 914 of file invert_quda.h.
Referenced by compute_alpha(), compute_beta(), create(), operator()(), and ~CACG().
|
private |
Definition at line 901 of file invert_quda.h.
Referenced by compute_alpha(), compute_beta(), create(), operator()(), and ~CACG().
|
private |
Definition at line 902 of file invert_quda.h.
Referenced by compute_beta(), create(), operator()(), and ~CACG().
|
private |
Definition at line 915 of file invert_quda.h.
Referenced by create(), operator()(), and ~CACG().
|
private |
Definition at line 906 of file invert_quda.h.
Referenced by create(), operator()(), and ~CACG().
|
private |
Definition at line 912 of file invert_quda.h.
|
private |
Definition at line 909 of file invert_quda.h.
Referenced by create(), operator()(), and ~CACG().
|
private |
Definition at line 910 of file invert_quda.h.
Referenced by create(), operator()(), and ~CACG().
|
private |
Definition at line 907 of file invert_quda.h.
Referenced by create(), operator()(), and ~CACG().
|
private |
Definition at line 908 of file invert_quda.h.
Referenced by create(), operator()(), and ~CACG().