From 677b4cc5b0c64741089ad149133789d938cf9f2d Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Thu, 24 Apr 2025 20:33:26 -0400 Subject: [PATCH] Make all tests compile --- Grid/qcd/hmc/checkpointers/BinaryCheckpointer.h | 4 ++-- Grid/qcd/hmc/checkpointers/ILDGCheckpointer.h | 8 ++++---- Grid/qcd/hmc/checkpointers/ScidacCheckpointer.h | 4 ++-- Grid/qcd/smearing/HISQSmearing.h | 10 +++++----- Grid/qcd/utils/WilsonLoops.h | 2 +- systems/mac-arm/config-command-mpi | 3 ++- tests/Test_dwf_dslash_repro.cc | 2 +- tests/debug/Test_general_coarse_hdcg.cc | 4 ++-- tests/debug/Test_heatbath_dwf_eofa_gparity.cc | 3 ++- tests/debug/Test_heatbath_mobius_eofa_gparity.cc | 3 ++- tests/debug/Test_padded_cell.cc | 3 ++- tests/debug/Test_padded_cell_staple.cc | 4 ++-- tests/debug/Test_reweight_dwf_eofa_gparity.cc | 2 ++ tests/debug/Test_reweight_mobius_eofa_gparity.cc | 2 ++ tests/forces/Test_dwf_gpforce.cc | 2 ++ tests/forces/Test_dwf_gpforce_eofa.cc | 2 ++ tests/forces/Test_gpdwf_force.cc | 2 ++ tests/forces/Test_gpdwf_force_1f_2f.cc | 5 +++++ tests/forces/Test_gpwilson_force.cc | 2 ++ tests/forces/Test_mobius_gparity_eofa_mixed.cc | 7 ++++++- tests/forces/Test_mobius_gpforce_eofa.cc | 5 +++-- tests/hmc/Test_action_dwf_gparity2fvs1f.cc | 5 ++++- tests/hmc/Test_hmc_EODWFRatio_Gparity.cc | 3 ++- tests/hmc/Test_hmc_EOMobiusRatio.cc | 8 ++++---- tests/lanczos/Test_compressed_lanczos_gparity.cc | 9 ++++++++- tests/lanczos/Test_dwf_lanczos.cc | 14 ++++++++++++-- tests/lanczos/Test_evec_compression.cc | 6 +++++- tests/solver/Test_dwf_cg_prec.cc | 2 +- tests/solver/Test_dwf_multishift_mixedprec.cc | 4 ++++ 29 files changed, 93 insertions(+), 37 deletions(-) diff --git a/Grid/qcd/hmc/checkpointers/BinaryCheckpointer.h b/Grid/qcd/hmc/checkpointers/BinaryCheckpointer.h index a91ec67f..17a1a181 100644 --- a/Grid/qcd/hmc/checkpointers/BinaryCheckpointer.h +++ b/Grid/qcd/hmc/checkpointers/BinaryCheckpointer.h @@ -111,8 +111,8 @@ public: }; void CheckpointRestore(int traj, Field &U, GridSerialRNG &sRNG, GridParallelRNG &pRNG) { - std::string config, rng; - this->build_filenames(traj, Params, config, rng); + std::string config, rng, smr; + this->build_filenames(traj, Params, config, smr, rng); this->check_filename(rng); this->check_filename(config); diff --git a/Grid/qcd/hmc/checkpointers/ILDGCheckpointer.h b/Grid/qcd/hmc/checkpointers/ILDGCheckpointer.h index 12d391ef..50cca63d 100644 --- a/Grid/qcd/hmc/checkpointers/ILDGCheckpointer.h +++ b/Grid/qcd/hmc/checkpointers/ILDGCheckpointer.h @@ -75,7 +75,7 @@ public: GridParallelRNG &pRNG) { if ((traj % Params.saveInterval) == 0) { std::string config, rng, smr; - this->build_filenames(traj, Params, config, rng); + this->build_filenames(traj, Params, config, smr, rng); GridBase *grid = SmartConfig.get_U(false).Grid(); uint32_t nersc_csum,scidac_csuma,scidac_csumb; BinaryIO::writeRNG(sRNG, pRNG, rng, 0,nersc_csum,scidac_csuma,scidac_csumb); @@ -102,7 +102,7 @@ public: if ( Params.saveSmeared ) { IldgWriter _IldgWriter(grid->IsBoss()); _IldgWriter.open(smr); - _IldgWriter.writeConfiguration(SmartConfig.get_U(true), traj, config, config); + _IldgWriter.writeConfiguration(SmartConfig.get_U(true), traj, smr, smr); _IldgWriter.close(); std::cout << GridLogMessage << "Written ILDG Configuration on " << smr @@ -118,8 +118,8 @@ public: void CheckpointRestore(int traj, GaugeField &U, GridSerialRNG &sRNG, GridParallelRNG &pRNG) { - std::string config, rng; - this->build_filenames(traj, Params, config, rng); + std::string config, rng, smr; + this->build_filenames(traj, Params, config, smr, rng); this->check_filename(rng); this->check_filename(config); diff --git a/Grid/qcd/hmc/checkpointers/ScidacCheckpointer.h b/Grid/qcd/hmc/checkpointers/ScidacCheckpointer.h index 259a44b0..e3825972 100644 --- a/Grid/qcd/hmc/checkpointers/ScidacCheckpointer.h +++ b/Grid/qcd/hmc/checkpointers/ScidacCheckpointer.h @@ -107,8 +107,8 @@ class ScidacHmcCheckpointer : public BaseHmcCheckpointer { void CheckpointRestore(int traj, Field &U, GridSerialRNG &sRNG, GridParallelRNG &pRNG) { - std::string config, rng; - this->build_filenames(traj, Params, config, rng); + std::string config, rng, smr; + this->build_filenames(traj, Params, config, smr, rng); this->check_filename(rng); this->check_filename(config); diff --git a/Grid/qcd/smearing/HISQSmearing.h b/Grid/qcd/smearing/HISQSmearing.h index dfd0a416..e98e9b87 100644 --- a/Grid/qcd/smearing/HISQSmearing.h +++ b/Grid/qcd/smearing/HISQSmearing.h @@ -62,15 +62,15 @@ accelerator_inline int stencilIndex(int mu, int nu) { /*! @brief structure holding the link treatment */ -struct SmearingParameters{ - SmearingParameters(){} +struct HISQSmearingParameters{ + HISQSmearingParameters(){} Real c_1; // 1 link Real c_naik; // Naik term Real c_3; // 3 link Real c_5; // 5 link Real c_7; // 7 link Real c_lp; // 5 link Lepage - SmearingParameters(Real c1, Real cnaik, Real c3, Real c5, Real c7, Real clp) + HISQSmearingParameters(Real c1, Real cnaik, Real c3, Real c5, Real c7, Real clp) : c_1(c1), c_naik(cnaik), c_3(c3), @@ -86,7 +86,7 @@ class Smear_HISQ : public Gimpl { private: GridCartesian* const _grid; - SmearingParameters _linkTreatment; + HISQSmearingParameters _linkTreatment; public: @@ -117,7 +117,7 @@ public: // IN--u_thin void smear(GF& u_smr, GF& u_naik, GF& u_thin) const { - SmearingParameters lt = this->_linkTreatment; + HISQSmearingParameters lt = this->_linkTreatment; auto grid = this->_grid; // Create a padded cell of extra padding depth=1 and fill the padding. diff --git a/Grid/qcd/utils/WilsonLoops.h b/Grid/qcd/utils/WilsonLoops.h index 6e9318c0..7466f4bf 100644 --- a/Grid/qcd/utils/WilsonLoops.h +++ b/Grid/qcd/utils/WilsonLoops.h @@ -294,7 +294,7 @@ public: ////////////////////////////////////////////////// static void Staple(GaugeMat &staple, const GaugeLorentz &U, int mu) { - std::vector Umu(Nd, U.grid()); + std::vector Umu(Nd, U.Grid()); for (int d = 0; d < Nd; d++) { Umu[d] = PeekIndex(U, d); } diff --git a/systems/mac-arm/config-command-mpi b/systems/mac-arm/config-command-mpi index 69130352..34f4229b 100644 --- a/systems/mac-arm/config-command-mpi +++ b/systems/mac-arm/config-command-mpi @@ -3,6 +3,7 @@ CXX=mpicxx ../../configure \ --enable-simd=GEN \ --enable-comms=mpi-auto \ + --enable-Sp=yes \ --enable-unified=yes \ --prefix /Users/peterboyle/QCD/vtk/Grid/install \ --with-lime=$CLIME \ @@ -11,5 +12,5 @@ CXX=mpicxx ../../configure \ --with-openssl=$OPENSSL \ --with-gmp=$GMP \ --with-mpfr=$MPFR \ - --disable-fermion-reps --disable-gparity --disable-debug + --disable-debug diff --git a/tests/Test_dwf_dslash_repro.cc b/tests/Test_dwf_dslash_repro.cc index 1bf813d9..b0eac64b 100644 --- a/tests/Test_dwf_dslash_repro.cc +++ b/tests/Test_dwf_dslash_repro.cc @@ -62,7 +62,7 @@ int VerifyOnDevice(const FermionField &res, FermionField &ref) if (((random()&0xF)==0)&&injection) { uint64_t sF = random()%(NN); int lane=0; - printf("Error injection site %ld on rank %d\n",sF,res.Grid()->ThisRank()); + printf("Error injection site %ld on rank %d\n",(long)sF,res.Grid()->ThisRank()); auto vv = acceleratorGet(res_v[sF]); double *dd = (double *)&vv; *dd=M_PI; diff --git a/tests/debug/Test_general_coarse_hdcg.cc b/tests/debug/Test_general_coarse_hdcg.cc index 24918955..0d6b0a64 100644 --- a/tests/debug/Test_general_coarse_hdcg.cc +++ b/tests/debug/Test_general_coarse_hdcg.cc @@ -195,8 +195,8 @@ int main (int argc, char ** argv) int Nk=nrhs; int Nm=Nk*3; - int Nk=36; - int Nm=144; + // int Nk=36; + // int Nm=144; int Nstop=Nk; int Nconv_test_interval=1; diff --git a/tests/debug/Test_heatbath_dwf_eofa_gparity.cc b/tests/debug/Test_heatbath_dwf_eofa_gparity.cc index 982f35db..c0b54128 100644 --- a/tests/debug/Test_heatbath_dwf_eofa_gparity.cc +++ b/tests/debug/Test_heatbath_dwf_eofa_gparity.cc @@ -54,6 +54,7 @@ const RealD M5 = 1.8; int main(int argc, char** argv) { +#ifdef ENABLE_GPARITY Grid_init(&argc, &argv); int threads = GridThread::GetThreads(); @@ -106,6 +107,6 @@ int main(int argc, char** argv) Meofa.refresh(Umu,sRNG, RNG5); printf(" = %1.15e\n", Meofa.S(Umu)); } - +#endif return 0; } diff --git a/tests/debug/Test_heatbath_mobius_eofa_gparity.cc b/tests/debug/Test_heatbath_mobius_eofa_gparity.cc index fd3d96f8..b6481731 100644 --- a/tests/debug/Test_heatbath_mobius_eofa_gparity.cc +++ b/tests/debug/Test_heatbath_mobius_eofa_gparity.cc @@ -56,6 +56,7 @@ const RealD M5 = 1.8; int main(int argc, char** argv) { +#ifdef ENABLE_GPARITY Grid_init(&argc, &argv); int threads = GridThread::GetThreads(); @@ -106,6 +107,6 @@ int main(int argc, char** argv) Meofa.refresh(Umu, sRNG, RNG5); printf(" = %1.15e\n", Meofa.S(Umu)); } - +#endif return 0; } diff --git a/tests/debug/Test_padded_cell.cc b/tests/debug/Test_padded_cell.cc index f110df46..593b3542 100644 --- a/tests/debug/Test_padded_cell.cc +++ b/tests/debug/Test_padded_cell.cc @@ -33,6 +33,7 @@ using namespace std; using namespace Grid; // This is to optimize the SIMD +/* template void gpermute(vobj & inout,int perm){ vobj tmp=inout; if (perm & 0x1 ) { permute(inout,tmp,0); tmp=inout;} @@ -40,7 +41,7 @@ template void gpermute(vobj & inout,int perm){ if (perm & 0x4 ) { permute(inout,tmp,2); tmp=inout;} if (perm & 0x8 ) { permute(inout,tmp,3); tmp=inout;} } - +*/ int main (int argc, char ** argv) { diff --git a/tests/debug/Test_padded_cell_staple.cc b/tests/debug/Test_padded_cell_staple.cc index 6d7bc8c9..326f8810 100644 --- a/tests/debug/Test_padded_cell_staple.cc +++ b/tests/debug/Test_padded_cell_staple.cc @@ -153,7 +153,7 @@ public: t=usecond(); { autoView( gStaple_v , gStaple, AcceleratorWrite); - auto gStencil_v = gStencil.View(); + auto gStencil_v = gStencil.View(AcceleratorRead); autoView( Ug_mu_v , Ug_mu, AcceleratorRead); autoView( Ug_nu_v , Ug_nu, AcceleratorRead); @@ -389,7 +389,7 @@ public: GeneralLocalStencil gStencil(ggrid,shifts); { autoView( gStaple_v , gStaple, AcceleratorWrite); - auto gStencil_v = gStencil.View(); + auto gStencil_v = gStencil.View(AcceleratorRead); typedef LatticeView GaugeViewType; size_t vsize = Nd*sizeof(GaugeViewType); diff --git a/tests/debug/Test_reweight_dwf_eofa_gparity.cc b/tests/debug/Test_reweight_dwf_eofa_gparity.cc index 70ae94aa..08d80971 100644 --- a/tests/debug/Test_reweight_dwf_eofa_gparity.cc +++ b/tests/debug/Test_reweight_dwf_eofa_gparity.cc @@ -83,6 +83,7 @@ std::vector jack_stats(const std::vector& data) int main(int argc, char **argv) { +#ifdef ENABLE_GPARITY Grid_init(&argc, &argv); // Initialize spacetime grid @@ -206,4 +207,5 @@ int main(int argc, char **argv) std::cout << std::endl << "EOFA: rw = " << eofa_result[0] << " +/- " << eofa_result[1] << std::endl; Grid_finalize(); +#endif } diff --git a/tests/debug/Test_reweight_mobius_eofa_gparity.cc b/tests/debug/Test_reweight_mobius_eofa_gparity.cc index e2a4fb47..cf6787b7 100644 --- a/tests/debug/Test_reweight_mobius_eofa_gparity.cc +++ b/tests/debug/Test_reweight_mobius_eofa_gparity.cc @@ -85,6 +85,7 @@ std::vector jack_stats(const std::vector& data) int main(int argc, char **argv) { +#ifdef ENABLE_GPARITY Grid_init(&argc, &argv); // Initialize spacetime grid @@ -215,4 +216,5 @@ int main(int argc, char **argv) std::cout << std::endl << "EOFA: rw = " << eofa_result[0] << " +/- " << eofa_result[1] << std::endl; Grid_finalize(); +#endif } diff --git a/tests/forces/Test_dwf_gpforce.cc b/tests/forces/Test_dwf_gpforce.cc index 72d30369..db61813e 100644 --- a/tests/forces/Test_dwf_gpforce.cc +++ b/tests/forces/Test_dwf_gpforce.cc @@ -35,6 +35,7 @@ using namespace Grid; int main (int argc, char ** argv) { +#ifdef ENABLE_GPARITY Grid_init(&argc,&argv); Coordinate latt_size = GridDefaultLatt(); @@ -244,4 +245,5 @@ int main (int argc, char ** argv) std::cout<< GridLogMessage << "Done" < +#ifdef ENABLE_GPARITY + using namespace std; using namespace Grid; - ; typedef GparityWilsonImplD FermionImplPolicyD; typedef GparityMobiusEOFAFermionD FermionActionD; @@ -231,3 +232,7 @@ int main (int argc, char** argv) std::cout << GridLogMessage << "Done" << std::endl; Grid_finalize(); } +#else +int main(int argc,char ** argv) { return 0;}; + +#endif diff --git a/tests/forces/Test_mobius_gpforce_eofa.cc b/tests/forces/Test_mobius_gpforce_eofa.cc index dd71b565..c0b7117a 100644 --- a/tests/forces/Test_mobius_gpforce_eofa.cc +++ b/tests/forces/Test_mobius_gpforce_eofa.cc @@ -31,14 +31,14 @@ See the full license in the file "LICENSE" in the top level distribution directo using namespace std; using namespace Grid; - ; + typedef GparityWilsonImplR FermionImplPolicy; typedef GparityMobiusEOFAFermionD FermionAction; typedef typename FermionAction::FermionField FermionField; - int main (int argc, char** argv) { +#ifdef ENABLE_GPARITY Grid_init(&argc, &argv); Coordinate latt_size = GridDefaultLatt(); @@ -171,4 +171,5 @@ int main (int argc, char** argv) std::cout << GridLogMessage << "Done" << std::endl; Grid_finalize(); +#endif } diff --git a/tests/hmc/Test_action_dwf_gparity2fvs1f.cc b/tests/hmc/Test_action_dwf_gparity2fvs1f.cc index 46f87d93..1c9d01fa 100644 --- a/tests/hmc/Test_action_dwf_gparity2fvs1f.cc +++ b/tests/hmc/Test_action_dwf_gparity2fvs1f.cc @@ -30,7 +30,7 @@ using namespace Grid; - +#ifdef ENABLE_GPARITY template void copy2fTo1fFermionField(FermionField1f &out, const FermionField2f &in, int gpdir){ @@ -255,3 +255,6 @@ int main(int argc, char **argv) { } // main +#else +int main(int argc, char **argv){}; +#endif diff --git a/tests/hmc/Test_hmc_EODWFRatio_Gparity.cc b/tests/hmc/Test_hmc_EODWFRatio_Gparity.cc index f98d0edc..9f5a7c9e 100644 --- a/tests/hmc/Test_hmc_EODWFRatio_Gparity.cc +++ b/tests/hmc/Test_hmc_EODWFRatio_Gparity.cc @@ -30,6 +30,7 @@ Author: paboyle int main(int argc, char **argv) { +#ifdef ENABLE_GPARITY using namespace Grid; ; @@ -139,7 +140,7 @@ int main(int argc, char **argv) { Grid_finalize(); - +#endif } // main diff --git a/tests/hmc/Test_hmc_EOMobiusRatio.cc b/tests/hmc/Test_hmc_EOMobiusRatio.cc index 0e0a6611..ca3774cd 100644 --- a/tests/hmc/Test_hmc_EOMobiusRatio.cc +++ b/tests/hmc/Test_hmc_EOMobiusRatio.cc @@ -55,13 +55,13 @@ namespace Grid{ }; - struct SmearingParameters: Serializable { - GRID_SERIALIZABLE_CLASS_MEMBERS(SmearingParameters, + struct HmcSmearingParameters: Serializable { + GRID_SERIALIZABLE_CLASS_MEMBERS(HmcSmearingParameters, double, rho, Integer, Nsmear) template - SmearingParameters(Reader& Reader){ + HmcSmearingParameters(Reader& Reader){ read(Reader, "StoutSmearing", *this); } @@ -213,7 +213,7 @@ int main(int argc, char **argv) { // Reset performance counters if (ApplySmearing){ - SmearingParameters SmPar(Reader); + HmcSmearingParameters SmPar(Reader); //double rho = 0.1; // smearing parameter //int Nsmear = 3; // number of smearing levels Smear_Stout Stout(SmPar.rho); diff --git a/tests/lanczos/Test_compressed_lanczos_gparity.cc b/tests/lanczos/Test_compressed_lanczos_gparity.cc index ca353d61..d5e09c0b 100644 --- a/tests/lanczos/Test_compressed_lanczos_gparity.cc +++ b/tests/lanczos/Test_compressed_lanczos_gparity.cc @@ -35,6 +35,8 @@ Author: Peter Boyle #include #include +#ifdef ENABLE_GPARITY + using namespace std; using namespace Grid; @@ -378,7 +380,8 @@ void runTest(const Options &opt){ //Note: because we rely upon physical properties we must use a "real" gauge configuration -int main (int argc, char ** argv) { +int main (int argc, char ** argv) +{ Grid_init(&argc,&argv); GridLogIRL.TimingMode(1); @@ -482,4 +485,8 @@ int main (int argc, char ** argv) { Grid_finalize(); } +#else +int main(int argc, char **argv){}; + +#endif diff --git a/tests/lanczos/Test_dwf_lanczos.cc b/tests/lanczos/Test_dwf_lanczos.cc index d10c62d3..d77b8f48 100644 --- a/tests/lanczos/Test_dwf_lanczos.cc +++ b/tests/lanczos/Test_dwf_lanczos.cc @@ -29,11 +29,11 @@ Author: Peter Boyle using namespace std; using namespace Grid; - ; template struct Setup{}; +#ifdef ENABLE_GPARITY template<> struct Setup{ static GparityMobiusFermionF* getAction(LatticeGaugeFieldF &Umu, @@ -47,16 +47,24 @@ struct Setup{ return new GparityMobiusFermionF(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,mob_b,mob_b-1.,params); } }; +#endif template<> struct Setup{ static DomainWallFermionF* getAction(LatticeGaugeFieldF &Umu, + GridCartesian* FGrid, GridRedBlackCartesian* FrbGrid, GridCartesian* UGrid, GridRedBlackCartesian* UrbGrid){ + RealD mass=0.00054; + RealD M5=1.8; + return new DomainWallFermionF(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5); + } +}; +template<> struct Setup{ static DomainWallFermionD* getAction(LatticeGaugeField &Umu, GridCartesian* FGrid, GridRedBlackCartesian* FrbGrid, GridCartesian* UGrid, GridRedBlackCartesian* UrbGrid){ RealD mass=0.00054; RealD M5=1.8; - return new DomainWallFermionF(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5); + return new DomainWallFermionD(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5); } }; @@ -168,7 +176,9 @@ int main (int argc, char ** argv) } if(action == "GparityMobius"){ +#ifdef ENABLE_GPARITY run(); +#endif }else if(action == "DWF"){ run(); }else if(action == "Mobius"){ diff --git a/tests/lanczos/Test_evec_compression.cc b/tests/lanczos/Test_evec_compression.cc index 1636ea3a..5ba1597c 100644 --- a/tests/lanczos/Test_evec_compression.cc +++ b/tests/lanczos/Test_evec_compression.cc @@ -555,6 +555,7 @@ int main (int argc, char ** argv) { double c = (args.mobius_scale - bmc)/2.; // c = 1/2 [ (b+c) - (b-c) ] if(is_gparity){ +#ifdef ENABLE_GPARITY GparityWilsonImplD::ImplParams Params = setupGparityParams(args.GparityDirs); readConfiguration(Umu, config, args.is_cps_cfg); //Read the gauge field @@ -564,7 +565,10 @@ int main (int argc, char ** argv) { }else if(action_s == "Mobius"){ GparityMobiusFermionD action(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, args.mass, args.M5, b, c, Params); run(action, config, args); - } + } +#else + assert(0); +#endif }else{ WilsonImplD::ImplParams Params = setupParams(); readConfiguration(Umu, config, args.is_cps_cfg); //Read the gauge field diff --git a/tests/solver/Test_dwf_cg_prec.cc b/tests/solver/Test_dwf_cg_prec.cc index af3f4cf0..efbd7fc6 100644 --- a/tests/solver/Test_dwf_cg_prec.cc +++ b/tests/solver/Test_dwf_cg_prec.cc @@ -1,4 +1,4 @@ -************************************************************************************* +/************************************************************************************* Grid physics library, www.github.com/paboyle/Grid diff --git a/tests/solver/Test_dwf_multishift_mixedprec.cc b/tests/solver/Test_dwf_multishift_mixedprec.cc index bdede459..63ffe1c6 100644 --- a/tests/solver/Test_dwf_multishift_mixedprec.cc +++ b/tests/solver/Test_dwf_multishift_mixedprec.cc @@ -165,6 +165,7 @@ int main (int argc, char ** argv) } } if(gparity){ +#ifdef ENABLE_GPARITY std::cout << "Running test with G-parity BCs in " << gpdir << " direction" << std::endl; GparityWilsonImplParams params; params.twists[gpdir] = 1; @@ -174,6 +175,9 @@ int main (int argc, char ** argv) ConjugateGimplD::setDirections(conj_dirs); run_test(argc,argv,params); +#else + std::cout << " Gparity is not compiled "<