CHROMA
syssolver_quda_wilson_params.cc
Go to the documentation of this file.
2 #include "chromabase.h"
3 #include "io/xml_group_reader.h"
4 #include "chroma_config.h"
5 
6 
7 
8 using namespace QDP;
9 
10 namespace Chroma {
11 
12  SysSolverQUDAWilsonParams::SysSolverQUDAWilsonParams(XMLReader& xml,
13  const std::string& path)
14  {
15  XMLReader paramtop(xml, path);
16 
17  read(paramtop, "MaxIter", MaxIter);
18  read(paramtop, "RsdTarget", RsdTarget);
19  read(paramtop, "WilsonParams", WilsonParams);
20  read(paramtop, "AntiPeriodicT", AntiPeriodicT);
21 
22  read(paramtop, "Delta", Delta);
23 
24 
25  read(paramtop, "SolverType", solverType);
26 
27  if ( paramtop.count("Verbose") > 0 ) {
28  read(paramtop, "Verbose", verboseP);
29  }
30  else {
31  verboseP = false;
32  }
33  if ( paramtop.count("AsymmetricLinop") > 0 ) {
34  read(paramtop, "AsymmetricLinop", asymmetricP);
35  }
36  else {
37  asymmetricP = false; // Symmetric is default
38  }
39 
40  if( paramtop.count("CudaPrecision") > 0 ) {
41  read(paramtop, "CudaPrecision", cudaPrecision);
42  }
43  else {
44  cudaPrecision = DEFAULT;
45  }
46 
47  if( paramtop.count("CudaSloppyPrecision") > 0 ) {
48  read(paramtop, "CudaSloppyPrecision", cudaSloppyPrecision);
49  }
50  else {
51  cudaSloppyPrecision = DEFAULT;
52  }
53 
54  if( paramtop.count("CudaReconstruct") > 0 ) {
55  read(paramtop, "CudaReconstruct", cudaReconstruct);
56  }
57  else {
58  cudaReconstruct = RECONS_12;
59  }
60 
61  if( paramtop.count("CudaSloppyReconstruct") > 0 ) {
62  read(paramtop, "CudaSloppyReconstruct", cudaSloppyReconstruct);
63  }
64  else {
65  cudaSloppyReconstruct = RECONS_12;
66  }
67 
68  if( paramtop.count("AxialGaugeFix") > 0 ) {
69  read(paramtop, "AxialGaugeFix", axialGaugeP);
70  }
71  else {
72  axialGaugeP = false;
73  }
74 
75  if( paramtop.count("SilentFail") > 0) {
76  read(paramtop, "SilentFail", SilentFailP);
77  }
78  else {
79  SilentFailP = false;
80  }
81 
82  if( paramtop.count("RsdToleranceFactor") > 0 ) {
83  read(paramtop, "RsdToleranceFactor", RsdToleranceFactor);
84  }
85  else {
86  RsdToleranceFactor = Real(10); // Tolerate an order of magnitude difference by default.
87  }
88 
89  if( paramtop.count("AutotuneDslash") > 0 ) {
90  read(paramtop, "AutotuneDslash", tuneDslashP);
91  }
92  else {
93  tuneDslashP = false;
94  }
95  QDPIO::cout << "tuneDslasP = " << tuneDslashP << std::endl;
96 
97 
98  if( paramtop.count("Pipeline") > 0 ) {
99  read(paramtop, "Pipeline", Pipeline);
100  }
101  else {
102  Pipeline = 1;
103  }
104 
105  if( paramtop.count("GCRInnerParams") > 0 ) {
106  innerParams = new GCRInnerSolverParams(paramtop, "./GCRInnerParams");
107  innerParamsP = true;
108  }
109  else {
110  innerParamsP = false;
111  }
112 
113  }
114 
115  void read(XMLReader& xml, const std::string& path,
117  {
118  SysSolverQUDAWilsonParams tmp(xml, path);
119  p = tmp;
120  }
121 
122  void write(XMLWriter& xml, const std::string& path,
123  const SysSolverQUDAWilsonParams& p) {
124  push(xml, path);
125  write(xml, "MaxIter", p.MaxIter);
126  write(xml, "RsdTarget", p.RsdTarget);
127  write(xml, "WilsonParams", p.WilsonParams);
128  write(xml, "AntiPeriodicT", p.AntiPeriodicT);
129  write(xml, "Delta", p.Delta);
130  write(xml, "SolverType", p.solverType);
131  write(xml, "Verbose", p.verboseP);
132  write(xml, "AsymmetricLinop", p.asymmetricP);
133  write(xml, "CudaPrecision", p.cudaPrecision);
134  write(xml, "CudaReconstruct", p.cudaReconstruct);
135  write(xml, "CudaSloppyPrecision", p.cudaSloppyPrecision);
136  write(xml, "CudaSloppyReconstruct", p.cudaSloppyReconstruct);
137  write(xml, "AxialGaugeFix", p.axialGaugeP);
138  write(xml, "SilentFail", p.SilentFailP);
139  write(xml, "RsdToleranceFactor", p.RsdToleranceFactor);
140  write(xml, "AutotuneDslash", p.tuneDslashP);
141  write(xml, "Pipeline", p.Pipeline);
142  if( p.innerParamsP ) {
143  write(xml, "GCRInnerParams", *(p.innerParams));
144  }
145 
146  pop(xml);
147 
148  }
149 
150 
151 
152 }
Primary include file for CHROMA library code.
Double tmp
Definition: meslate.cc:60
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
void read(XMLReader &xml, const std::string &path, SysSolverQUDAWilsonParams &p)
void write(XMLWriter &xml, const std::string &path, const SysSolverQUDAWilsonParams &p)
@ RECONS_12
Definition: enum_quda_io.h:80
::std::string string
Definition: gtest.h:1979
push(xml_out,"Cooled_Topology")
pop(xml_out)
Read an XML group as a std::string.