QUDA
1.0.0
|
Communication-avoiding GCR solver. This solver does un-preconditioned GCR, first building up a polynomial in the linear operator of length nKrylov, and then performs a minimum residual extrapolation on the resulting basis vectors. For use as a multigrid smoother with minimum global synchronization. More...
#include <invert_quda.h>
Public Member Functions | |
CAGCR (DiracMatrix &mat, DiracMatrix &matSloppy, SolverParam ¶m, TimeProfile &profile) | |
virtual | ~CAGCR () |
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 | solve (Complex *psi_, std::vector< ColorSpinorField *> &q, ColorSpinorField &b) |
Solve the equation A p_k psi_k = q_k psi_k = b by minimizing the least square residual using Eigen's LDLT Cholesky for numerical stability. More... | |
Private Attributes | |
const DiracMatrix & | mat |
const DiracMatrix & | matSloppy |
bool | init |
QudaCABasis | basis |
Complex * | alpha |
ColorSpinorField * | rp |
ColorSpinorField * | tmpp |
ColorSpinorField * | tmp_sloppy |
std::vector< ColorSpinorField * > | p |
std::vector< ColorSpinorField * > | q |
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 GCR solver. This solver does un-preconditioned GCR, first building up a polynomial in the linear operator of length nKrylov, and then performs a minimum residual extrapolation on the resulting basis vectors. For use as a multigrid smoother with minimum global synchronization.
Definition at line 990 of file invert_quda.h.
quda::CAGCR::CAGCR | ( | DiracMatrix & | mat, |
DiracMatrix & | matSloppy, | ||
SolverParam & | param, | ||
TimeProfile & | profile | ||
) |
Definition at line 7 of file inv_ca_gcr.cpp.
|
virtual |
Definition at line 11 of file inv_ca_gcr.cpp.
References alpha, basis, quda::Solver::defl_tmp1, quda::Solver::defl_tmp2, quda::Solver::deflate_init, quda::SolverParam::evecs, init, quda::SolverParam::is_preconditioner, quda::SolverParam::Nkrylov, p, quda::Solver::param, quda::SolverParam::precision, quda::SolverParam::precision_sloppy, quda::SolverParam::preserve_source, quda::Solver::profile, q, QUDA_POWER_BASIS, QUDA_PRESERVE_SOURCE_NO, quda::QUDA_PROFILE_FREE, QUDA_USE_INIT_GUESS_NO, rp, tmp_sloppy, tmpp, and quda::SolverParam::use_init_guess.
|
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 40 of file inv_ca_gcr.cpp.
References alpha, basis, quda::Solver::constructDeflationSpace(), quda::ColorSpinorParam::create, quda::ColorSpinorField::Create(), csParam, quda::SolverParam::deflate, quda::Solver::deflate_init, quda::DiracMatrix::Expose(), quda::blas::flops, init, quda::SolverParam::is_preconditioner, mat, quda::SolverParam::Nkrylov, p, quda::Solver::param, quda::SolverParam::precision, quda::SolverParam::precision_sloppy, quda::SolverParam::preserve_source, quda::Solver::profile, q, QUDA_NULL_FIELD_CREATE, QUDA_POWER_BASIS, QUDA_PRESERVE_SOURCE_NO, quda::QUDA_PROFILE_INIT, QUDA_USE_INIT_GUESS_NO, rp, quda::ColorSpinorParam::setPrecision(), tmp_sloppy, tmpp, quda::SolverParam::use_init_guess, and warningQuda.
Referenced by operator()().
|
virtual |
Implements quda::Solver.
Definition at line 172 of file inv_ca_gcr.cpp.
References alpha, quda::blas::axpy(), basis, quda::blas::caxpy(), checkPrecision, 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::deflateSVD(), 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, 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(), p, quda::Solver::param, quda::SolverParam::precision, quda::SolverParam::preserve_source, printfQuda, quda::Solver::PrintStats(), quda::Solver::PrintSummary(), quda::Solver::profile, q, QUDA_COMPUTE_NULL_VECTOR_NO, QUDA_DEBUG_VERBOSE, QUDA_HEAVY_QUARK_RESIDUAL, QUDA_POWER_BASIS, QUDA_PRESERVE_SOURCE_YES, quda::QUDA_PROFILE_COMPUTE, quda::QUDA_PROFILE_EPILOGUE, quda::QUDA_PROFILE_PREAMBLE, QUDA_SUMMARIZE, QUDA_USE_INIT_GUESS_NO, QUDA_USE_INIT_GUESS_YES, QUDA_VERBOSE, qudaDeviceSynchronize, R, quda::SolverParam::residual_type, quda::SolverParam::return_residual, rp, quda::SolverParam::secs, quda::SolverParam::sloppy_converge, solve(), quda::sqrt(), quda::Solver::stopping(), tmp, tmp_sloppy, tmpp, 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().
|
private |
Solve the equation A p_k psi_k = q_k psi_k = b by minimizing the least square residual using Eigen's LDLT Cholesky for numerical stability.
[out] | psi | Array of coefficients |
[in] | q | Search direction vectors with the operator applied |
[in] | b | Source vector against which we are solving |
Definition at line 99 of file inv_ca_gcr.cpp.
References quda::blas::cDotProduct(), quda::blas::hDotProduct(), quda::SolverParam::is_preconditioner, quda::TimeProfile::Last(), quda::Solver::param, quda::Solver::profile, quda::QUDA_PROFILE_COMPUTE, quda::QUDA_PROFILE_EIGEN, and quda::SolverParam::secs.
Referenced by operator()().
|
private |
Definition at line 1001 of file invert_quda.h.
Referenced by create(), operator()(), and ~CAGCR().
|
private |
Definition at line 999 of file invert_quda.h.
Referenced by create(), operator()(), and ~CAGCR().
|
private |
Definition at line 995 of file invert_quda.h.
|
private |
Definition at line 993 of file invert_quda.h.
Referenced by create(), and operator()().
|
private |
Definition at line 994 of file invert_quda.h.
Referenced by operator()().
|
private |
Definition at line 1007 of file invert_quda.h.
Referenced by create(), operator()(), and ~CAGCR().
|
private |
Definition at line 1008 of file invert_quda.h.
Referenced by create(), operator()(), and ~CAGCR().
|
private |
Definition at line 1003 of file invert_quda.h.
Referenced by create(), operator()(), and ~CAGCR().
|
private |
Definition at line 1005 of file invert_quda.h.
Referenced by create(), operator()(), and ~CAGCR().
|
private |
Definition at line 1004 of file invert_quda.h.
Referenced by create(), operator()(), and ~CAGCR().