CHROMA
quda_multigrid_params.h
Go to the documentation of this file.
1 #ifndef __QUDA_MULTIGRID_PARAMS_H__
2 #define __QUDA_MULTIGRID_PARAMS_H__
3 
4 #include "chromabase.h"
5 #include <string>
7 
8 
9 namespace Chroma
10 {
11 
13 
14  // tol, max iterations, and smootherType are per level.
15  multi1d<Real> tol;
16  multi1d<int> maxIterations;
17  multi1d<QudaSolverType> smootherType;
18  multi1d<QudaSolverType> coarseSolverType;
19  multi1d<Real> smootherTol;
20  multi1d<Real> relaxationOmegaMG;
21  multi1d<QudaSchwarzMethod> smootherSchwarzType;
22  multi1d<int> smootherSchwarzCycle;
23  multi1d<QudaPrecisionType> smootherHaloPrecision;
24 
25  bool verbosity;
29  multi1d<int> nvec;
30  int mg_levels;
34  multi1d<bool> setup_on_gpu;
35  multi1d<int> nu_pre;
36  multi1d<int> nu_post;
37  multi1d< multi1d<int> > blocking;
42  multi1d<QudaSolverType> subspaceSolver;
43  multi1d<int> maxIterSubspaceCreate;
44  multi1d<Real> rsdTargetSubspaceCreate;
45  multi1d<int> maxIterSubspaceRefresh;
46 
47  MULTIGRIDSolverParams(XMLReader& xml, const std::string& path);
49 
50  relaxationOmegaMG =Real(1.0);
51  relaxationOmegaOuter = Real(1.0);
52  maxIterations = 10;
53  smootherType = MR;
55  verbosity = false;
56  prec = DEFAULT;
59 
60  mg_levels = 2;
61  setup_on_gpu.resize(mg_levels-1);
62  // Default is to set up on gpu
63  for(int i=0; i < mg_levels - 1; ++i) {
64  setup_on_gpu[i] = true;
65  }
66  blocking.resize(mg_levels-1);
67  nvec.resize(mg_levels-1);
68  nu_pre.resize(mg_levels-1);
69  nu_post.resize(mg_levels-1);
73  tol.resize(mg_levels);
74  maxIterations.resize(mg_levels);
76 
77  smootherType.resize(mg_levels);
78  smootherTol.resize(mg_levels);
82  generate_nullspace = true;
83  for(int l = 0; l < mg_levels - 1; l++)
84  {
85  blocking[l].resize(4);
86  blocking[l][0] = blocking[l][1] = blocking[l][2] = blocking[l][3] = 4;
87  nu_pre[l] = 2;
88  nu_post[l] = 2;
89  nvec[l] = 16;
90 
91  // Default params:
92  maxIterSubspaceCreate[l] = 500;
93  rsdTargetSubspaceCreate[l] = 5.0e-6;
95 
96  tol[l] = 1.0e-5;
98  maxIterations[l] = 12;
99  }
100  for(int l=0; l < mg_levels; ++l) {
101  smootherType[l] = MR;
102  smootherTol[l] = Real(0.25);
103  relaxationOmegaMG[l] = 0.85;
105  smootherSchwarzCycle[l] = 1;
106  }
107  outer_gcr_nkrylov = 12;
108  precond_gcr_nkrylov = 12;
109 
110  generate_all_levels = true;
111  check_multigrid_setup= true;
112  cycle_type = "MG_VCYCLE";
113 
114  };
115 
116  };
117  void read(XMLReader& xml, const std::string& path, MULTIGRIDSolverParams& p);
118 
119  void write(XMLWriter& xml, const std::string& path,
120  const MULTIGRIDSolverParams& param);
121 
122 }
123 #endif
Primary include file for CHROMA library code.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
QudaSchwarzMethod
Definition: enum_quda_io.h:101
QudaReconsType
Quda Gauge Reconstruct type.
Definition: enum_quda_io.h:77
QudaPrecisionType
Quda Precision type.
Definition: enum_quda_io.h:50
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
int i
Definition: pbg5p_w.cc:55
@ ADDITIVE_SCHWARZ
Definition: enum_quda_io.h:103
@ INVALID_SCHWARZ
Definition: enum_quda_io.h:102
@ RECONS_NONE
Definition: enum_quda_io.h:78
::std::string string
Definition: gtest.h:1979
int l
Definition: pade_trln_w.cc:111
multi1d< QudaSchwarzMethod > smootherSchwarzType
multi1d< QudaSolverType > subspaceSolver
multi1d< QudaPrecisionType > smootherHaloPrecision
multi1d< QudaSolverType > coarseSolverType
multi1d< QudaSolverType > smootherType
multi1d< multi1d< int > > blocking