CHROMA
syssolver_linop_wilson_quda_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Solve a MdagM*psi=chi linear system by CG2
3  */
4 
9 #include "io/aniso_io.h"
10 
11 
12 #include "handle.h"
15 #include "meas/glue/mesplq.h"
16 // QUDA Headers
17 #include <quda.h>
18 // #include <util_quda.h>
19 
20 namespace Chroma
21 {
22  namespace LinOpSysSolverQUDAWilsonEnv
23  {
24 
25  //! Anonymous namespace
26  namespace
27  {
28  //! Name to be used
29  const std::string name("QUDA_WILSON_INVERTER");
30 
31  //! Local registration flag
32  bool registered = false;
33  }
34 
35 
36 
38  const std::string& path,
39  Handle< FermState< LatticeFermion, multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> > > state,
40 
42  {
43  return new LinOpSysSolverQUDAWilson(A, state,SysSolverQUDAWilsonParams(xml_in, path));
44  }
45 
46  //! Register all the factories
47  bool registerAll()
48  {
49  bool success = true;
50  if (! registered)
51  {
53  registered = true;
54  }
55  return success;
56  }
57  }
58 
59  SystemSolverResults_t
60  LinOpSysSolverQUDAWilson::qudaInvert(const T& chi_s,
61  T& psi_s) const{
62 
63  SystemSolverResults_t ret;
64 
65  void *spinorIn;
66 
67  T mod_chi;
68 
69 
70  spinorIn =(void *)&(chi_s.elem(rb[1].start()).elem(0).elem(0).real());
71 
72  void* spinorOut =(void *)&(psi_s.elem(rb[1].start()).elem(0).elem(0).real());
73 
74  // Do the solve here
75  StopWatch swatch1;
76  swatch1.reset();
77  swatch1.start();
78  invertQuda(spinorOut, spinorIn, (QudaInvertParam*)&quda_inv_param);
79  swatch1.stop();
80 
81  //chi_s[rb[1]] *= invMassParam;
82 
83  QDPIO::cout << "QUDA_"<<solver_string<<"_WILSON_SOLVER: time="<< quda_inv_param.secs <<" s" ;
84  QDPIO::cout << "\tPerformance="<< quda_inv_param.gflops/quda_inv_param.secs<<" GFLOPS" ;
85  QDPIO::cout << "\tTotal Time (incl. load gauge)=" << swatch1.getTimeInSeconds() <<" s"<<std::endl;
86 
87  ret.n_count =quda_inv_param.iter;
88 
89  return ret;
90 
91  }
92 
93 
94 }
95 
96 
97 
Anisotropy parameters.
Support class for fermion actions and linear operators.
Definition: state.h:94
Class for counted reference semantics.
Definition: handle.h:33
static T & Instance()
Definition: singleton.h:432
Class for counted reference semantics.
Wilson Dslash linear operator.
static bool registered
Local registration flag.
const std::string name
Name to be used.
bool registerAll()
Register all the factories.
LinOpSystemSolver< LatticeFermion > * createFerm(XMLReader &xml_in, const std::string &path, Handle< FermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, Handle< LinearOperator< LatticeFermion > > A)
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
A(A, psi, r, Ncb, PLUS)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
::std::string string
Definition: gtest.h:1979
Periodic ferm state and a creator.
Register linop system solvers that solve M*psi=chi.
Factory for solving M*psi=chi where M is not hermitian or pos. def.
Solve a MdagM*psi=chi linear system by BiCGStab.
LatticeFermion T
Definition: t_clover.cc:11