1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00:00

FTHMC Status at lattice conference commit

This commit is contained in:
Peter Boyle 2023-10-13 17:57:56 +03:00
parent 9626a2c7c0
commit e19171523b
3 changed files with 35 additions and 31 deletions

View File

@ -54,15 +54,16 @@ int main(int argc, char **argv)
// MD.name = std::string("Force Gradient"); // MD.name = std::string("Force Gradient");
typedef GenericHMCRunner<MinimumNorm2> HMCWrapper; typedef GenericHMCRunner<MinimumNorm2> HMCWrapper;
MD.name = std::string("MinimumNorm2"); MD.name = std::string("MinimumNorm2");
MD.MDsteps = 12; MD.MDsteps = 24;
MD.trajL = 1.0; MD.trajL = 1.0;
HMCparameters HMCparams; HMCparameters HMCparams;
HMCparams.StartTrajectory = 0; HMCparams.StartTrajectory = 104;
HMCparams.Trajectories = 200; HMCparams.Trajectories = 200;
HMCparams.NoMetropolisUntil= 20; HMCparams.NoMetropolisUntil= 20;
// "[HotStart, ColdStart, TepidStart, CheckpointStart]\n"; // "[HotStart, ColdStart, TepidStart, CheckpointStart]\n";
HMCparams.StartingType =std::string("HotStart"); // HMCparams.StartingType =std::string("HotStart");
HMCparams.StartingType =std::string("CheckpointStart");
HMCparams.MD = MD; HMCparams.MD = MD;
HMCWrapper TheHMC(HMCparams); HMCWrapper TheHMC(HMCparams);
@ -87,6 +88,7 @@ int main(int argc, char **argv)
// here there is too much indirection // here there is too much indirection
typedef PlaquetteMod<HMCWrapper::ImplPolicy> PlaqObs; typedef PlaquetteMod<HMCWrapper::ImplPolicy> PlaqObs;
TheHMC.Resources.AddObservable<PlaqObs>(); TheHMC.Resources.AddObservable<PlaqObs>();
////////////////////////////////////////////// //////////////////////////////////////////////
const int Ls = 16; const int Ls = 16;
@ -134,7 +136,6 @@ int main(int argc, char **argv)
//////////////////////////////////// ////////////////////////////////////
ActionLevel<HMCWrapper::Field> Level1(1); ActionLevel<HMCWrapper::Field> Level1(1);
ActionLevel<HMCWrapper::Field> Level2(2); ActionLevel<HMCWrapper::Field> Level2(2);
ActionLevel<HMCWrapper::Field> Level3(4);
//////////////////////////////////// ////////////////////////////////////
// Strange action // Strange action
@ -191,7 +192,7 @@ int main(int argc, char **argv)
Smear_Stout<HMCWrapper::ImplPolicy> Stout(rho); Smear_Stout<HMCWrapper::ImplPolicy> Stout(rho);
SmearedConfigurationMasked<HMCWrapper::ImplPolicy> SmearingPolicy(GridPtr, Nstep, Stout); SmearedConfigurationMasked<HMCWrapper::ImplPolicy> SmearingPolicy(GridPtr, Nstep, Stout);
JacobianAction<HMCWrapper::ImplPolicy> Jacobian(&SmearingPolicy); JacobianAction<HMCWrapper::ImplPolicy> Jacobian(&SmearingPolicy);
if( ApplySmearing ) Level2.push_back(&Jacobian); if( ApplySmearing ) Level1.push_back(&Jacobian);
std::cout << GridLogMessage << " Built the Jacobian "<< std::endl; std::cout << GridLogMessage << " Built the Jacobian "<< std::endl;
@ -200,7 +201,7 @@ int main(int argc, char **argv)
///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////
// GaugeAction.is_smeared = ApplySmearing; // GaugeAction.is_smeared = ApplySmearing;
GaugeAction.is_smeared = true; GaugeAction.is_smeared = true;
Level3.push_back(&GaugeAction); Level2.push_back(&GaugeAction);
std::cout << GridLogMessage << " ************************************************"<< std::endl; std::cout << GridLogMessage << " ************************************************"<< std::endl;
std::cout << GridLogMessage << " Action complete -- NO FERMIONS FOR NOW -- FIXME"<< std::endl; std::cout << GridLogMessage << " Action complete -- NO FERMIONS FOR NOW -- FIXME"<< std::endl;
@ -210,10 +211,11 @@ int main(int argc, char **argv)
std::cout << GridLogMessage << " Running the FT HMC "<< std::endl; std::cout << GridLogMessage << " Running the FT HMC "<< std::endl;
TheHMC.TheAction.push_back(Level1); TheHMC.TheAction.push_back(Level1);
TheHMC.TheAction.push_back(Level2); TheHMC.TheAction.push_back(Level2);
TheHMC.TheAction.push_back(Level3);
TheHMC.ReadCommandLine(argc,argv); // params on CML or from param file
TheHMC.initializeGaugeFieldAndRNGs(U);
TheHMC.Run(SmearingPolicy); // for smearing TheHMC.Run(SmearingPolicy); // for smearing

