10 template<
typename T,
typename TF,
typename RF>
23 const Subset&
s =
A.subset();
35 FlopCounter flopcount;
51 flopcount.addFlops(2*
A.nFlops());
52 flopcount.addSiteFlops(2*Nc*Ns,
s);
61 flopcount.addSiteFlops(4*Nc*Ns,
s);
64 QDPIO::cout <<
"Reliable CG: || r0 ||/|| b ||=" << sqrt(r_sq/
chi_norm) << std::endl;
80 for(
k = 0;
k <
MaxCG && !convP;
k++) {
87 p[
s] =
r + br*
p; flopcount.addSiteFlops(4*Nc*Ns,
s);
108 flopcount.addSiteFlops(16*Nc*Ns,
s);
109 flopcount.addFlops(2*
A.nFlops());
113 if( toBool( rNorm > maxrx) ) maxrx = rNorm;
114 if( toBool( rNorm > maxrr) ) maxrr = rNorm;
116 updateX = toBool ( rNorm < Delta*r0Norm && r0Norm <= maxrx );
117 updateR = toBool ( rNorm < Delta*maxrr && r0Norm <= maxrr ) || updateX;
126 A(tmp1, x_dble,
PLUS);
133 r_sq = norm2(r_dble,
s);
135 flopcount.addSiteFlops(6*Nc*Ns,
s);
136 flopcount.addFlops(2*
A.nFlops());
143 if( ! updateR ) { x_dble[
s]=
x; }
145 flopcount.addSiteFlops(2*Nc*Ns,
s);
156 if( toBool(r_sq <
rsd_sq ) ) {
164 flopcount.addSiteFlops(2*Nc*Ns,
s);
177 flopcount.report(
"reliable_invcg2", swatch.getTimeInSeconds());
181 QDPIO::cout <<
"Nonconvergence: Reliable CG Failed to converge in " <<
MaxCG <<
" iterations " << std::endl;
192 SystemSolverResults_t
194 const LatticeFermionF&
chi,
195 LatticeFermionF&
psi,
201 return RelInvCG_a<LatticeFermionF,LatticeFermionF, RealF>(
A,
A,
chi,
psi,
RsdCG, Delta,
MaxCG);
205 SystemSolverResults_t
207 const LatticeFermionD&
chi,
208 LatticeFermionD&
psi,
213 return RelInvCG_a<LatticeFermionD, LatticeFermionD, RealD>(
A,
A,
chi,
psi,
RsdCG, Delta,
MaxCG);
217 SystemSolverResults_t
220 const LatticeFermionD&
chi,
221 LatticeFermionD&
psi,
226 return RelInvCG_a<LatticeFermionD, LatticeFermionF, RealF>(
A,AF,
chi,
psi,
RsdCG, Delta,
MaxCG);
Primary include file for CHROMA library code.
SystemSolverResults_t InvCGReliable(const LinearOperator< LatticeFermionF > &A, const LatticeFermionF &chi, LatticeFermionF &psi, const Real &RsdCG, const Real &Delta, int MaxCG)
Bi-CG stabilized.
static const LatticeInteger & beta(const int dim)
Asqtad Staggered-Dirac operator.
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > enum InvType invType const multi1d< Real > & RsdCG
LinOpSysSolverMGProtoClover::T T
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > enum InvType invType const multi1d< Real > int MaxCG
multi1d< LatticeFermion > chi(Ncb)
SystemSolverResults_t RelInvCG_a(const LinearOperator< T > &A, const LinearOperator< TF > &AF, const T &chi, T &psi, const Real &RsdCG, const Real &Delta, int MaxCG)
multi1d< LatticeFermion > mp(Ncb)
multi1d< LatticeFermion > s(Ncb)
FloatingPoint< double > Double
BiCGStab Solver with reliable updates.
Holds return info from SystemSolver call.