6 #ifndef AVP_INVERTER_INTERFACE_H
7 #define AVP_INVERTER_INTERFACE_H
21 namespace AVPSolverFunctions
26 const int lattice_coord[4],
36 const int lattice_coord[5],
44 const int lattice_addr[5],
53 const int lattice_addr[5],
63 const int lattice_addr[5],
74 template<
typename U,
typename T>
111 int max_iter)
const = 0;
121 virtual int init(
const int lattice[5],
122 void *(*allocator)(
size_t size),
123 void (*deallocator)(
void *)) = 0;
129 const void *OuterGauge_V) = 0;
138 const multi1d<LatticeFermion> &rhs,
139 const multi1d<LatticeFermion> &x0,
143 int &out_iter )
const
151 QDPIO::cout <<
"Importing RHS Fermion took: " << swatch.getTimeInSeconds() <<
" seconds " << std::endl;
156 Fermion *X0 = loadFermionGuess(&x0);
159 QDPIO::cout <<
"Importing Guess took: " << swatch.getTimeInSeconds()
160 <<
" seconds" << std::endl;
162 Fermion *res = allocateFermion();
164 QDPIO::cout <<
"Entering CG_DWF solver: rsd = " << rsd
165 <<
", max_iterations = " << max_iter
178 int status = cgInternal(res, &out_eps, &out_iter,
180 rsd, min_iter, max_iter);
183 QDPIO::cout <<
"CGInternal : status = " << status
184 <<
", iterations = " << out_iter
185 <<
", resulting epsilon = " << out_eps
190 QDPIO::cerr <<
"DWF_solver: status = " << status
191 <<
", iterations = " << out_iter
192 <<
", resulting epsilon = " << out_eps
199 unsigned long Ls = solution.size();
200 unsigned long Ndiag = (4*Ls+2)*Nc*Ns;
201 unsigned long NdiagInv = (10*Ls-8)*Nc*Ns;
202 unsigned long Neo = Ls*(1320+24);
203 unsigned long N_mpsi = 2*Ndiag + 2*Neo + Ls*24;
204 unsigned long Nflops_c = (24*Ls + 2*N_mpsi) + (48*Ls);
205 unsigned long Nflops_s = (2*N_mpsi + Ls*(2*48+2*24));
206 unsigned long long Nflops_per_cbsite = Nflops_c + ( out_iter)*Nflops_s;
207 unsigned long long Nflops_total = Nflops_per_cbsite*(Layout::sitesOnNode()/2);
210 FlopCounter flopcount;
212 flopcount.addFlops(Nflops_total);
213 flopcount.report(
"CGDWFQpropT", swatch.getTimeInSeconds());
218 saveFermionSolver(&solution,res);
221 QDPIO::cout <<
"Exporting Solution took: " << swatch.getTimeInSeconds()
222 <<
" seconds " << std::endl;
Primary include file for CHROMA library code.
virtual void deleteFermion(Fermion *ptr) const =0
virtual int init(const int lattice[5], void *(*allocator)(size_t size), void(*deallocator)(void *))=0
virtual Fermion * allocateFermion(void) const =0
virtual void saveFermionOperator(void *OuterFermion, Fermion *CGfermion) const =0
virtual void saveFermionSolver(void *OuterFermion, Fermion *CGfermion) const =0
int cgSolver(multi1d< LatticeFermion > &solution, double M5, double m_f, const multi1d< LatticeFermion > &rhs, const multi1d< LatticeFermion > &x0, double rsd, int max_iter, double &out_eps, int &out_iter) const
virtual void loadGauge(const void *OuterGauge_U, const void *OuterGauge_V)=0
virtual int cgInternal(Fermion *psi, double *out_eps, int *out_iter, double M, double m_f, const Fermion *x0, const Fermion *eta, double eps, int min_iter, int max_iter) const =0
virtual Fermion * loadFermionGuess(const void *OuterFermion) const =0
virtual void deleteGauge(void)=0
virtual Fermion * loadFermionRHS(const void *OuterFermion) const =0
virtual void fini(void)=0
void fermionWriterOperator(void *OuterFermion, void *env, const int latt_coord[5], int color, int spin, int reim, double val)
double fermionReaderGuess(const void *OuterFermion, void *env, const int latt_coord[5], int color, int spin, int reim)
double gaugeReader(const void *OuterGauge, void *env, const int latt_coord[4], int mu, int row, int col, int reim)
double fermionReaderRHS(const void *OuterFermion, void *env, const int latt_coord[5], int color, int spin, int reim)
void fermionWriterSolver(void *OuterFermion, void *env, const int latt_coord[5], int color, int spin, int reim, double val)
Asqtad Staggered-Dirac operator.
LinOpSysSolverMGProtoClover::T T
multi1d< LatticeColorMatrix > U