From da43ef7c2dd7f6608a101658860644ae1e219372 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Fri, 13 Jun 2025 05:05:15 +0200 Subject: [PATCH] REmove partial dirichlet option. It's going nowhere --- benchmarks/Benchmark_dwf_fp32_partial.cc | 465 ----------------------- 1 file changed, 465 deletions(-) delete mode 100644 benchmarks/Benchmark_dwf_fp32_partial.cc diff --git a/benchmarks/Benchmark_dwf_fp32_partial.cc b/benchmarks/Benchmark_dwf_fp32_partial.cc deleted file mode 100644 index 0cbd4a6c..00000000 --- a/benchmarks/Benchmark_dwf_fp32_partial.cc +++ /dev/null @@ -1,465 +0,0 @@ - /************************************************************************************* - Grid physics library, www.github.com/paboyle/Grid - Source file: ./benchmarks/Benchmark_dwf.cc - Copyright (C) 2015 - - Author: Peter Boyle - 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 -#ifdef GRID_CUDA -#define CUDA_PROFILE -#endif - -#ifdef CUDA_PROFILE -#include -#endif - -using namespace std; -using namespace Grid; - -//////////////////////// -/// Move to domains //// -//////////////////////// - -Gamma::Algebra Gmu [] = { - Gamma::Algebra::GammaX, - Gamma::Algebra::GammaY, - Gamma::Algebra::GammaZ, - Gamma::Algebra::GammaT -}; - -void Benchmark(int Ls, Coordinate Dirichlet, int partial); - -int main (int argc, char ** argv) -{ - Grid_init(&argc,&argv); - - - int threads = GridThread::GetThreads(); - - int Ls=8; - for(int i=0;i> Ls; - } - } - - ////////////////// - // With comms - ////////////////// - Coordinate Dirichlet(Nd+1,0); - - for(auto partial : {0}) { - std::cout << "\n\n\n\n\n\n" <1 ? 1 : 0; - // for(int d=0;d1 ? 1 : 0; - Dirichlet[0] = 0; - Dirichlet[1] = CommDim[0]*latt4[0]/mpi[0]; - Dirichlet[2] = CommDim[1]*latt4[1]/mpi[1]; - Dirichlet[3] = CommDim[2]*latt4[2]/mpi[2]; - Dirichlet[4] = CommDim[3]*latt4[3]/mpi[3]; - - for(auto partial : {0,1}) { - std::cout << "\n\n\n\n\n\n" < seeds4({1,2,3,4}); - std::vector seeds5({5,6,7,8}); -#define SINGLE -#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); - - 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")); - - - FermionField src (FGrid); random(RNG5,src); -#if 0 - src = Zero(); - { - Coordinate origin({0,0,0,latt4[2]-1,0}); - SpinColourVectorF tmp; - tmp=Zero(); - tmp()(0)(0)=Complex(-2.0,0.0); - std::cout << " source site 0 " << tmp<::HotConfiguration(RNG4,Umu); - UmuCopy=Umu; - UmuFull=Umu; - std::cout << GridLogMessage << "Random gauge initialised " << std::endl; - - //////////////////////////////////// - // Apply BCs - //////////////////////////////////// - Coordinate Block(4); - for(int d=0;d<4;d++) Block[d]= Dirichlet[d+1]; - - 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); - Filter.applyFilter(Umu); - if(!partial) Filter.applyFilter(UmuCopy); - - //////////////////////////////////// - // Naive wilson implementation - //////////////////////////////////// - std::vector U(4,UGrid); - std::vector Ucopy(4,UGrid); - for(int mu=0;mu(Umu,mu); - Ucopy[mu] = PeekIndex(UmuCopy,mu); - } - - std::cout << GridLogMessage << "Setting up Cshift based reference " << std::endl; - - if (1) - { - ref = Zero(); - for(int mu=0;muoSites();ss++){ - for(int s=0;s=Ls-depth)){ - tmp_v[Ls*ss+s] = Ucopy_v[ss]*tmp_v[Ls*ss+s]; - } else { - tmp_v[Ls*ss+s] = U_v[ss]*tmp_v[Ls*ss+s]; - } - } - } - } - ref=ref + tmp - Gamma(Gmu[mu])*tmp; - { - autoView( tmp_v , tmp , CpuWrite); - autoView( U_v , U[mu] , CpuRead); - autoView( Ucopy_v, Ucopy[mu] , CpuRead); - autoView( src_v, src , CpuRead); - for(int ss=0;ssoSites();ss++){ - for(int s=0;s=Ls-depth)){ - tmp_v[Ls*ss+s] = adj(Ucopy_v[ss])*src_v[Ls*ss+s]; - } else { - tmp_v[Ls*ss+s] = adj(U_v[ss])*src_v[Ls*ss+s]; - } - } - } - } - tmp =Cshift(tmp,mu+1,-1); - ref=ref + tmp + Gamma(Gmu[mu])*tmp; - } - ref = -0.5*ref; - } - - RealD mass=0.1; - RealD M5 =1.8; - - RealD NP = UGrid->_Nprocessors; - RealD NN = UGrid->NodeCount(); - - std::cout << GridLogMessage<< "*****************************************************************" <Barrier(); - Dw.Dhop(src,result,0); - std::cout<Barrier(); - - double volume=Ls; for(int mu=0;mu1.0e-4) ) { - std::cout<Barrier(); - - DumpSliceNorm("s-slice ref ",ref,1); - DumpSliceNorm("s-slice res ",result,1); - DumpSliceNorm("s-slice error ",err,1); - exit(-1); - } - assert (n2e< 1.0e-4 ); - } - - if (1) - { // Naive wilson dag implementation - - ref = Zero(); - for(int mu=0;muoSites();ss++){ - for(int s=0;s=Ls-depth)){ - tmp_v[Ls*ss+s] = Ucopy_v[ss]*tmp_v[Ls*ss+s]; - } else { - tmp_v[Ls*ss+s] = U_v[ss]*tmp_v[Ls*ss+s]; - } - } - } - } - ref=ref + tmp + Gamma(Gmu[mu])*tmp; - { - autoView( tmp_v , tmp , CpuWrite); - autoView( U_v , U[mu] , CpuRead); - autoView( Ucopy_v, Ucopy[mu] , CpuRead); - autoView( src_v, src , CpuRead); - for(int ss=0;ssoSites();ss++){ - for(int s=0;s=Ls-depth)){ - tmp_v[Ls*ss+s] = adj(Ucopy_v[ss])*src_v[Ls*ss+s]; - } else { - tmp_v[Ls*ss+s] = adj(U_v[ss])*src_v[Ls*ss+s]; - } - } - } - } - tmp =Cshift(tmp,mu+1,-1); - ref=ref + tmp - Gamma(Gmu[mu])*tmp; - } - ref = -0.5*ref; - } - - Dw.Dhop(src,result,DaggerYes); - - std::cout << GridLogMessage << "----------------------------------------------------------------" << std::endl; - std::cout << GridLogMessage << "Compare to naive wilson implementation Dag to verify correctness" << std::endl; - std::cout << GridLogMessage << "----------------------------------------------------------------" << std::endl; - - std::cout<Barrier(); - Dw.DhopEO(src_o,r_e,DaggerNo); - double t0=usecond(); - for(int i=0;iBarrier(); - - double volume=Ls; for(int mu=0;mu