From d4e0b11bb135ea0bb2abf92c2a22816a3c1b38c3 Mon Sep 17 00:00:00 2001 From: Guido Cossu Date: Wed, 23 Nov 2016 11:46:51 +0000 Subject: [PATCH] Adding few comments --- lib/algorithms/iterative/ConjugateGradient.h | 8 +++++--- tests/hmc/Test_hmc_WilsonFermionGauge.cc | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/algorithms/iterative/ConjugateGradient.h b/lib/algorithms/iterative/ConjugateGradient.h index 5ba5cd5d..0c90c5b4 100644 --- a/lib/algorithms/iterative/ConjugateGradient.h +++ b/lib/algorithms/iterative/ConjugateGradient.h @@ -60,9 +60,11 @@ class ConjugateGradient : public OperatorFunction { // Defaults true. RealD Tolerance; Integer MaxIterations; + + // Reproducibility controls bool ReproTest; - CG_state CGState;//to check reproducibility by repeating the CG - ReproducibilityState ReprTest; + CG_state CGState; //to check reproducibility by repeating the CG + ReproducibilityState ReprTest; // for the inner proucts ConjugateGradient(RealD tol, Integer maxit, bool err_on_no_conv = true, bool ReproducibilityTest = false) @@ -95,7 +97,7 @@ class ConjugateGradient : public OperatorFunction { Linop.HermOpAndNorm(psi, mmp, d, b); if(!ReprTest.do_check) - ReprTest.reset(); + ReprTest.reset(); ReprTest.enable_reprocheck=ReproTest; diff --git a/tests/hmc/Test_hmc_WilsonFermionGauge.cc b/tests/hmc/Test_hmc_WilsonFermionGauge.cc index 351d1e68..84240426 100644 --- a/tests/hmc/Test_hmc_WilsonFermionGauge.cc +++ b/tests/hmc/Test_hmc_WilsonFermionGauge.cc @@ -63,6 +63,9 @@ class HmcRunner : public NerscHmcRunner { Real mass = -0.77; FermionAction FermOp(U, *FGrid, *FrbGrid, mass); + // To enable the CG reproducibility tests use + // ConjugateGradient CG(1.0e-8, 10000, true, true); + // This is the plain version ConjugateGradient CG(1.0e-8, 10000); TwoFlavourPseudoFermionAction Nf2(FermOp, CG, CG);