View File

@ -343,7 +343,7 @@ int main(int argc, char **argv) {
// Probably dominates the force - back to EOFA. // Probably dominates the force - back to EOFA.
OneFlavourRationalParams SFRp; OneFlavourRationalParams SFRp;
SFRp.lo = 0.1; SFRp.lo = 0.1;
SFRp.hi = 25.0; SFRp.hi = 30.0;
SFRp.MaxIter = 10000; SFRp.MaxIter = 10000;
SFRp.tolerance= 1.0e-5; SFRp.tolerance= 1.0e-5;
SFRp.mdtolerance= 2.0e-4; SFRp.mdtolerance= 2.0e-4;

View File

@ -128,7 +128,7 @@ template<class FermionOperatorD, class FermionOperatorF, class SchurOperatorD, c
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
// Make a mixed precision conjugate gradient // Make a mixed precision conjugate gradient
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
#if 1 #if 0
RealD delta=1.e-4; RealD delta=1.e-4;
std::cout << GridLogMessage << "Calling reliable update Conjugate Gradient" <<std::endl; std::cout << GridLogMessage << "Calling reliable update Conjugate Gradient" <<std::endl;
ConjugateGradientReliableUpdate<FieldD,FieldF> MPCG(Tolerance,MaxInnerIterations*MaxOuterIterations,delta,SinglePrecGrid5,LinOpF,LinOpD); ConjugateGradientReliableUpdate<FieldD,FieldF> MPCG(Tolerance,MaxInnerIterations*MaxOuterIterations,delta,SinglePrecGrid5,LinOpF,LinOpD);
@ -180,7 +180,7 @@ int main(int argc, char **argv) {
// 4/2 => 0.6 dH // 4/2 => 0.6 dH
// 3/3 => 0.8 dH .. depth 3, slower // 3/3 => 0.8 dH .. depth 3, slower
//MD.MDsteps = 4; //MD.MDsteps = 4;
MD.MDsteps = 14; MD.MDsteps = 12;
MD.trajL = 0.5; MD.trajL = 0.5;
HMCparameters HMCparams; HMCparameters HMCparams;
@ -204,7 +204,7 @@ int main(int argc, char **argv) {
TheHMC.Resources.LoadNerscCheckpointer(CPparams); TheHMC.Resources.LoadNerscCheckpointer(CPparams);
std::cout << "loaded NERSC checpointer"<<std::endl; std::cout << "loaded NERSC checpointer"<<std::endl;
RNGModuleParameters RNGpar; RNGModuleParameters RNGpar;
RNGpar.serial_seeds = "1 2 3 4 5"; RNGpar.serial_seeds = "1 2 3 4 5 6 7 8 9 10";
RNGpar.parallel_seeds = "6 7 8 9 10"; RNGpar.parallel_seeds = "6 7 8 9 10";
TheHMC.Resources.SetRNGSeeds(RNGpar); TheHMC.Resources.SetRNGSeeds(RNGpar);
@ -218,15 +218,14 @@ int main(int argc, char **argv) {
RealD M5 = 1.8; RealD M5 = 1.8;
RealD b = 1.5; RealD b = 1.5;
RealD c = 0.5; RealD c = 0.5;
Real beta = 2.13; RealD beta = 2.13;
// Real light_mass = 5.4e-4; // Real light_mass = 5.4e-4;
Real light_mass = 7.8e-4; Real light_mass = 7.8e-4;
// Real light_mass = 7.8e-3;
Real strange_mass = 0.0362; Real strange_mass = 0.0362;
Real pv_mass = 1.0; Real pv_mass = 1.0;
// std::vector<Real> hasenbusch({ 0.01, 0.045, 0.108, 0.25, 0.51 , pv_mass }); std::vector<Real> hasenbusch({ 0.005, 0.0145, 0.045, 0.108, 0.25, 0.35 , 0.51, 0.6, 0.8 }); // Updated
// std::vector<Real> hasenbusch({ light_mass, 0.01, 0.045, 0.108, 0.25, 0.51 , pv_mass }); //std::vector<Real> hasenbusch({ 0.0145, 0.045, 0.108, 0.25, 0.35 , 0.51, 0.6, 0.8 }); // Updated
std::vector<Real> hasenbusch({ 0.005, 0.0145, 0.045, 0.108, 0.25, 0.51 }); // Updated
// std::vector<Real> hasenbusch({ light_mass, 0.0145, 0.045, 0.108, 0.25, 0.51 , 0.75 , pv_mass });
auto GridPtr = TheHMC.Resources.GetCartesian(); auto GridPtr = TheHMC.Resources.GetCartesian();
auto GridRBPtr = TheHMC.Resources.GetRBCartesian(); auto GridRBPtr = TheHMC.Resources.GetRBCartesian();
@ -277,20 +276,20 @@ int main(int argc, char **argv) {
// double StoppingCondition = 1e-14; // double StoppingCondition = 1e-14;
// double MDStoppingCondition = 1e-9; // double MDStoppingCondition = 1e-9;
double StoppingCondition = 1e-9; double StoppingCondition = 1e-14;
double MDStoppingCondition = 1e-8; double MDStoppingCondition = 1e-9;
double MDStoppingConditionLoose = 1e-8; double MDStoppingConditionLoose = 1e-9;
double MDStoppingConditionStrange = 1e-8; double MDStoppingConditionStrange = 1e-9;
double MaxCGIterations = 300000; double MaxCGIterations = 50000;
ConjugateGradient<FermionField> CG(StoppingCondition,MaxCGIterations); ConjugateGradient<FermionField> CG(StoppingCondition,MaxCGIterations);
ConjugateGradient<FermionField> MDCG(MDStoppingCondition,MaxCGIterations); ConjugateGradient<FermionField> MDCG(MDStoppingCondition,MaxCGIterations);
//////////////////////////////////// ////////////////////////////////////
// Collect actions // Collect actions
//////////////////////////////////// ////////////////////////////////////
// ActionLevel<HMCWrapper::Field> Level1(1); ActionLevel<HMCWrapper::Field> Level1(1);
ActionLevel<HMCWrapper::Field> Level2(1); ActionLevel<HMCWrapper::Field> Level2(2);
ActionLevel<HMCWrapper::Field> Level3(15); ActionLevel<HMCWrapper::Field> Level3(4);
//////////////////////////////////// ////////////////////////////////////
// Strange action // Strange action
@ -300,11 +299,11 @@ int main(int argc, char **argv) {
// Probably dominates the force - back to EOFA. // Probably dominates the force - back to EOFA.
OneFlavourRationalParams SFRp; OneFlavourRationalParams SFRp;
SFRp.lo = 0.1; SFRp.lo = 0.8;
SFRp.hi = 30.0; SFRp.hi = 30.0;
SFRp.MaxIter = 10000; SFRp.MaxIter = 10000;
SFRp.tolerance= 1.0e-8; SFRp.tolerance= 1.0e-12;
SFRp.mdtolerance= 2.0e-6; SFRp.mdtolerance= 1.0e-9;
SFRp.degree = 10; SFRp.degree = 10;
SFRp.precision= 50; SFRp.precision= 50;
@ -355,8 +354,10 @@ int main(int argc, char **argv) {
ExactOneFlavourRatioPseudoFermionAction<FermionImplPolicy> ExactOneFlavourRatioPseudoFermionAction<FermionImplPolicy>
EOFA(Strange_Op_L, Strange_Op_R, EOFA(Strange_Op_L, Strange_Op_R,
ActionCG, ActionCG,
ActionCGL, ActionCGR, // ActionCGL, ActionCGR,
DerivativeCGL, DerivativeCGR, // DerivativeCGL, DerivativeCGR,
ActionCG, ActionCG,
DerivativeCG, DerivativeCG,
SFRp, true); SFRp, true);
Level2.push_back(&EOFA); Level2.push_back(&EOFA);
@ -443,13 +444,14 @@ int main(int argc, char **argv) {
} }
int nquo=Quotients.size(); int nquo=Quotients.size();
for(int h=0;h<nquo;h++){ for(int h=0;h<nquo;h++){
Level2.push_back(Quotients[h]); Level1.push_back(Quotients[h]);
} }
///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////
// Gauge action // Gauge action
///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////
Level3.push_back(&GaugeAction); Level3.push_back(&GaugeAction);
TheHMC.TheAction.push_back(Level1);
TheHMC.TheAction.push_back(Level2); TheHMC.TheAction.push_back(Level2);
TheHMC.TheAction.push_back(Level3); TheHMC.TheAction.push_back(Level3);
std::cout << GridLogMessage << " Action complete "<< std::endl; std::cout << GridLogMessage << " Action complete "<< std::endl;