diff --git a/RbcUkqcd.hpp b/RbcUkqcd.hpp index b80886d..1ed3c50 100644 --- a/RbcUkqcd.hpp +++ b/RbcUkqcd.hpp @@ -48,6 +48,10 @@ struct RbcUkqcd const std::string gaugeTransform, const std::string eigenpackPath, const double residual = 1.0e-8); + static inline void addM0StrangeSolver(Application &app, const std::string solverName, + const std::string gaugeName, + const std::string gaugeTransform, + const double residual = 1.0e-8); }; // Implementations ///////////////////////////////////////////////////////////////////////////////// @@ -113,4 +117,43 @@ void RbcUkqcd::addM0LightLCDSolver(Application &app, const std::string solverNam app.createModule(solverName, solverPar); } +void RbcUkqcd::addM0StrangeSolver(Application &app, const std::string solverName, + const std::string gaugeName, const std::string gaugeTransform, + const double residual) +{ + const std::string prefix = solverName; + + // Gauge field FP32 cast + MUtilities::GaugeSinglePrecisionCast::Par gaugeCastPar; + + gaugeCastPar.field = gaugeName; + app.createModule(prefix + "_gauge_fp32", gaugeCastPar); + + // Scaled DWF action + FP32 version + MAction::ScaledDWF::Par actionPar; + + actionPar.gauge = gaugeName; + actionPar.Ls = RbcUkqcd::m0LCDPar.Ls; + actionPar.M5 = RbcUkqcd::m0LCDPar.M5; + actionPar.mass = RbcUkqcd::m0LCDPar.ms; + actionPar.scale = RbcUkqcd::m0LCDPar.scale; + actionPar.boundary = "1 1 1 1"; + actionPar.twist = "0. 0. 0. 0."; + app.createModule(prefix + "_dwf", actionPar); + actionPar.gauge = prefix + "_gauge_fp32"; + app.createModule(prefix + "_dwf_fp32", actionPar); + + // Batched mixed-precision red-black preconditionned CG + MSolver::MixedPrecisionRBPrecCG::Par solverPar; + + solverPar.innerAction = prefix + "_dwf_fp32"; + solverPar.outerAction = prefix + "_dwf"; + solverPar.maxInnerIteration = 30000; + solverPar.maxOuterIteration = 100; + solverPar.residual = residual; + solverPar.innerGuesser = ""; + solverPar.outerGuesser = ""; + app.createModule(solverName, solverPar); +} + } // namespace hadpresets