9 static void report(
const char *type) {
47 solver =
new CG(mat, matSloppy, param, profile);
51 solver =
new BiCGstab(mat, matSloppy, matPrecon, param, profile);
59 solver =
new GCR(mat, *(mg), matSloppy, matPrecon, param, profile);
61 solver =
new GCR(mat, matSloppy, matPrecon, param, profile);
66 solver =
new CACG(mat, matSloppy, param, profile);
70 solver =
new CACGNE(mat, matSloppy, param, profile);
74 solver =
new CACGNR(mat, matSloppy, param, profile);
78 solver =
new CAGCR(mat, matSloppy, param, profile);
82 solver =
new MR(mat, matSloppy, param, profile);
86 solver =
new SD(mat, param, profile);
91 solver =
new XSD(mat, param, profile);
93 errorQuda(
"Extended Steepest Descent is multi-gpu only");
98 solver =
new PreconCG(mat, matSloppy, matPrecon, param, profile);
102 solver =
new MPCG(mat, param, profile);
110 solver =
new BiCGstabL(mat, matSloppy, param, profile);
114 solver =
new IncEigCG(mat, matSloppy, matPrecon, param, profile);
118 solver =
new IncEigCG(mat, matSloppy, matPrecon, param, profile);
126 solver =
new GMResDR(mat, *(mg->
mg), matSloppy, matPrecon, param, profile);
128 solver =
new GMResDR(mat, matSloppy, matPrecon, param, profile);
133 solver =
new CGNE(mat, matSloppy, param, profile);
137 solver =
new CGNR(mat, matSloppy, param, profile);
141 solver =
new CG3(mat, matSloppy, param, profile);
145 solver =
new CG3NE(mat, matSloppy, param, profile);
150 solver =
new CG3NE(mat, matSloppy, param, profile);
212 double lowest = (b2 < 1.0) ? b2 : 1.0;
213 stop = lowest*tol*
tol;
214 }
else if (residual_type & QUDA_L2_ABSOLUTE_RESIDUAL) {
259 printfQuda(
"%s: %d iterations, <r,r> = %e, |r|/|b| = %e, heavy-quark residual = %e\n",
260 name, k, r2,
sqrt(r2/b2), hq2);
262 printfQuda(
"%s: %d iterations, <r,r> = %e, |r|/|b| = %e\n",
263 name, k, r2,
sqrt(r2/b2));
267 if (std::isnan(r2))
errorQuda(
"Solver appears to have diverged");
271 double r2_tol,
double hq_tol) {
275 printfQuda(
"%s: Convergence at %d iterations, L2 relative residual: iterated = %e, true = %e " 276 "(requested = %e), heavy-quark residual = %e (requested = %e)\n",
279 printfQuda(
"%s: Convergence at %d iterations, L2 relative residual: iterated = %e, true = %e (requested = %e)\n",
284 printfQuda(
"%s: Convergence at %d iterations, L2 relative residual: iterated = %e " 285 "(requested = %e), heavy-quark residual = %e (requested = %e)\n",
288 printfQuda(
"%s: Convergence at %d iterations, L2 relative residual: iterated = %e (requested = %e)\n",
289 name, k,
sqrt(r2/b2),
sqrt(r2_tol/b2));
297 for (
int i=0; i<n; i++) {
bool mg_instance
whether to use a global or local (node) reduction for this solver
Communication-avoiding CG solver. This solver does un-preconditioned CG, running in steps of nKrylov...
void setPrecision(QudaPrecision precision, QudaPrecision ghost_precision=QUDA_INVALID_PRECISION, bool force_native=false)
bool convergenceHQ(double r2, double hq2, double r2_tol, double hq_tol)
Test for HQ solver convergence – ignore L2 residual.
enum QudaResidualType_s QudaResidualType
QudaInverterType inv_type
QudaVerbosity getVerbosity()
__host__ __device__ ValueType sqrt(ValueType x)
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) ...
Communication-avoiding GCR solver. This solver does un-preconditioned GCR, first building up a polyno...
static ColorSpinorField * Create(const ColorSpinorParam ¶m)
bool convergence(double r2, double hq2, double r2_tol, double hq_tol)
ColorSpinorField & Component(const int idx) const
QudaInverterType inv_type_precondition
std::vector< ColorSpinorField * > defl_tmp1
bool convergenceL2(double r2, double hq2, double r2_tol, double hq_tol)
Test for L2 solver convergence – ignore HQ residual.
std::vector< ColorSpinorField * > defl_tmp2
bool convergence(const double *r2, const double *r2_tol, int n) const
static EigenSolver * create(QudaEigParam *eig_param, const DiracMatrix &mat, TimeProfile &profile)
Creates the eigensolver using the parameters given and the matrix.
QudaResidualType residual_type
double true_res_hq_offset[QUDA_MAX_MULTI_SHIFT]
static double stopping(double tol, double b2, QudaResidualType residual_type)
Set the solver L2 stopping condition.
static Solver * create(SolverParam ¶m, DiracMatrix &mat, DiracMatrix &matSloppy, DiracMatrix &matPrecon, TimeProfile &profile)
virtual void blocksolve(ColorSpinorField &out, ColorSpinorField &in)
void constructDeflationSpace(const ColorSpinorField &meta, const DiracMatrix &mat, bool svd)
Constructs the deflation space.
void computeSVD(const DiracMatrix &mat, std::vector< ColorSpinorField *> &evecs, std::vector< Complex > &evals)
Computes Left/Right SVD from pre computed Right/Left.
double true_res_offset[QUDA_MAX_MULTI_SHIFT]
std::vector< Complex > evals
QudaPrecision precision_precondition
std::vector< ColorSpinorField * > evecs
Solver(SolverParam ¶m, TimeProfile &profile)
cpuColorSpinorField * out
static void report(const char *type)
Conjugate-Gradient Solver.
QudaPrecision precision_sloppy
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.
void mat(void *out, void **link, void *in, int dagger_bit, int mu, QudaPrecision sPrecision, QudaPrecision gPrecision)