17 namespace MdagMMultiSysSolverCGQudaCloverEnv
22 Handle<
FermState< LatticeFermion, multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> > >
state,
48 MdagMMultiSysSolverCGQudaClover::qudaInvertMulti(
const T& chi_s,
50 const multi1d<Real> shifts)
const{
52 SystemSolverResults_t ret;
56 #ifndef BUILD_QUDA_DEVIFACE_SPINOR
57 spinorIn =(
void *)&(chi_s.elem(rb[1].start()).elem(0).elem(0).real());
62 void** spinorOut =
new void*[ shifts.size() ];
63 if (spinorOut ==
nullptr ) {
64 QDPIO::cerr <<
"Couldn't allocate spinorOut" << std::endl;
68 if ( shifts.size() > QUDA_MAX_MULTI_SHIFT ) {
69 QDPIO::cerr <<
"You want more shifts than QUDA_MAX_MULTI_SHIFT" << std::endl;
70 QDPIO::cerr <<
"Requested : " << shifts.size() <<
" QUDA_MAX_MULTI_SHIFT=" << QUDA_MAX_MULTI_SHIFT << std::endl;
74 psi_s.resize( shifts.size());
76 #ifndef BUILD_QUDA_DEVIFACE_SPINOR
77 for(
int s=0;
s < shifts.size();
s++) {
80 spinorOut[
s] = (
void *)&(psi_s[
s].elem(rb[1].start()).elem(0).elem(0).real());
81 quda_inv_param.offset[
s] = toDouble(shifts[
s]);
84 std::vector<QDPCache::ArgKey> ids = {chi_s.getId()};
85 for(
int s=0;
s < shifts.size();
s++) {
88 ids.push_back( psi_s[
s].
getId() );
89 quda_inv_param.offset[
s] = toDouble(shifts[
s]);
91 auto dev_ptr = GetMemoryPtr( ids );
92 spinorIn = dev_ptr[0];
93 for(
int s=0;
s < shifts.size();
s++) {
94 spinorOut[
s] = dev_ptr[
s+1];
98 quda_inv_param.num_offset = shifts.size();
100 if( invParam.RsdTarget.size() == 1 ) {
101 for (
int i=0;
i< quda_inv_param.num_offset;
i++) quda_inv_param.tol_offset[
i] = toDouble(invParam.RsdTarget[0]);
104 for (
int i=0;
i< quda_inv_param.num_offset;
i++) quda_inv_param.tol_offset[
i] = toDouble(invParam.RsdTarget[
i]);
111 QDPIO::cout <<
"CALLING QUDA SOLVER" << std::endl << std::flush ;
112 invertMultiShiftQuda(spinorOut, spinorIn, (QudaInvertParam*)&quda_inv_param);
119 QDPIO::cout <<
"QUDA_"<<solver_string<<
"_CLOVER_SOLVER: time="<< quda_inv_param.secs <<
" s" ;
120 QDPIO::cout <<
"\tPerformance="<< quda_inv_param.gflops/quda_inv_param.secs<<
" GFLOPS" ;
121 QDPIO::cout <<
"\tTotal Time (incl. load gauge)=" << swatch1.getTimeInSeconds() <<
" s"<<std::endl;
123 ret.n_count =quda_inv_param.iter;
Support class for fermion actions and linear operators.
Class for counted reference semantics.
std::string getId()
Get the default gauge field named object id.
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.
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
const std::string name("MULTI_CG_QUDA_CLOVER_INVERTER")
Name to be used.
Asqtad Staggered-Dirac operator.
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
multi1d< LatticeFermion > s(Ncb)