QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
quda::CAGCR Class Reference

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>

Inheritance diagram for quda::CAGCR:
Inheritance graph
[legend]
Collaboration diagram for quda::CAGCR:
Collaboration graph
[legend]

Public Member Functions

 CAGCR (DiracMatrix &mat, DiracMatrix &matSloppy, SolverParam &param, TimeProfile &profile)
 
virtual ~CAGCR ()
 
void operator() (ColorSpinorField &out, ColorSpinorField &in)
 
- Public Member Functions inherited from quda::Solver
 Solver (SolverParam &param, 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 DiracMatrixmat
 
const DiracMatrixmatSloppy
 
bool init
 
QudaCABasis basis
 
Complexalpha
 
ColorSpinorFieldrp
 
ColorSpinorFieldtmpp
 
ColorSpinorFieldtmp_sloppy
 
std::vector< ColorSpinorField * > p
 
std::vector< ColorSpinorField * > q
 

Additional Inherited Members

- Static Public Member Functions inherited from quda::Solver
static Solvercreate (SolverParam &param, 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...
 
- Public Attributes inherited from quda::Solver
EigenSolvereig_solve
 
bool deflate_init = false
 
std::vector< ColorSpinorField * > defl_tmp1
 
std::vector< ColorSpinorField * > defl_tmp2
 
- Protected Attributes inherited from quda::Solver
SolverParamparam
 
TimeProfileprofile
 
int node_parity
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CAGCR()

quda::CAGCR::CAGCR ( DiracMatrix mat,
DiracMatrix matSloppy,
SolverParam param,
TimeProfile profile 
)

Definition at line 7 of file inv_ca_gcr.cpp.

◆ ~CAGCR()

quda::CAGCR::~CAGCR ( )
virtual

Member Function Documentation

◆ create()

void quda::CAGCR::create ( ColorSpinorField b)
private

Initiate the fields needed by the solver.

Parameters
[in]bSource 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()().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator()()

void quda::CAGCR::operator() ( ColorSpinorField out,
ColorSpinorField in 
)
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().

Here is the call graph for this function:

◆ solve()

void quda::CAGCR::solve ( Complex psi_,
std::vector< ColorSpinorField *> &  q,
ColorSpinorField b 
)
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.

Parameters
[out]psiArray of coefficients
[in]qSearch direction vectors with the operator applied
[in]bSource 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()().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ alpha

Complex* quda::CAGCR::alpha
private

Definition at line 1001 of file invert_quda.h.

Referenced by create(), operator()(), and ~CAGCR().

◆ basis

QudaCABasis quda::CAGCR::basis
private

Definition at line 999 of file invert_quda.h.

Referenced by create(), operator()(), and ~CAGCR().

◆ init

bool quda::CAGCR::init
private

Definition at line 995 of file invert_quda.h.

Referenced by create(), and ~CAGCR().

◆ mat

const DiracMatrix& quda::CAGCR::mat
private

Definition at line 993 of file invert_quda.h.

Referenced by create(), and operator()().

◆ matSloppy

const DiracMatrix& quda::CAGCR::matSloppy
private

Definition at line 994 of file invert_quda.h.

Referenced by operator()().

◆ p

std::vector<ColorSpinorField*> quda::CAGCR::p
private

Definition at line 1007 of file invert_quda.h.

Referenced by create(), operator()(), and ~CAGCR().

◆ q

std::vector<ColorSpinorField*> quda::CAGCR::q
private

Definition at line 1008 of file invert_quda.h.

Referenced by create(), operator()(), and ~CAGCR().

◆ rp

ColorSpinorField* quda::CAGCR::rp
private

Definition at line 1003 of file invert_quda.h.

Referenced by create(), operator()(), and ~CAGCR().

◆ tmp_sloppy

ColorSpinorField* quda::CAGCR::tmp_sloppy
private

Definition at line 1005 of file invert_quda.h.

Referenced by create(), operator()(), and ~CAGCR().

◆ tmpp

ColorSpinorField* quda::CAGCR::tmpp
private

Definition at line 1004 of file invert_quda.h.

Referenced by create(), operator()(), and ~CAGCR().


The documentation for this class was generated from the following files: