diff --git a/benchmarks/Benchmark_dwf_fp32.cc b/benchmarks/Benchmark_dwf_fp32.cc index 5ee764c4..029b2016 100644 --- a/benchmarks/Benchmark_dwf_fp32.cc +++ b/benchmarks/Benchmark_dwf_fp32.cc @@ -123,26 +123,44 @@ void Benchmark(int Ls, Coordinate Dirichlet) long unsigned int single_site_flops = 8*Nc*(7+16*Nc); - GridCartesian * UGrid = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplexF::Nsimd()),GridDefaultMpi()); + std::vector seeds4({1,2,3,4}); + std::vector seeds5({5,6,7,8}); +#define DOUBLE +#ifdef SINGLE + typedef vComplexF Simd; + typedef LatticeFermionF FermionField; + typedef LatticeGaugeFieldF GaugeField; + typedef LatticeColourMatrixF ColourMatrixField; + typedef DomainWallFermionF FermionAction; +#endif +#ifdef DOUBLE + typedef vComplexD Simd; + typedef LatticeFermionD FermionField; + typedef LatticeGaugeFieldD GaugeField; + typedef LatticeColourMatrixD ColourMatrixField; + typedef DomainWallFermionD FermionAction; +#endif +#ifdef DOUBLE2 + typedef vComplexD2 Simd; + typedef LatticeFermionD2 FermionField; + typedef LatticeGaugeFieldD2 GaugeField; + typedef LatticeColourMatrixD2 ColourMatrixField; + typedef DomainWallFermionD2 FermionAction; +#endif + + GridCartesian * UGrid = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,Simd::Nsimd()),GridDefaultMpi()); GridRedBlackCartesian * UrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid); GridCartesian * FGrid = SpaceTimeGrid::makeFiveDimGrid(Ls,UGrid); GridRedBlackCartesian * FrbGrid = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls,UGrid); - GridCartesian * sUGrid = SpaceTimeGrid::makeFourDimDWFGrid(GridDefaultLatt(),GridDefaultMpi()); - GridRedBlackCartesian * sUrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(sUGrid); - GridCartesian * sFGrid = SpaceTimeGrid::makeFiveDimDWFGrid(Ls,UGrid); - GridRedBlackCartesian * sFrbGrid = SpaceTimeGrid::makeFiveDimDWFRedBlackGrid(Ls,UGrid); - - std::vector seeds4({1,2,3,4}); - std::vector seeds5({5,6,7,8}); - std::cout << GridLogMessage << "Initialising 4d RNG" << std::endl; GridParallelRNG RNG4(UGrid); RNG4.SeedUniqueString(std::string("The 4D RNG")); std::cout << GridLogMessage << "Initialising 5d RNG" << std::endl; GridParallelRNG RNG5(FGrid); RNG5.SeedUniqueString(std::string("The 5D RNG")); - LatticeFermionF src (FGrid); random(RNG5,src); + + FermionField src (FGrid); random(RNG5,src); #if 0 src = Zero(); { @@ -158,14 +176,14 @@ void Benchmark(int Ls, Coordinate Dirichlet) src = src*N2; #endif - LatticeFermionF result(FGrid); result=Zero(); - LatticeFermionF ref(FGrid); ref=Zero(); - LatticeFermionF tmp(FGrid); - LatticeFermionF err(FGrid); + FermionField result(FGrid); result=Zero(); + FermionField ref(FGrid); ref=Zero(); + FermionField tmp(FGrid); + FermionField err(FGrid); std::cout << GridLogMessage << "Drawing gauge field" << std::endl; - LatticeGaugeFieldF Umu(UGrid); - LatticeGaugeFieldF UmuCopy(UGrid); + GaugeField Umu(UGrid); + GaugeField UmuCopy(UGrid); SU::HotConfiguration(RNG4,Umu); UmuCopy=Umu; std::cout << GridLogMessage << "Random gauge initialised " << std::endl; @@ -179,13 +197,13 @@ void Benchmark(int Ls, Coordinate Dirichlet) std::cout << GridLogMessage << "Applying BCs for Dirichlet Block5 " << Dirichlet << std::endl; std::cout << GridLogMessage << "Applying BCs for Dirichlet Block4 " << Block << std::endl; - DirichletFilter Filter(Block); + DirichletFilter Filter(Block); Filter.applyFilter(Umu); //////////////////////////////////// // Naive wilson implementation //////////////////////////////////// - std::vector U(4,UGrid); + std::vector U(4,UGrid); for(int mu=0;mu(Umu,mu); } @@ -236,10 +254,8 @@ void Benchmark(int Ls, Coordinate Dirichlet) std::cout << GridLogMessage<< "*****************************************************************" <Barrier(); Dw.Dhop(src,result,0); @@ -270,8 +287,8 @@ void Benchmark(int Ls, Coordinate Dirichlet) double volume=Ls; for(int mu=0;mu1.0e-4) ) { + if(( n2e>1.0e-4) ) { std::cout<Barrier(); exit(-1); } - assert (norm2(err)< 1.0e-4 ); + assert (n2e< 1.0e-4 ); } if (1) @@ -348,14 +364,16 @@ void Benchmark(int Ls, Coordinate Dirichlet) std::cout<Barrier(); @@ -414,8 +424,9 @@ void Benchmark(int Ls, Coordinate Dirichlet) setCheckerboard(r_eo,r_e); err = r_eo-result; - std::cout<