8 #ifndef CHROMA_USE_CG_DWF_LOWMEM
10 #ifndef __prec_dwf_qprop_array_cg_dwf_w_h__
11 #define __prec_dwf_qprop_array_cg_dwf_w_h__
26 template<
typename SinglePrecSolver,
typename DoublePrecSolver >
31 typedef LatticeFermion
T;
32 typedef multi1d<LatticeColorMatrix>
P;
33 typedef multi1d<LatticeColorMatrix>
Q;
43 const Real& OverMass_,
49 {
init(state_, invParam_);}
58 const Subset&
subset()
const {
return all;}
69 QDPIO::cout <<
"entering CGDWFQpropT::operator()" << std::endl;
82 double m_f = toDouble(
Mass);
87 #ifdef SINGLE_PREC_SOLVER
94 QDPIO::cout <<
"CGDWFQpropT: Beginning Single Precision Solve" << std::endl;
95 single_prec_solver.cgSolver(
psi, M5, m_f,
100 #ifdef DOUBLE_PREC_SOLVER
103 double rsd_sq = rsd * rsd;
106 QDPIO::cout <<
"CGDWFQpropT: Beginning Double Precision Solve" << std::endl;
107 double_prec_solver.cgSolver(
psi, M5, m_f,
112 QDPIO::cout <<
"CGDWFQpropT: Single Prec. Iters = " << single_count <<
" Double Prec. Iters = " << double_count <<
" Total Iters = " << res.
n_count << std::endl;
116 multi1d<LatticeFermion>
r(
N5);
119 res.
resid = sqrt(norm2(
r));
122 QDPIO::cout <<
"exiting CGDWFQpropT::operator()" << std::endl;
133 QDPIO::cout <<
"entering CGDWFQpropT::init" << std::endl;
135 if (
Nd != 4 || Nc != 3) {
137 QDPIO::cerr <<
"CGDWFQpropT: only supports Nd=4 and Nc=3" << std::endl;
145 std::istringstream is(inv.
xml);
146 XMLReader paramtop(is);
152 QDPIO::cerr <<
"CGDWFQpropT: only support a CG inverter" << std::endl;
156 multi1d<int> lattice_size(
Nd+1);
157 lattice_size[
Nd] =
N5;
158 for(
int i=0;
i <
Nd; ++
i)
159 lattice_size[
i] = Layout::lattSize()[
i];
163 QDPIO::cerr <<
"SSE qpropT only N5 that is multiple of 2" << std::endl;
167 #ifdef SINGLE_PREC_SOLVER
169 int stat = single_prec_solver.init(lattice_size.slice(), NULL, NULL);
172 QDPIO::cerr << __func__ <<
": error in SP solver init: " << dwf_error_str <<
" error code is " << stat << std::endl;
176 #ifdef DOUBLE_PREC_SOLVER
178 int stat2 = double_prec_solver.init(lattice_size.slice(), NULL, NULL);
181 QDPIO::cerr << __func__ <<
": error in DP solver init: " << dwf_error_str2 <<
" error code is " << stat2 << std::endl;
186 multi1d<LatticeColorMatrix>
u =
state->getLinks();
193 for(
int mu=0;
mu <
u.size(); ++
mu) {
201 multi1d<LatticeColorMatrix> v(
Nd);
202 for (
int i = 0;
i <
Nd;
i++)
203 v[
i] = shift(
u[
i], -1,
i);
206 #ifdef SINGLE_PREC_SOLVER
208 swatch.reset(); swatch.start();
209 single_prec_solver.loadGauge(&
u, &v);
211 QDPIO::cout <<
"Single Precision Gauge Field Import took: " << swatch.getTimeInSeconds() <<
" seconds " << std::endl;
213 #ifdef DOUBLE_PREC_SOLVER
214 swatch.reset(); swatch.start();
215 double_prec_solver.loadGauge(&
u, &v);
217 QDPIO::cout <<
"Double Precision Gauge Field Import took: " << swatch.getTimeInSeconds() <<
" seconds " << std::endl;
220 QDPIO::cout <<
"exiting CGDWFQpropT::init" << std::endl;
225 QDPIO::cout <<
"CGDWFQpropT: calling destructor" << std::endl;
226 #ifdef SINGLE_PREC_SOLVER
227 single_prec_solver.deleteGauge();
228 single_prec_solver.fini();
231 #ifdef DOUBLE_PREC_SOLVER
232 double_prec_solver.deleteGauge();
233 double_prec_solver.fini();
238 #ifdef SINGLE_PREC_SOLVER
239 SinglePrecSolver single_prec_solver;
242 #ifdef DOUBLE_PREC_SOLVER
243 DoublePrecSolver double_prec_solver;
SSE Propagator DWF qpropT.
multi1d< LatticeColorMatrix > P
SystemSolverResults_t operator()(multi1d< LatticeFermion > &psi, const multi1d< LatticeFermion > &chi) const
Solver the linear system.
multi1d< LatticeColorMatrix > Q
SysSolverCGParams invParam
void fini()
Private internal destructor.
int size() const
Expected length of array index.
const Subset & subset() const
Return the subset on which the operator acts.
CGDWFQpropT(Handle< EvenOddPrecConstDetLinearOperatorArray< T, P, Q > > A_, Handle< LinOpSystemSolverArray< T > > invA_, Handle< FermState< T, P, Q > > state_, const Real &OverMass_, const Real &Mass_, const AnisoParam_t &anisoParam_, const GroupXML_t &invParam_)
Alternative constructor for compatibility.
~CGDWFQpropT()
Need a real destructor.
void init(Handle< FermState< T, P, Q > > state, const GroupXML_t &inv)
Private internal initializer.
Handle< EvenOddPrecConstDetLinearOperatorArray< T, P, Q > > A
Even-odd preconditioned linear operator including derivatives for arrays.
Support class for fermion actions and linear operators.
Class for counted reference semantics.
SystemSolver disambiguator.
Linear system solvers of arrays.
Even-odd const determinant Wilson-like fermact.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams ¶m)
Read parameters.
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
multi1d< LatticeFermion > chi(Ncb)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Parameters for anisotropy.
Hold group xml and type id.
Holds return info from SystemSolver call.