QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
quda::Solver Class Referenceabstract

#include <invert_quda.h>

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

Public Member Functions

 Solver (SolverParam &param, TimeProfile &profile)
 
virtual ~Solver ()
 
virtual void operator() (ColorSpinorField &out, ColorSpinorField &in)=0
 
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
 

Static Public Member Functions

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

EigenSolvereig_solve
 
bool deflate_init = false
 
std::vector< ColorSpinorField * > defl_tmp1
 
std::vector< ColorSpinorField * > defl_tmp2
 

Protected Attributes

SolverParamparam
 
TimeProfileprofile
 
int node_parity
 

Detailed Description

Definition at line 460 of file invert_quda.h.

Constructor & Destructor Documentation

◆ Solver()

quda::Solver::Solver ( SolverParam param,
TimeProfile profile 
)

Definition at line 13 of file solver.cpp.

References commCoords(), and node_parity.

Here is the call graph for this function:

◆ ~Solver()

quda::Solver::~Solver ( )
virtual

Definition at line 24 of file solver.cpp.

References eig_solve.

Member Function Documentation

◆ blocksolve()

void quda::Solver::blocksolve ( ColorSpinorField out,
ColorSpinorField in 
)
virtual

Reimplemented in quda::CG.

Definition at line 198 of file solver.cpp.

References quda::ColorSpinorField::Component(), quda::SolverParam::num_src, param, quda::SolverParam::true_res, quda::SolverParam::true_res_hq, quda::SolverParam::true_res_hq_offset, and quda::SolverParam::true_res_offset.

Referenced by invertMultiSrcQuda().

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

◆ constructDeflationSpace()

void quda::Solver::constructDeflationSpace ( const ColorSpinorField meta,
const DiracMatrix mat,
bool  svd 
)

Constructs the deflation space.

Parameters
[in]metaA sample ColorSpinorField with which to instantiate the eigensolver
[in]matThe operator to eigensolve
[in]Whetherto compute the SVD

Definition at line 159 of file solver.cpp.

References quda::EigenSolver::computeSVD(), quda::EigenSolver::create(), quda::ColorSpinorParam::create, quda::ColorSpinorField::Create(), csParam, defl_tmp1, defl_tmp2, deflate_init, quda::SolverParam::eig_param, eig_solve, quda::SolverParam::evals, quda::SolverParam::evecs, QudaEigParam_s::nConv, param, quda::SolverParam::precision_sloppy, profile, QUDA_INVALID_PRECISION, quda::QUDA_PROFILE_INIT, QUDA_ZERO_FIELD_CREATE, and quda::ColorSpinorParam::setPrecision().

Referenced by quda::CACG::create(), quda::CAGCR::create(), quda::CG::operator()(), and quda::GCR::operator()().

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

◆ convergence()

bool quda::Solver::convergence ( double  r2,
double  hq2,
double  r2_tol,
double  hq_tol 
)

◆ convergenceHQ()

bool quda::Solver::convergenceHQ ( double  r2,
double  hq2,
double  r2_tol,
double  hq_tol 
)

Test for HQ solver convergence – ignore L2 residual.

Parameters
[in]r2L2 norm squared of the residual
[in]hq2Heavy quark residual
[in]r2_tolSolver L2 tolerance

Definition at line 237 of file solver.cpp.

References param, QUDA_HEAVY_QUARK_RESIDUAL, and quda::SolverParam::residual_type.

Referenced by quda::CG::blocksolve(), quda::CG::operator()(), quda::CG3::operator()(), and quda::CG3NE::operator()().

Here is the caller graph for this function:

◆ convergenceL2()

bool quda::Solver::convergenceL2 ( double  r2,
double  hq2,
double  r2_tol,
double  hq_tol 
)

Test for L2 solver convergence – ignore HQ residual.

Parameters
[in]r2L2 norm squared of the residual
[in]hq2Heavy quark residual
[in]r2_tolSolver L2 tolerance
[in]hq_tolSolver heavy-quark tolerance

Definition at line 246 of file solver.cpp.

