39 int reliable(
double &rNorm,
double &maxrx,
double &maxrr,
const double &r2,
const double &delta) {
42 if (rNorm > maxrx) maxrx = rNorm;
43 if (rNorm > maxrr) maxrr = rNorm;
46 int updateR = (rNorm < delta*maxrr) ? 1 : 0;
106 errorQuda(
"Null vector computing requires non-zero guess!");
158 const bool use_heavy_quark_res =
177 double rNorm =
sqrt(r2);
179 double maxrr = rNorm;
180 double maxrx = rNorm;
182 PrintStats(
"BiCGstab", k, r2, b2, heavy_quark_res);
195 printfQuda(
"BiCGstab debug: x2=%e, r2=%e, v2=%e, p2=%e, tmp2=%e r0=%e t2=%e\n",
211 if (
abs(rho) == 0.0) alpha = 0.0;
212 else alpha = rho / r0v;
224 double t2 = omega_t2.z;
236 omega =
Complex(omega_t2.x / omega_t2.z, omega_t2.y / omega_t2.z);
248 rho =
Complex(rho_r2.x, rho_r2.y);
252 if (use_heavy_quark_res && k%heavy_quark_check==0) {
253 if (&x != &xSloppy) {
284 PrintStats(
"BiCGstab", k, r2, b2, heavy_quark_res);
286 printfQuda(
"BiCGstab debug: x2=%e, r2=%e, v2=%e, p2=%e, tmp2=%e r0=%e t2=%e\n",
292 if (
abs(rho*alpha) == 0.0) beta = 0.0;
293 else beta = (rho/rho0) * (alpha/
omega);
345 if (&x != &xSloppy)
delete x_sloppy;
BiCGstab(const DiracMatrix &mat, const DiracMatrix &matSloppy, const DiracMatrix &matPrecon, const DiracMatrix &matEig, SolverParam ¶m, TimeProfile &profile)
void operator()(ColorSpinorField &out, ColorSpinorField &in)
static ColorSpinorField * Create(const ColorSpinorParam ¶m)
unsigned long long flops() const
QudaPrecision Precision() const
bool convergence(double r2, double hq2, double r2_tol, double hq_tol)
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)....
static double stopping(double tol, double b2, QudaResidualType residual_type)
Set the solver L2 stopping condition.
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)
const DiracMatrix & matPrecon
const DiracMatrix & matSloppy
double Last(QudaProfileType idx)
void mat(void *out, void **link, void *in, int dagger_bit, int mu, QudaPrecision sPrecision, QudaPrecision gPrecision)
cudaColorSpinorField * tmp
@ QUDA_USE_INIT_GUESS_YES
@ QUDA_HEAVY_QUARK_RESIDUAL
@ QUDA_PRESERVE_SOURCE_NO
@ QUDA_COMPUTE_NULL_VECTOR_NO
@ QUDA_COMPUTE_NULL_VECTOR_YES
void init()
Create the BLAS context.
void caxpbypzYmbw(const Complex &, ColorSpinorField &, const Complex &, ColorSpinorField &, ColorSpinorField &, ColorSpinorField &)
double3 HeavyQuarkResidualNorm(ColorSpinorField &x, ColorSpinorField &r)
double xmyNorm(ColorSpinorField &x, ColorSpinorField &y)
double3 caxpbypzYmbwcDotProductUYNormY(const Complex &a, ColorSpinorField &x, const Complex &b, ColorSpinorField &y, ColorSpinorField &z, ColorSpinorField &w, ColorSpinorField &u)
double3 xpyHeavyQuarkResidualNorm(ColorSpinorField &x, ColorSpinorField &y, ColorSpinorField &r)
void zero(ColorSpinorField &a)
double norm2(const ColorSpinorField &a)
double3 cDotProductNormA(ColorSpinorField &a, ColorSpinorField &b)
void caxpy(const Complex &a, ColorSpinorField &x, ColorSpinorField &y)
void cxpaypbz(ColorSpinorField &, const Complex &b, ColorSpinorField &y, const Complex &c, ColorSpinorField &z)
void xpy(ColorSpinorField &x, ColorSpinorField &y)
void copy(ColorSpinorField &dst, const ColorSpinorField &src)
Complex cDotProduct(ColorSpinorField &, ColorSpinorField &)
void stop()
Stop profiling.
__host__ __device__ ValueType conj(ValueType x)
int reliable(double &rNorm, double &maxrx, double &maxrr, const double &r2, const double &delta)
std::complex< double > Complex
__host__ __device__ ValueType sqrt(ValueType x)
__host__ __device__ ValueType abs(ValueType x)
void fillInnerSolveParam(SolverParam &inner, const SolverParam &outer)
void updateR()
update the radius for halos.
QudaPreserveSource preserve_source
QudaComputeNullVector compute_null_vector
bool is_preconditioner
verbosity to use for preconditioner
bool use_sloppy_partial_accumulator
QudaResidualType residual_type
QudaPrecision precision_sloppy
QudaUseInitGuess use_init_guess
QudaVerbosity getVerbosity()