12 using namespace BiCGStabKernels;
14 template<
typename T,
typename TF,
typename CF>
20 const Real& RsdBiCGStab,
29 const Subset&
s =
A.subset();
51 FlopCounter flopcount;
77 QDPIO::cout <<
"r0 = " << b_sq << std::endl;;
79 flopcount.addFlops(
A.nFlops());
80 flopcount.addSiteFlops(2*Nc*Ns,
s);
81 flopcount.addSiteFlops(4*Nc*Ns,
s);
98 CF rho_r, alpha_r, omega_r;
107 for(
k = 0;
k < MaxBiCGStab && !convP ;
k++) {
142 if( toBool( real(ctmp) == 0 ) && toBool( imag(ctmp) == 0 ) ) {
143 QDPIO::cout <<
"BiCGStab breakdown: <r_0|v> = 0" << std::endl;
204 flopcount.addSiteFlops(80*Nc*Ns,
s);
205 flopcount.addFlops(2*
A.nFlops());
210 if( toBool( rNorm > maxrx) ) maxrx = rNorm;
211 if( toBool( rNorm > maxrr) ) maxrr = rNorm;
213 updateX = toBool ( rNorm < Delta*r0Norm && r0Norm <= maxrx );
214 updateR = toBool ( rNorm < Delta*maxrr && r0Norm <= maxrr ) || updateX;
232 flopcount.addSiteFlops(6*Nc*Ns,
s);
233 flopcount.addFlops(
A.nFlops());
242 if( ! updateR ) { x_dble[
s]=
x; }
244 flopcount.addSiteFlops(2*Nc*Ns,
s);
255 if( toBool(r_sq <
rsd_sq ) ) {
264 flopcount.addSiteFlops(2*Nc*Ns,
s);
276 if(
k >= MaxBiCGStab ) {
277 QDPIO::cerr <<
"Nonconvergence of reliable BiCGStab. MaxIters = " << MaxBiCGStab <<
" exceeded" << std::endl;
281 QDPIO::cout <<
"reliable_bicgstab: n_count " << ret.
n_count <<
" r-updates: " << rupdates <<
" xr-updates: " << xupdates << std::endl;
282 flopcount.report(
"reliable_bicgstab", swatch.getTimeInSeconds());
294 SystemSolverResults_t
296 const LatticeFermionF&
chi,
297 LatticeFermionF&
psi,
298 const Real& RsdBiCGStab,
304 return RelInvBiCGStab_a<LatticeFermionF,LatticeFermionF, ComplexF>(
A,
A,
chi,
psi, RsdBiCGStab, Delta, MaxBiCGStab,
isign);
308 SystemSolverResults_t
310 const LatticeFermionD&
chi,
311 LatticeFermionD&
psi,
312 const Real& RsdBiCGStab,
318 return RelInvBiCGStab_a<LatticeFermionD, LatticeFermionD, ComplexD>(
A,
A,
chi,
psi, RsdBiCGStab, Delta, MaxBiCGStab,
isign);
322 SystemSolverResults_t
325 const LatticeFermionD&
chi,
326 LatticeFermionD&
psi,
327 const Real& RsdBiCGStab,
333 return RelInvBiCGStab_a<LatticeFermionD, LatticeFermionF, ComplexF>(
A,AF,
chi,
psi, RsdBiCGStab, Delta, MaxBiCGStab,
isign);
Primary include file for CHROMA library code.
SystemSolverResults_t InvBiCGStabReliable(const LinearOperator< LatticeFermionF > &A, const LatticeFermionF &chi, LatticeFermionF &psi, const Real &RsdBiCGStab, const Real &Delta, int MaxBiCGStab, enum PlusMinus isign)
Bi-CG stabilized.
void xpaypbz(T &x, T &y, T &z, C &a, C &b, const Subset &s)
void xmay_normx_cdotzx(T &x, const T &y, const T &z, C &a, Double &normx, DComplex &cdotzx, const Subset &s)
void xymz_normx(T &x, const T &y, const T &z, Double &x_norm, const Subset &s)
void norm2x_cdotxy(const T &x, const T &y, Double &norm2x, DComplex &cdotxy, const Subset &s)
void cxmay(T &x, const T &y, const C &a, const Subset &s)
void yxpaymabz(T &x, T &y, T &z, const C &a, const C &b, const Subset &s)
BinaryReturn< C1, C2, FnInnerProduct >::Type_t innerProduct(const QDPSubType< T1, C1 > &s1, const QDPType< T2, C2 > &s2)
static const LatticeInteger & beta(const int dim)
static const LatticeInteger & alpha(const int dim)
Asqtad Staggered-Dirac operator.
LinOpSysSolverMGProtoClover::T T
multi1d< LatticeFermion > chi(Ncb)
SystemSolverResults_t RelInvBiCGStab_a(const LinearOperator< T > &A, const LinearOperator< TF > &AF, const T &chi, T &psi, const Real &RsdBiCGStab, const Real &Delta, int MaxBiCGStab, enum PlusMinus isign)
multi1d< LatticeFermion > s(Ncb)
FloatingPoint< double > Double
BiCGStab Solver with reliable updates.
Holds return info from SystemSolver call.