References param, QUDA_L2_ABSOLUTE_RESIDUAL, QUDA_L2_RELATIVE_RESIDUAL, and quda::SolverParam::residual_type.

Referenced by quda::CG::blocksolve(), and quda::CG::operator()().

Here is the caller graph for this function:

◆ create()

Solver * quda::Solver::create ( SolverParam param,
DiracMatrix mat,
DiracMatrix matSloppy,
DiracMatrix matPrecon,
TimeProfile profile 
)
static

◆ flops()

virtual double quda::Solver::flops ( ) const
inlinevirtual

Return flops

Returns
flops expended by this operator

Reimplemented in quda::MG.

Definition at line 563 of file invert_quda.h.

Referenced by quda::GCR::operator()().

Here is the caller graph for this function:

◆ operator()()

virtual void quda::Solver::operator() ( ColorSpinorField out,
ColorSpinorField in 
)
pure virtual

◆ PrintStats()

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)

Parameters
[in]nameName of solver that called this
[in]kiteration count
[in]r2L2 norm squared of the residual
[in]hq2Heavy quark residual

Definition at line 256 of file solver.cpp.

References errorQuda, getVerbosity(), param, printfQuda, QUDA_HEAVY_QUARK_RESIDUAL, QUDA_VERBOSE, quda::SolverParam::residual_type, and quda::sqrt().

Referenced by quda::CG::blocksolve(), quda::IncEigCG::eigCGsolve(), quda::CG::operator()(), quda::CG3::operator()(), quda::CG3NE::operator()(), quda::MPCG::operator()(), quda::PreconCG::operator()(), quda::BiCGstab::operator()(), quda::SimpleBiCGstab::operator()(), quda::MPBiCGstab::operator()(), quda::BiCGstabL::operator()(), quda::GCR::operator()(), quda::CACG::operator()(), quda::CAGCR::operator()(), and quda::GMResDR::operator()().

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

◆ PrintSummary()

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.

Parameters
[in]nameName of solver that called this
[in]kiteration count
[in]r2L2 norm squared of the residual
[in]hq2Heavy quark residual
[in]r2_tolSolver L2 tolerance
[in]hq_tolSolver heavy-quark tolerance

Definition at line 270 of file solver.cpp.

References quda::SolverParam::compute_true_res, getVerbosity(), param, printfQuda, QUDA_HEAVY_QUARK_RESIDUAL, QUDA_SUMMARIZE, quda::SolverParam::residual_type, quda::sqrt(), quda::SolverParam::true_res, and quda::SolverParam::true_res_hq.

Referenced by quda::CG::blocksolve(), quda::IncEigCG::eigCGsolve(), quda::CG::operator()(), quda::CG3::operator()(), quda::CG3NE::operator()(), quda::CGNE::operator()(), quda::CGNR::operator()(), quda::MPCG::operator()(), quda::BiCGstab::operator()(), quda::SimpleBiCGstab::operator()(), quda::MPBiCGstab::operator()(), quda::BiCGstabL::operator()(), quda::GCR::operator()(), quda::CACG::operator()(), quda::CACGNE::operator()(), quda::CACGNR::operator()(), quda::CAGCR::operator()(), quda::IncEigCG::operator()(), and quda::GMResDR::operator()().

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

◆ stopping()

double quda::Solver::stopping ( double  tol,
double  b2,
QudaResidualType  residual_type 
)
static

Member Data Documentation

◆ defl_tmp1

std::vector<ColorSpinorField *> quda::Solver::defl_tmp1

◆ defl_tmp2

std::vector<ColorSpinorField *> quda::Solver::defl_tmp2

◆ deflate_init

bool quda::Solver::deflate_init = false

◆ eig_solve

EigenSolver* quda::Solver::eig_solve

◆ node_parity

int quda::Solver::node_parity
protected

Definition at line 465 of file invert_quda.h.

Referenced by quda::MR::operator()(), and Solver().

◆ param

SolverParam& quda::Solver::param
protected

◆ profile

TimeProfile& quda::Solver::profile
protected

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