CHROMA
MG_predictor.cc
Go to the documentation of this file.
1 #include "chromabase.h"
3 
4 
5 namespace Chroma
6 {
7 
8  namespace MG4DChronoPredictorEnv
9  {
10  namespace
11  {
12  AbsChronologicalPredictor4D<LatticeFermion>* createPredictor(XMLReader& xml,
13  const std::string& path)
14  {
15  //Params read here.
16  std::string subspace_name = "Default";
17  int refresh_rate = 0;
18  try
19  {
20  XMLReader paramtop(xml, path);
21  read( paramtop, "./SubspaceName", subspace_name);
22  read( paramtop, "./RefreshRate", refresh_rate);
23  }
24  catch( const std::string& e ) {
25  QDPIO::cerr << "Caught exception reading XML: " << e << std::endl;
26  QDP_abort(1);
27  }
28  return new MG4DChronoPredictor<LatticeFermion>(subspace_name, refresh_rate);
29  }
30 
31  //! Local registration flag
32  bool registered = false;
33  }
34 
35  const std::string name = "MG_4D_PREDICTOR";
36 
37  //! Register all the factories
38  bool registerAll()
39  {
40  bool success = true;
41  if (! registered)
42  {
43  success &= The4DChronologicalPredictorFactory::Instance().registerObject(name, createPredictor);
44  registered = true;
45  }
46  return success;
47  }
48  }
49 }
Primary include file for CHROMA library code.
static T & Instance()
Definition: singleton.h:432
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
Definition: MG_predictor.cc:38
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
::std::string string
Definition: gtest.h:1979