From 7e27a5213a6606bdc5dfcc9ff9369cfffca4888c Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Tue, 4 Jun 2019 20:45:20 +0100 Subject: [PATCH] Tests builds clean. --- tests/Test_cayley_even_odd_vec.cc | 185 ------------------ tests/core/Test_dwf_rb5d.cc | 135 ------------- tests/core/Test_qed.cc | 10 +- tests/forces/Test_gp_plaq_force.cc | 7 +- tests/forces/Test_wilsonclover_force.cc | 2 +- tests/hmc/Test_hmc_EODWFRatioLsVectorised.cc | 153 --------------- tests/solver/Test_dwf_cg_prec_LsVec.cc | 110 ----------- tests/solver/Test_multigrid_common.h | 16 +- tests/solver/Test_staggered_cagmres_unprec.cc | 8 +- tests/solver/Test_staggered_fcagmres_prec.cc | 8 +- tests/solver/Test_staggered_fgmres_prec.cc | 8 +- tests/solver/Test_staggered_gmres_unprec.cc | 8 +- tests/solver/Test_staggered_mr_unprec.cc | 8 +- tests/solver/Test_wilson_cagmres_unprec.cc | 8 +- tests/solver/Test_wilson_fcagmres_prec.cc | 8 +- tests/solver/Test_wilson_fgmres_prec.cc | 8 +- tests/solver/Test_wilson_gmres_unprec.cc | 8 +- tests/solver/Test_wilson_mg.cc | 3 +- tests/solver/Test_wilson_mg_mp.cc | 8 +- tests/solver/Test_wilson_mr_unprec.cc | 8 +- .../Test_wilsonclover_cagmres_unprec.cc | 8 +- .../solver/Test_wilsonclover_fcagmres_prec.cc | 8 +- tests/solver/Test_wilsonclover_fgmres_prec.cc | 8 +- .../solver/Test_wilsonclover_gmres_unprec.cc | 8 +- tests/solver/Test_wilsonclover_mr_unprec.cc | 8 +- 25 files changed, 84 insertions(+), 665 deletions(-) delete mode 100644 tests/core/Test_dwf_rb5d.cc delete mode 100644 tests/hmc/Test_hmc_EODWFRatioLsVectorised.cc delete mode 100644 tests/solver/Test_dwf_cg_prec_LsVec.cc diff --git a/tests/Test_cayley_even_odd_vec.cc b/tests/Test_cayley_even_odd_vec.cc index 186ed973..0e71d910 100644 --- a/tests/Test_cayley_even_odd_vec.cc +++ b/tests/Test_cayley_even_odd_vec.cc @@ -43,15 +43,6 @@ struct scal { Gamma::Algebra::GammaT }; -typedef DomainWallFermion DomainWallVecFermionR; -typedef ZMobiusFermion ZMobiusVecFermionR; -typedef MobiusFermion MobiusVecFermionR; -typedef MobiusZolotarevFermion MobiusZolotarevVecFermionR; -typedef ScaledShamirFermion ScaledShamirVecFermionR; -typedef ShamirZolotarevFermion ShamirZolotarevVecFermionR; -typedef OverlapWilsonCayleyTanhFermion OverlapWilsonCayleyTanhVecFermionR; -typedef OverlapWilsonCayleyZolotarevFermion OverlapWilsonCayleyZolotarevVecFermionR; - template void TestWhat(What & Ddwf, GridCartesian * FGrid, GridRedBlackCartesian * FrbGrid, @@ -59,9 +50,6 @@ void TestWhat(What & Ddwf, RealD mass, RealD M5, GridParallelRNG *RNG4, GridParallelRNG *RNG5); -template -void TestMoo(This & Dw, That &sDw); - int main (int argc, char ** argv) { Grid_init(&argc,&argv); @@ -101,11 +89,7 @@ int main (int argc, char ** argv) std::cout<(Ddwf,FGrid,FrbGrid,UGrid,mass,M5,&RNG4,&RNG5); - TestWhat(sDdwf,sFGrid,sFrbGrid,sUGrid,mass,M5,&sRNG4,&sRNG5); RealD b=1.5;// Scale factor b+c=2, b-c=1 RealD c=0.5; @@ -114,75 +98,53 @@ int main (int argc, char ** argv) std::cout<(Dmob,FGrid,FrbGrid,UGrid,mass,M5,&RNG4,&RNG5); - TestWhat(sDmob,sFGrid,sFrbGrid,sUGrid,mass,M5,&sRNG4,&sRNG5); - std::cout< gamma(Ls,std::complex(1.0,0.0)); ZMobiusFermionR zDmob(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,gamma,b,c); - ZMobiusVecFermionR szDmob(Umu,*sFGrid,*sFrbGrid,*sUGrid,*sUrbGrid,mass,M5,gamma,b,c); - TestMoo(zDmob,szDmob); TestWhat(zDmob,FGrid,FrbGrid,UGrid,mass,M5,&RNG4,&RNG5); - TestWhat(szDmob,sFGrid,sFrbGrid,sUGrid,mass,M5,&sRNG4,&sRNG5); std::cout<(Dzolo,FGrid,FrbGrid,UGrid,mass,M5,&RNG4,&RNG5); - TestWhat(sDzolo,sFGrid,sFrbGrid,sUGrid,mass,M5,&sRNG4,&sRNG5); std::cout<(Dsham,FGrid,FrbGrid,UGrid,mass,M5,&RNG4,&RNG5); - TestWhat(sDsham,sFGrid,sFrbGrid,sUGrid,mass,M5,&sRNG4,&sRNG5); std::cout<(Dshamz,FGrid,FrbGrid,UGrid,mass,M5,&RNG4,&RNG5); - TestWhat(sDshamz,sFGrid,sFrbGrid,sUGrid,mass,M5,&sRNG4,&sRNG5); std::cout<(Dov,FGrid,FrbGrid,UGrid,mass,M5,&RNG4,&RNG5); - TestWhat(sDov,sFGrid,sFrbGrid,sUGrid,mass,M5,&sRNG4,&sRNG5); std::cout<(Dovz,FGrid,FrbGrid,UGrid,mass,M5,&RNG4,&RNG5); - TestWhat(sDovz,sFGrid,sFrbGrid,sUGrid,mass,M5,&sRNG4,&sRNG5); std::cout< -void TestMoo(This & Dw, That &sDw) -{ - GridBase *sgrid= sDw.FermionGrid(); - GridBase *ngrid= Dw.FermionGrid(); - - int Ls = Dw.Ls; - - LatticeFermion ssrc(sgrid); - LatticeFermion nsrc(ngrid); - LatticeFermion zz(ngrid); zz=Zero(); - LatticeFermion sres(sgrid); - LatticeFermion nres(ngrid); - LatticeFermion ndiff(ngrid); - LatticeFermion sdiff(sgrid); - - Gamma g5( Gamma::Algebra::Gamma5 ); - - std::vector seeds({1,2,3,4,5,7,8}); - GridParallelRNG RNG5(ngrid); - RNG5.SeedFixedIntegers(seeds); - random(RNG5,nsrc); - // nsrc = nsrc + g5*nsrc; - - // Lattice > coor(ngrid); - // LatticeCoordinate(coor,0);//scoor - // nsrc = where(coor==(Integer)0,zz,nsrc); - - std::vector latt4(4); - for(int d=0;d<4;d++){ - latt4[d] = ngrid->_fdimensions[d+1]; - } - - for(int x=0;x site({s,x,y,z,t}); - SpinColourVector tmp; - peekSite(tmp,nsrc,site); - pokeSite(tmp,ssrc,site); - }}}}} - - sDw.Mooee(ssrc,sres); - Dw.Mooee(nsrc,nres); - - sDw.MooeeInternal(ssrc,sdiff,DaggerNo,InverseNo); - - - for(int x=0;x site({s,x,y,z,t}); - SpinColourVector stmp; - SpinColourVector itmp; - SpinColourVector dtmp; - peekSite(stmp,sres,site); - peekSite(itmp,sdiff,site); - - dtmp=itmp-stmp; - if ( norm2(dtmp)>1.0e-6) { - std::cout< site({s,x,y,z,t}); - - SpinColourVector tmp; - peekSite(tmp,sres,site); - pokeSite(tmp,ndiff,site); - }}}}} - ndiff=ndiff-nres; - std::cout< site({s,x,y,z,t}); - - SpinColourVector tmp; - peekSite(tmp,sres,site); - pokeSite(tmp,ndiff,site); - }}}}} - ndiff=ndiff-nres; - std::cout< site({s,x,y,z,t}); - - SpinColourVector tmp; - peekSite(tmp,sres,site); - pokeSite(tmp,ndiff,site); - }}}}} - ndiff=ndiff-nres; - std::cout< site({s,x,y,z,t}); - SpinColourVector tmp; - peekSite(tmp,sres,site); - pokeSite(tmp,ndiff,site); - }}}}} - ndiff=ndiff-nres; - std::cout< -Author: paboyle - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - See the full license in the file "LICENSE" in the top level distribution directory - *************************************************************************************/ - /* END LEGAL */ -#include - -using namespace std; -using namespace Grid; - ; - -template -struct scal { - d internal; -}; - - Gamma::Algebra Gmu [] = { - Gamma::Algebra::GammaX, - Gamma::Algebra::GammaY, - Gamma::Algebra::GammaZ, - Gamma::Algebra::GammaT - }; - -typedef WilsonFermion5D WilsonFermion5DR; -typedef WilsonFermion5D WilsonFermion5DF; -typedef WilsonFermion5D WilsonFermion5DD; - -typedef WilsonFermion5D WilsonFermion5D_OKR; - -int main (int argc, char ** argv) -{ - Grid_init(&argc,&argv); - - int threads = GridThread::GetThreads(); - std::cout< seeds4({1,2,3,4}); - std::vector seeds5({5,6,7,8}); - - GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4); - GridParallelRNG RNG5(FGrid); RNG5.SeedFixedIntegers(seeds5); - - LatticeFermion src (FGrid); random(RNG5,src); - LatticeFermion result(FGrid); result=Zero(); - LatticeFermion ref(FGrid); ref=Zero(); - LatticeFermion tmp(FGrid); - LatticeFermion err(FGrid); - - LatticeGaugeField Umu(UGrid); SU3::HotConfiguration(RNG4,Umu); - std::vector U(4,UGrid); - - // Only one non-zero (y) - /* - Umu=Zero(); - for(int nn=0;nn(Umu,U[nn],nn); - } - */ - - RealD M5 =1.8; - typename WilsonFermion5DR::ImplParams params; - - WilsonFermion5DR Dw(Umu,*FGrid,*FrbGrid,*sUGrid,*sUrbGrid,M5,params); - - Dw.Dhop(src,result,0); - - std::cout << "Norm src = "< latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(4, vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(4, vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian grid(latt_size,simd_layout,mpi_layout); GridParallelRNG pRNG(&grid); PhotonR photon(&grid, PhotonR::Gauge::coulomb, PhotonR::ZmScheme::qedL); @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) std::cout << GridLogMessage << "Spatial zero-mode norm 2" << std::endl; sliceSum(a, zm, grid.Nd() - 1); - for (unsigned int t = 0; t < latt_size.back(); ++t) + for (unsigned int t = 0; t < latt_size.size(); ++t) { std::cout << GridLogMessage << "t = " << t << " " << std::sqrt(norm2(zm[t])) << std::endl; } @@ -85,7 +85,7 @@ int main(int argc, char *argv[]) // Calculate divergence EmComp diva(&grid), amu(&grid); - diva = zero; + diva = Zero(); for (unsigned int mu = 0; mu < grid.Nd(); ++mu) { amu = peekLorentz(a, mu); diff --git a/tests/forces/Test_gp_plaq_force.cc b/tests/forces/Test_gp_plaq_force.cc index e8702399..12600293 100644 --- a/tests/forces/Test_gp_plaq_force.cc +++ b/tests/forces/Test_gp_plaq_force.cc @@ -54,10 +54,11 @@ int main (int argc, char ** argv) SU3::HotConfiguration(pRNG,U); double beta = 1.0; - double c1 = 0.331; - - //ConjugatePlaqPlusRectangleActionR Action(beta,c1); ConjugateWilsonGaugeActionR Action(beta); + + // double c1 = 0.331; + //ConjugatePlaqPlusRectangleActionR Action(beta,c1); + //WilsonGaugeActionR Action(beta); ComplexD S = Action.S(U); diff --git a/tests/forces/Test_wilsonclover_force.cc b/tests/forces/Test_wilsonclover_force.cc index 46c39988..dd0e21fd 100644 --- a/tests/forces/Test_wilsonclover_force.cc +++ b/tests/forces/Test_wilsonclover_force.cc @@ -93,7 +93,7 @@ int main(int argc, char **argv) RealD dt = 0.00005; RealD Hmom = 0.0; RealD Hmomprime = 0.0; - RealD Hmompp = 0.0; + // RealD Hmompp = 0.0; LatticeColourMatrix mommu(&Grid); LatticeColourMatrix forcemu(&Grid); LatticeGaugeField mom(&Grid); diff --git a/tests/hmc/Test_hmc_EODWFRatioLsVectorised.cc b/tests/hmc/Test_hmc_EODWFRatioLsVectorised.cc deleted file mode 100644 index 340d800a..00000000 --- a/tests/hmc/Test_hmc_EODWFRatioLsVectorised.cc +++ /dev/null @@ -1,153 +0,0 @@ -/************************************************************************************* - -Grid physics library, www.github.com/paboyle/Grid - -Source file: ./tests/Test_hmc_WilsonFermionGauge.cc - -Copyright (C) 2015 - -Author: Peter Boyle -Author: neo -Author: Guido Cossu - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -See the full license in the file "LICENSE" in the top level distribution -directory -*************************************************************************************/ -/* END LEGAL */ -#include - - - -int main(int argc, char **argv) { - using namespace Grid; - ; - - Grid_init(&argc, &argv); - int threads = GridThread::GetThreads(); - // here make a routine to print all the relevant information on the run - std::cout << GridLogMessage << "Grid is setup to use " << threads << " threads" << std::endl; - - // Typedefs to simplify notation - typedef GenericHMCRunner HMCWrapper; // Uses the default minimum norm - - typedef DomainWallVec5dImplR FermionImplPolicy; - typedef DomainWallFermion FermionAction; - typedef typename FermionAction::FermionField FermionField; - - - //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - HMCWrapper TheHMC; - - // Grid from the command line - TheHMC.Resources.AddFourDimGrid("gauge"); - // Possibile to create the module by hand - // hardcoding parameters or using a Reader - - - // Checkpointer definition - CheckpointerParameters CPparams; - CPparams.config_prefix = "ckpoint_EODWF_lat"; - CPparams.rng_prefix = "ckpoint_EODWF_rng"; - CPparams.saveInterval = 5; - CPparams.format = "IEEE64BIG"; - - TheHMC.Resources.LoadNerscCheckpointer(CPparams); - - RNGModuleParameters RNGpar; - RNGpar.serial_seeds = "1 2 3 4 5"; - RNGpar.parallel_seeds = "6 7 8 9 10"; - TheHMC.Resources.SetRNGSeeds(RNGpar); - - // Construct observables - // here there is too much indirection - typedef PlaquetteMod PlaqObs; - TheHMC.Resources.AddObservable(); - ////////////////////////////////////////////// - - ///////////////////////////////////////////////////////////// - // Collect actions, here use more encapsulation - // need wrappers of the fermionic classes - // that have a complex construction - // standard - RealD beta = 5.6 ; - WilsonGaugeActionR Waction(beta); - - - const int Ls = 8; - auto GridPtr = TheHMC.Resources.GetCartesian(); - auto GridRBPtr = TheHMC.Resources.GetRBCartesian(); - auto FGrid = SpaceTimeGrid::makeFiveDimGrid(Ls,GridPtr); - auto FrbGrid = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls,GridPtr); - auto sUGrid = SpaceTimeGrid::makeFourDimDWFGrid(GridDefaultLatt(),GridDefaultMpi()); - auto sUrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(sUGrid); - - // temporarily need a gauge field - LatticeGaugeField U(GridPtr); - - Real mass = 0.04; - Real pv = 1.0; - RealD M5 = 1.5; - - FermionAction DenOp(U,*FGrid,*FrbGrid,*sUGrid,*sUrbGrid,mass,M5); - FermionAction NumOp(U,*FGrid,*FrbGrid,*sUGrid,*sUrbGrid,pv,M5); - - - double StoppingCondition = 1.0e-8; - double MaxCGIterations = 10000; - ConjugateGradient CG(StoppingCondition,MaxCGIterations); - TwoFlavourEvenOddRatioPseudoFermionAction Nf2(NumOp, DenOp,CG,CG); - - // Set smearing (true/false), default: false - Nf2.is_smeared = false; - - // Collect actions - ActionLevel Level1(1); - Level1.push_back(&Nf2); - - ActionLevel Level2(4); - Level2.push_back(&Waction); - - TheHMC.TheAction.push_back(Level1); - TheHMC.TheAction.push_back(Level2); - ///////////////////////////////////////////////////////////// - // HMC parameters are serialisable - TheHMC.Parameters.MD.MDsteps = 20; - TheHMC.Parameters.MD.trajL = 1.0; - - TheHMC.ReadCommandLine(argc, argv); // these can be parameters from file - - // Reset performance counters - NumOp.ZeroCounters(); - DenOp.ZeroCounters(); - TheHMC.Run(); // no smearing - - std::cout << GridLogMessage << "Numerator report, Pauli-Villars term : " << std::endl; - NumOp.Report(); - std::cout << GridLogMessage << "Denominator report, Dw(m) term (includes CG) : " << std::endl; - DenOp.Report(); - - - - - Grid_finalize(); - - - - -} // main - - diff --git a/tests/solver/Test_dwf_cg_prec_LsVec.cc b/tests/solver/Test_dwf_cg_prec_LsVec.cc deleted file mode 100644 index ed0ad0c0..00000000 --- a/tests/solver/Test_dwf_cg_prec_LsVec.cc +++ /dev/null @@ -1,110 +0,0 @@ -/************************************************************************************* - -Grid physics library, www.github.com/paboyle/Grid - -Source file: ./tests/Test_dwf_cg_prec.cc - -Copyright (C) 2016 - -Author: Guido Cossu - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -See the full license in the file "LICENSE" in the top level distribution -directory -*************************************************************************************/ -/* END LEGAL */ -#include - -using namespace std; -using namespace Grid; - ; - -template -struct scal { - d internal; -}; - -int main(int argc, char** argv) { - Grid_init(&argc, &argv); - - const int Ls = 16; - - GridCartesian* UGrid = SpaceTimeGrid::makeFourDimGrid( - GridDefaultLatt(), GridDefaultSimd(Nd, vComplex::Nsimd()), - GridDefaultMpi()); - GridRedBlackCartesian* UrbGrid = - SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid); - - GridCartesian* sUGrid = SpaceTimeGrid::makeFourDimDWFGrid(GridDefaultLatt(), GridDefaultMpi()); - GridRedBlackCartesian* sUrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(sUGrid); - - GridCartesian* FGrid = SpaceTimeGrid::makeFiveDimDWFGrid(Ls, UGrid); - GridRedBlackCartesian* FrbGrid = SpaceTimeGrid::makeFiveDimDWFRedBlackGrid(Ls, UGrid); - - std::cout << GridLogMessage << "Lattice dimensions: " << GridDefaultLatt() - << " Ls: " << Ls << std::endl; - - std::vector seeds4({1, 2, 3, 4}); - std::vector seeds5({5, 6, 7, 8}); - GridParallelRNG RNG5(FGrid); - RNG5.SeedFixedIntegers(seeds5); - GridParallelRNG RNG4(UGrid); - RNG4.SeedFixedIntegers(seeds4); - - std::cout << GridLogMessage << "Generating random fermion field" << std::endl; - LatticeFermion src(FGrid); - random(RNG5, src); - LatticeFermion result(FGrid); - result = Zero(); - LatticeGaugeField Umu(UGrid); - - std::cout << GridLogMessage << "Generating random gauge field" << std::endl; - SU3::HotConfiguration(RNG4, Umu); - - - - std::vector U(4, UGrid); - for (int mu = 0; mu < Nd; mu++) { - U[mu] = PeekIndex(Umu, mu); - } - - RealD mass = 0.01; - RealD M5 = 1.8; - DomainWallFermionVec5dR Ddwf(Umu, *FGrid, *FrbGrid, *sUGrid, *sUrbGrid, mass, M5); - - LatticeFermion src_o(FrbGrid); - LatticeFermion result_o(FrbGrid); - pickCheckerboard(Odd, src_o, src); - result_o = Zero(); - - GridStopWatch CGTimer; - - SchurDiagMooeeOperator HermOpEO(Ddwf); - ConjugateGradient CG(1.0e-8, 10000, 0); // switch off the assert - - Ddwf.ZeroCounters(); - CGTimer.Start(); - CG(HermOpEO, src_o, result_o); - CGTimer.Stop(); - - std::cout << GridLogMessage << "Total CG time : " << CGTimer.Elapsed() - << std::endl; - - std::cout << GridLogMessage << "######## Dhop calls summary" << std::endl; - Ddwf.Report(); - - Grid_finalize(); -} diff --git a/tests/solver/Test_multigrid_common.h b/tests/solver/Test_multigrid_common.h index add833f2..22743b72 100644 --- a/tests/solver/Test_multigrid_common.h +++ b/tests/solver/Test_multigrid_common.h @@ -30,6 +30,8 @@ namespace Grid { +Zero zero; + // TODO: Can think about having one parameter struct per level and then a // vector of these structs. How well would that work together with the // serialization strategy of Grid? @@ -124,7 +126,7 @@ public: Seeds[level][d] = (level)*Nd + d + 1; } - Grids.push_back(QCD::SpaceTimeGrid::makeFourDimGrid(tmp, Grids[level - 1]->_simd_layout, GridDefaultMpi())); + Grids.push_back(SpaceTimeGrid::makeFourDimGrid(tmp, Grids[level - 1]->_simd_layout, GridDefaultMpi())); PRNGs.push_back(GridParallelRNG(Grids[level])); PRNGs[level].SeedFixedIntegers(Seeds[level]); @@ -227,8 +229,8 @@ public: _SetupCreateSubspaceTimer.Stop(); _SetupProjectToChiralitiesTimer.Start(); - FineVector tmp1(_Aggregates.subspace[0]._grid); - FineVector tmp2(_Aggregates.subspace[0]._grid); + FineVector tmp1(_Aggregates.subspace[0].Grid()); + FineVector tmp2(_Aggregates.subspace[0].Grid()); for(int n = 0; n < nb; n++) { auto tmp1 = _Aggregates.subspace[n]; G5C(tmp2, _Aggregates.subspace[n]); @@ -253,7 +255,7 @@ public: virtual void operator()(FineVector const &in, FineVector &out) { - conformable(_LevelInfo.Grids[_CurrentLevel], in._grid); + conformable(_LevelInfo.Grids[_CurrentLevel], in.Grid()); conformable(in, out); // TODO: implement a W-cycle @@ -273,7 +275,7 @@ public: CoarseVector coarseSol(_LevelInfo.Grids[_NextCoarserLevel]); coarseSol = zero; - FineVector fineTmp(in._grid); + FineVector fineTmp(in.Grid()); auto maxSmootherIter = _MultiGridParams.smootherMaxOuterIter[_CurrentLevel] * _MultiGridParams.smootherMaxInnerIter[_CurrentLevel]; @@ -330,7 +332,7 @@ public: CoarseVector coarseSol(_LevelInfo.Grids[_NextCoarserLevel]); coarseSol = zero; - FineVector fineTmp(in._grid); + FineVector fineTmp(in.Grid()); auto smootherMaxIter = _MultiGridParams.smootherMaxOuterIter[_CurrentLevel] * _MultiGridParams.smootherMaxInnerIter[_CurrentLevel]; auto kCycleMaxIter = _MultiGridParams.kCycleMaxOuterIter[_CurrentLevel] * _MultiGridParams.kCycleMaxInnerIter[_CurrentLevel]; @@ -605,7 +607,7 @@ public: _SolveTotalTimer.Start(); - conformable(_LevelInfo.Grids[_CurrentLevel], in._grid); + conformable(_LevelInfo.Grids[_CurrentLevel], in.Grid()); conformable(in, out); auto coarseSolverMaxIter = _MultiGridParams.coarseSolverMaxOuterIter * _MultiGridParams.coarseSolverMaxInnerIter; diff --git a/tests/solver/Test_staggered_cagmres_unprec.cc b/tests/solver/Test_staggered_cagmres_unprec.cc index b82ecaeb..1462b071 100644 --- a/tests/solver/Test_staggered_cagmres_unprec.cc +++ b/tests/solver/Test_staggered_cagmres_unprec.cc @@ -39,9 +39,9 @@ int main (int argc, char ** argv) Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -50,7 +50,7 @@ int main (int argc, char ** argv) FermionField src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - FermionField result(&Grid); result=zero; + FermionField result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_staggered_fcagmres_prec.cc b/tests/solver/Test_staggered_fcagmres_prec.cc index 7685585b..58434304 100644 --- a/tests/solver/Test_staggered_fcagmres_prec.cc +++ b/tests/solver/Test_staggered_fcagmres_prec.cc @@ -39,9 +39,9 @@ int main (int argc, char ** argv) Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -50,7 +50,7 @@ int main (int argc, char ** argv) FermionField src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - FermionField result(&Grid); result=zero; + FermionField result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_staggered_fgmres_prec.cc b/tests/solver/Test_staggered_fgmres_prec.cc index 30905e35..e5127d55 100644 --- a/tests/solver/Test_staggered_fgmres_prec.cc +++ b/tests/solver/Test_staggered_fgmres_prec.cc @@ -39,9 +39,9 @@ int main (int argc, char ** argv) Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -50,7 +50,7 @@ int main (int argc, char ** argv) FermionField src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - FermionField result(&Grid); result=zero; + FermionField result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_staggered_gmres_unprec.cc b/tests/solver/Test_staggered_gmres_unprec.cc index d65b0b31..0502a43f 100644 --- a/tests/solver/Test_staggered_gmres_unprec.cc +++ b/tests/solver/Test_staggered_gmres_unprec.cc @@ -39,9 +39,9 @@ int main (int argc, char ** argv) Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -50,7 +50,7 @@ int main (int argc, char ** argv) FermionField src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - FermionField result(&Grid); result=zero; + FermionField result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_staggered_mr_unprec.cc b/tests/solver/Test_staggered_mr_unprec.cc index ca60edb4..c64dda84 100644 --- a/tests/solver/Test_staggered_mr_unprec.cc +++ b/tests/solver/Test_staggered_mr_unprec.cc @@ -39,9 +39,9 @@ int main (int argc, char ** argv) Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -50,7 +50,7 @@ int main (int argc, char ** argv) FermionField src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - FermionField result(&Grid); result=zero; + FermionField result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_wilson_cagmres_unprec.cc b/tests/solver/Test_wilson_cagmres_unprec.cc index 46f9e6a6..4fee6171 100644 --- a/tests/solver/Test_wilson_cagmres_unprec.cc +++ b/tests/solver/Test_wilson_cagmres_unprec.cc @@ -35,9 +35,9 @@ int main (int argc, char ** argv) { Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -46,7 +46,7 @@ int main (int argc, char ** argv) LatticeFermion src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - LatticeFermion result(&Grid); result=zero; + LatticeFermion result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_wilson_fcagmres_prec.cc b/tests/solver/Test_wilson_fcagmres_prec.cc index f802984f..e7b70b81 100644 --- a/tests/solver/Test_wilson_fcagmres_prec.cc +++ b/tests/solver/Test_wilson_fcagmres_prec.cc @@ -35,9 +35,9 @@ int main (int argc, char ** argv) { Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -46,7 +46,7 @@ int main (int argc, char ** argv) LatticeFermion src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - LatticeFermion result(&Grid); result=zero; + LatticeFermion result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_wilson_fgmres_prec.cc b/tests/solver/Test_wilson_fgmres_prec.cc index f55516da..7ec485b4 100644 --- a/tests/solver/Test_wilson_fgmres_prec.cc +++ b/tests/solver/Test_wilson_fgmres_prec.cc @@ -35,9 +35,9 @@ int main (int argc, char ** argv) { Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -46,7 +46,7 @@ int main (int argc, char ** argv) LatticeFermion src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - LatticeFermion result(&Grid); result=zero; + LatticeFermion result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_wilson_gmres_unprec.cc b/tests/solver/Test_wilson_gmres_unprec.cc index 443f7ebc..045d724b 100644 --- a/tests/solver/Test_wilson_gmres_unprec.cc +++ b/tests/solver/Test_wilson_gmres_unprec.cc @@ -35,9 +35,9 @@ int main (int argc, char ** argv) { Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -46,7 +46,7 @@ int main (int argc, char ** argv) LatticeFermion src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - LatticeFermion result(&Grid); result=zero; + LatticeFermion result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_wilson_mg.cc b/tests/solver/Test_wilson_mg.cc index 1609c1fc..c022590c 100644 --- a/tests/solver/Test_wilson_mg.cc +++ b/tests/solver/Test_wilson_mg.cc @@ -31,7 +31,6 @@ using namespace std; using namespace Grid; -using namespace Grid::QCD; int main(int argc, char **argv) { @@ -46,7 +45,7 @@ int main(int argc, char **argv) { // clang-format off LatticeFermion src(FGrid); gaussian(fPRNG, src); - LatticeFermion result(FGrid); result = zero; + LatticeFermion result(FGrid); result = Zero(); LatticeGaugeField Umu(FGrid); SU3::HotConfiguration(fPRNG, Umu); // clang-format on diff --git a/tests/solver/Test_wilson_mg_mp.cc b/tests/solver/Test_wilson_mg_mp.cc index 0cd51227..4e2407c0 100644 --- a/tests/solver/Test_wilson_mg_mp.cc +++ b/tests/solver/Test_wilson_mg_mp.cc @@ -50,8 +50,8 @@ int main(int argc, char **argv) { // clang-format off LatticeFermionD src_d(FGrid_d); gaussian(fPRNG, src_d); - LatticeFermionD resultMGD_d(FGrid_d); resultMGD_d = zero; - LatticeFermionD resultMGF_d(FGrid_d); resultMGF_d = zero; + LatticeFermionD resultMGD_d(FGrid_d); resultMGD_d = Zero(); + LatticeFermionD resultMGF_d(FGrid_d); resultMGF_d = Zero(); LatticeGaugeFieldD Umu_d(FGrid_d); SU3::HotConfiguration(fPRNG, Umu_d); LatticeGaugeFieldF Umu_f(FGrid_f); precisionChange(Umu_f, Umu_d); // clang-format on @@ -141,8 +141,8 @@ int main(int argc, char **argv) { // clang-format off LatticeFermionF src_f(FGrid_f); precisionChange(src_f, src_d); - LatticeFermionF resMGF_f(FGrid_f); resMGF_f = zero; - LatticeFermionD resMGD_d(FGrid_d); resMGD_d = zero; + LatticeFermionF resMGF_f(FGrid_f); resMGF_f = Zero(); + LatticeFermionD resMGD_d(FGrid_d); resMGD_d = Zero(); // clang-format on (*MGPreconDw_f)(src_f, resMGF_f); diff --git a/tests/solver/Test_wilson_mr_unprec.cc b/tests/solver/Test_wilson_mr_unprec.cc index 976130d3..c124dfee 100644 --- a/tests/solver/Test_wilson_mr_unprec.cc +++ b/tests/solver/Test_wilson_mr_unprec.cc @@ -35,9 +35,9 @@ int main (int argc, char ** argv) { Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -46,7 +46,7 @@ int main (int argc, char ** argv) LatticeFermion src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - LatticeFermion result(&Grid); result=zero; + LatticeFermion result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_wilsonclover_cagmres_unprec.cc b/tests/solver/Test_wilsonclover_cagmres_unprec.cc index 3ecdf738..004fdb31 100644 --- a/tests/solver/Test_wilsonclover_cagmres_unprec.cc +++ b/tests/solver/Test_wilsonclover_cagmres_unprec.cc @@ -35,9 +35,9 @@ int main (int argc, char ** argv) { Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -50,7 +50,7 @@ int main (int argc, char ** argv) FermionField src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - FermionField result(&Grid); result=zero; + FermionField result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_wilsonclover_fcagmres_prec.cc b/tests/solver/Test_wilsonclover_fcagmres_prec.cc index 3cbbfc02..f0b27966 100644 --- a/tests/solver/Test_wilsonclover_fcagmres_prec.cc +++ b/tests/solver/Test_wilsonclover_fcagmres_prec.cc @@ -35,9 +35,9 @@ int main (int argc, char ** argv) { Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -50,7 +50,7 @@ int main (int argc, char ** argv) FermionField src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - FermionField result(&Grid); result=zero; + FermionField result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_wilsonclover_fgmres_prec.cc b/tests/solver/Test_wilsonclover_fgmres_prec.cc index 7ad0fa24..506182b5 100644 --- a/tests/solver/Test_wilsonclover_fgmres_prec.cc +++ b/tests/solver/Test_wilsonclover_fgmres_prec.cc @@ -35,9 +35,9 @@ int main (int argc, char ** argv) { Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -50,7 +50,7 @@ int main (int argc, char ** argv) FermionField src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - FermionField result(&Grid); result=zero; + FermionField result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_wilsonclover_gmres_unprec.cc b/tests/solver/Test_wilsonclover_gmres_unprec.cc index a9fe7181..85e27708 100644 --- a/tests/solver/Test_wilsonclover_gmres_unprec.cc +++ b/tests/solver/Test_wilsonclover_gmres_unprec.cc @@ -35,9 +35,9 @@ int main (int argc, char ** argv) { Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -50,7 +50,7 @@ int main (int argc, char ** argv) FermionField src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - FermionField result(&Grid); result=zero; + FermionField result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1; diff --git a/tests/solver/Test_wilsonclover_mr_unprec.cc b/tests/solver/Test_wilsonclover_mr_unprec.cc index e3aa8838..2d603810 100644 --- a/tests/solver/Test_wilsonclover_mr_unprec.cc +++ b/tests/solver/Test_wilsonclover_mr_unprec.cc @@ -35,9 +35,9 @@ int main (int argc, char ** argv) { Grid_init(&argc,&argv); - std::vector latt_size = GridDefaultLatt(); - std::vector simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); - std::vector mpi_layout = GridDefaultMpi(); + Coordinate latt_size = GridDefaultLatt(); + Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd()); + Coordinate mpi_layout = GridDefaultMpi(); GridCartesian Grid(latt_size,simd_layout,mpi_layout); GridRedBlackCartesian RBGrid(&Grid); @@ -50,7 +50,7 @@ int main (int argc, char ** argv) FermionField src(&Grid); random(pRNG,src); RealD nrm = norm2(src); - FermionField result(&Grid); result=zero; + FermionField result(&Grid); result=Zero(); LatticeGaugeField Umu(&Grid); SU3::HotConfiguration(pRNG,Umu); double volume=1;