CHROMA
syssolver_mdagm_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 MdagMSysSolverQUDAWilsonEnv
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 MdagMSysSolverQUDAWilson(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 
60  MdagMSysSolverQUDAWilson::qudaInvert(const T& chi_s,
61  T& psi_s) const{
62 
64 
65  void *spinorIn;
66 
67  spinorIn =(void *)&(chi_s.elem(rb[1].start()).elem(0).elem(0).real());
68  void* spinorOut =(void *)&(psi_s.elem(rb[1].start()).elem(0).elem(0).real());
69 
70  // Do the solve here
71  StopWatch swatch1;
72  swatch1.reset();
73  swatch1.start();
74  invertQuda(spinorOut, spinorIn, (QudaInvertParam*)&quda_inv_param);
75  swatch1.stop();
76 
77 
78  QDPIO::cout << "QUDA_"<<solver_string<<"_WILSON_SOLVER: time="<< quda_inv_param.secs <<" s" ;
79  QDPIO::cout << "\tPerformance="<< quda_inv_param.gflops/quda_inv_param.secs<<" GFLOPS" ;
80  QDPIO::cout << "\tTotal Time (incl. load gauge)=" << swatch1.getTimeInSeconds() <<" s"<<std::endl;
81 
82  ret.n_count =quda_inv_param.iter;
83 
84  return ret;
85 
86  }
87 
88 
89 }
90 
91 
92 
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.
MdagMSystemSolver< LatticeFermion > * createFerm(XMLReader &xml_in, const std::string &path, Handle< FermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, Handle< LinearOperator< LatticeFermion > > A)
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LinOpSysSolverMGProtoClover::T T
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.
Holds return info from SystemSolver call.
Definition: syssolver.h:17
Register MdagM system solvers.
Factory for producing system solvers for MdagM*psi = chi.
Solve a MdagM*psi=chi linear system by BiCGStab.