1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

WilsonMG: Make running MG correctness checks optional via commandline

This commit is contained in:
Daniel Richtmann 2018-06-11 16:27:52 +02:00
parent 73a955be20
commit f32714a2d1
No known key found for this signature in database
GPG Key ID: B33C490AF0772057
2 changed files with 12 additions and 6 deletions

View File

@ -76,8 +76,7 @@ int main(int argc, char **argv) {
LevelInfo levelInfo(FGrid, mgParams);
// Note: We do chiral doubling, so actually only nbasis/2 full basis vectors are used
const int nbasis = 40;
RealD toleranceForMGChecks = 1e-13; // TODO: depends on the precision MG precondtioner is run in
const int nbasis = 40;
WilsonFermionR Dw(Umu, *FGrid, *FrbGrid, mass);
@ -93,7 +92,11 @@ int main(int argc, char **argv) {
auto MGPreconDw = createMGInstance<vSpinColourVector, vTComplex, nbasis, WilsonFermionR>(mgParams, levelInfo, Dw, Dw);
MGPreconDw->setup();
MGPreconDw->runChecks(toleranceForMGChecks);
if(GridCmdOptionExists(argv, argv + argc, "--runchecks")) {
RealD toleranceForMGChecks = (getPrecision<LatticeFermion>::value == 1) ? 1e-6 : 1e-13;
MGPreconDw->runChecks(toleranceForMGChecks);
}
std::vector<std::unique_ptr<OperatorFunction<LatticeFermion>>> solversDw;

View File

@ -78,8 +78,7 @@ int main(int argc, char **argv) {
LevelInfo levelInfo(FGrid, mgParams);
// Note: We do chiral doubling, so actually only nbasis/2 full basis vectors are used
const int nbasis = 40;
RealD toleranceForMGChecks = 1e-13; // TODO: depends on the precision MG precondtioner is run in
const int nbasis = 40;
WilsonCloverFermionR Dwc(Umu, *FGrid, *FrbGrid, mass, csw_r, csw_t);
@ -95,7 +94,11 @@ int main(int argc, char **argv) {
auto MGPreconDwc = createMGInstance<vSpinColourVector, vTComplex, nbasis, WilsonCloverFermionR>(mgParams, levelInfo, Dwc, Dwc);
MGPreconDwc->setup();
MGPreconDwc->runChecks(toleranceForMGChecks);
if(GridCmdOptionExists(argv, argv + argc, "--runchecks")) {
RealD toleranceForMGChecks = (getPrecision<LatticeFermion>::value == 1) ? 1e-6 : 1e-13;
MGPreconDwc->runChecks(toleranceForMGChecks);
}
std::vector<std::unique_ptr<OperatorFunction<LatticeFermion>>> solversDwc;