17 namespace MdagMMultiSysSolverCGQudaWilsonEnv
22 Handle<
FermState< LatticeFermion, multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> > >
state,
48 MdagMMultiSysSolverCGQudaWilson::qudaInvertMulti(
const T& chi_s,
50 const multi1d<Real> shifts)
const{
52 SystemSolverResults_t ret;
55 void *spinorIn=(
void *)&(chi_s.elem(rb[1].start()).elem(0).elem(0).real());
58 void** spinorOut =
new void*[shifts.size()];
61 if (spinorOut ==
nullptr ) {
62 QDPIO::cerr <<
"Couldn't allocate spinorOut" << std::endl;
68 psi_s.resize( shifts.size());
70 if ( shifts.size() > QUDA_MAX_MULTI_SHIFT ) {
71 QDPIO::cerr <<
"You want more shifts than QUDA_MAX_MULTI_SHIFT" << std::endl;
72 QDPIO::cerr <<
"Requested : " << shifts.size() <<
" QUDA_MAX_MULTI_SHIFT=" << QUDA_MAX_MULTI_SHIFT << std::endl;
76 for(
int s=0;
s < shifts.size();
s++) {
77 psi_s[
s][ rb[1] ] =
zero;
78 spinorOut[
s] = (
void *)&(psi_s[
s].elem(rb[1].start()).elem(0).elem(0).real());
79 quda_inv_param.offset[
s] = toDouble(shifts[
s]);
81 quda_inv_param.num_offset = shifts.size();
83 for (
int i=0;
i< quda_inv_param.num_offset;
i++) quda_inv_param.tol_offset[
i] = quda_inv_param.tol;
88 QDPIO::cout <<
"CALLING QUDA SOLVER" << std::endl << std::flush ;
89 invertMultiShiftQuda(spinorOut, spinorIn, (QudaInvertParam*)&quda_inv_param);
96 QDPIO::cout <<
"QUDA_"<<solver_string<<
"_WILSON_SOLVER: time="<< quda_inv_param.secs <<
" s" ;
97 QDPIO::cout <<
"\tPerformance="<< quda_inv_param.gflops/quda_inv_param.secs<<
" GFLOPS" ;
98 QDPIO::cout <<
"\tTotal Time (incl. load gauge)=" << swatch1.getTimeInSeconds() <<
" s"<<std::endl;
100 ret.n_count =quda_inv_param.iter;
Support class for fermion actions and linear operators.
Class for counted reference semantics.
Register MdagM system solvers.
Solve a MdagM*psi=chi linear system by CG2 using CG.
Factory for producing system solvers for MdagM*psi = chi.
MdagMMultiSystemSolver< LatticeFermion > * createFerm(XMLReader &xml_in, const std::string &path, Handle< FermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, Handle< LinearOperator< LatticeFermion > > A)
Callback function.
const std::string name("MULTI_CG_QUDA_WILSON_INVERTER")
Name to be used.
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
multi1d< LatticeFermion > s(Ncb)