diff --git a/Grid/qcd/action/Action.h b/Grid/qcd/action/Action.h index 737c1ff0..4bedc3fc 100644 --- a/Grid/qcd/action/Action.h +++ b/Grid/qcd/action/Action.h @@ -30,8 +30,7 @@ Author: paboyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#ifndef GRID_QCD_ACTION_H -#define GRID_QCD_ACTION_H +#pragma once //////////////////////////////////////////// // Abstract base interface @@ -51,4 +50,4 @@ NAMESPACE_CHECK(Fermion); #include NAMESPACE_CHECK(PseudoFermion); -#endif + diff --git a/Grid/qcd/action/ActionCore.h b/Grid/qcd/action/ActionCore.h index 2ec74a95..d72c9a89 100644 --- a/Grid/qcd/action/ActionCore.h +++ b/Grid/qcd/action/ActionCore.h @@ -58,8 +58,8 @@ NAMESPACE_CHECK(Scalar); //////////////////////////////////////////// // Utility functions //////////////////////////////////////////// -#include -//#include +#include + #include NAMESPACE_CHECK(Metric); #include diff --git a/Grid/qcd/action/momentum/DDHMCFilter.h b/Grid/qcd/action/domains/DDHMCFilter.h similarity index 100% rename from Grid/qcd/action/momentum/DDHMCFilter.h rename to Grid/qcd/action/domains/DDHMCFilter.h diff --git a/Grid/qcd/action/momentum/DirichletFilter.h b/Grid/qcd/action/domains/DirichletFilter.h similarity index 98% rename from Grid/qcd/action/momentum/DirichletFilter.h rename to Grid/qcd/action/domains/DirichletFilter.h index d7606bb2..adc2b163 100644 --- a/Grid/qcd/action/momentum/DirichletFilter.h +++ b/Grid/qcd/action/domains/DirichletFilter.h @@ -32,7 +32,7 @@ directory //////////////////////////////////////////////////// #pragma once -#include +#include NAMESPACE_BEGIN(Grid); diff --git a/Grid/qcd/action/domains/Domains.h b/Grid/qcd/action/domains/Domains.h new file mode 100644 index 00000000..5d632983 --- /dev/null +++ b/Grid/qcd/action/domains/Domains.h @@ -0,0 +1,39 @@ +/************************************************************************************* + +Grid physics library, www.github.com/paboyle/Grid + +Source file: ./lib/qcd/action/momentum/Domains.h + +Copyright (C) 2021 + +Author: Peter Boyle + +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 */ + +//////////////////////////////////////////////////// +// Dirichlet filter with sub-block size B[mu] +//////////////////////////////////////////////////// +#pragma once + +#include +#include +#include +#include + diff --git a/Grid/qcd/action/momentum/MomentumFilter.h b/Grid/qcd/action/domains/MomentumFilter.h similarity index 100% rename from Grid/qcd/action/momentum/MomentumFilter.h rename to Grid/qcd/action/domains/MomentumFilter.h diff --git a/Grid/qcd/action/fermion/Fermion.h b/Grid/qcd/action/fermion/Fermion.h index 09777204..c72246d7 100644 --- a/Grid/qcd/action/fermion/Fermion.h +++ b/Grid/qcd/action/fermion/Fermion.h @@ -101,6 +101,12 @@ NAMESPACE_CHECK(WilsonTM5); #include #include #include +//////////////////////////////////////////////////////////////////// +// DDHMC related +//////////////////////////////////////////////////////////////////// +#include +#include + NAMESPACE_CHECK(DWFutils); //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Grid/qcd/action/fermion/FermionCore.h b/Grid/qcd/action/fermion/FermionCore.h index 6745032e..e2c1a020 100644 --- a/Grid/qcd/action/fermion/FermionCore.h +++ b/Grid/qcd/action/fermion/FermionCore.h @@ -25,8 +25,7 @@ Author: Peter Boyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#ifndef GRID_QCD_FERMION_CORE_H -#define GRID_QCD_FERMION_CORE_H +#pragma once #include #include @@ -45,4 +44,3 @@ NAMESPACE_CHECK(FermionOperator); #include //used by all wilson type fermions NAMESPACE_CHECK(Kernels); -#endif diff --git a/Grid/qcd/action/fermion/SchurFactoredFermionOperator.h b/Grid/qcd/action/fermion/SchurFactoredFermionOperator.h index 1aa79366..b74d8bf3 100644 --- a/Grid/qcd/action/fermion/SchurFactoredFermionOperator.h +++ b/Grid/qcd/action/fermion/SchurFactoredFermionOperator.h @@ -28,7 +28,7 @@ Author: Peter Boyle #pragma once #include -#include +#include NAMESPACE_BEGIN(Grid); diff --git a/Grid/qcd/action/momentum/Domains.h b/Grid/qcd/action/momentum/Domains.h deleted file mode 100644 index 6f7c7627..00000000 --- a/Grid/qcd/action/momentum/Domains.h +++ /dev/null @@ -1,125 +0,0 @@ -/************************************************************************************* - -Grid physics library, www.github.com/paboyle/Grid - -Source file: ./lib/qcd/action/momentum/Domains.h - -Copyright (C) 2021 - -Author: Peter Boyle - -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 */ - -//////////////////////////////////////////////////// -// Dirichlet filter with sub-block size B[mu] -//////////////////////////////////////////////////// -#pragma once - - -NAMESPACE_BEGIN(Grid); - - -struct DomainDecomposition -{ - Coordinate Block; - static constexpr RealD factor = 0.0; - - DomainDecomposition(const Coordinate &_Block): Block(_Block){}; - - template - void ProjectDomain(Field &f,Integer domain) - { - GridBase *grid = f.Grid(); - int dims = grid->Nd(); - int isDWF= (dims==Nd+1); - assert((dims==Nd)||(dims==Nd+1)); - - Field zz(grid); zz = Zero(); - LatticeInteger coor(grid); - LatticeInteger domaincoor(grid); - LatticeInteger mask(grid); mask = Integer(1); - LatticeInteger zi(grid); zi = Integer(0); - for(int d=0;d - void ProjectDDHMC(GaugeField &U) - { - GridBase *grid = U.Grid(); - GaugeField Uslow(grid); - Coordinate Global=grid->GlobalDimensions(); - GaugeField zzz(grid); zzz = Zero(); - LatticeInteger coor(grid); - - //////////////////////////////////////////////////// - // All links except BDY layers - //////////////////////////////////////////////////// - for(int mu=0;mu(zzz,mu); - auto U_mu = PeekIndex(U,mu); - U_mu = where(mod(coor,B1)==Integer(0),zzz_mu,U_mu); - U = where(mod(coor,B1)==Integer(0),zzz,U); - PokeIndex(U, U_mu, mu); - - Uslow = U * factor; - //////////////////////////////////////////// - // Omega interior slow the evolution - //////////////////////////////////////////// - U = where(mod(coor,B1)==Integer(B1-4),Uslow,U); // Could scale down??? - U = where(mod(coor,B1)==Integer(B1-3),Uslow,U); // Could scale down??? - U = where(mod(coor,B1)==Integer(B1-2),Uslow,U); - - U_mu = PeekIndex(U,mu); - U_mu = where(mod(coor,B1)==Integer(1),U_mu*factor,U_mu); - U = where(mod(coor,B1)==Integer(1),zzz,U); - PokeIndex(U, U_mu, mu); - - - U = where(mod(coor,B1)==Integer(2),Uslow,U); - - U_mu = PeekIndex(U,mu); - U = where(mod(coor,B1)==Integer(3),Uslow,U); - PokeIndex(U, U_mu, mu); - } - } - } -}; - -NAMESPACE_END(Grid); diff --git a/Grid/qcd/action/pseudofermion/PseudoFermion.h b/Grid/qcd/action/pseudofermion/PseudoFermion.h index dfa94043..ffc1ee76 100644 --- a/Grid/qcd/action/pseudofermion/PseudoFermion.h +++ b/Grid/qcd/action/pseudofermion/PseudoFermion.h @@ -26,8 +26,7 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#ifndef QCD_PSEUDOFERMION_AGGREGATE_H -#define QCD_PSEUDOFERMION_AGGREGATE_H +#pragma once // Rational functions #include @@ -44,5 +43,10 @@ directory #include #include #include +#include +#include +#include + + + -#endif diff --git a/HMC/Mobius2f_DDHMC_mixed.cc b/HMC/Mobius2f_DDHMC_mixed.cc index 992409df..3a762bf0 100644 --- a/HMC/Mobius2f_DDHMC_mixed.cc +++ b/HMC/Mobius2f_DDHMC_mixed.cc @@ -27,15 +27,6 @@ directory *************************************************************************************/ /* END LEGAL */ #include -#include -#include -#include -#include - -#include -#include -#include - NAMESPACE_BEGIN(Grid); diff --git a/benchmarks/Benchmark_dwf_fp32.cc b/benchmarks/Benchmark_dwf_fp32.cc index 50cbbc98..31bab7bd 100644 --- a/benchmarks/Benchmark_dwf_fp32.cc +++ b/benchmarks/Benchmark_dwf_fp32.cc @@ -28,9 +28,6 @@ #ifdef CUDA_PROFILE #include #endif -#include -#include -#include using namespace std; using namespace Grid; @@ -373,7 +370,6 @@ int main (int argc, char ** argv) // Dirichlet benchmark Coordinate local(Nd); - Coordinate nil(Nd,0); for(int d=0;dBarrier(); Dirichlet.DhopEO(src_o,r_e,DaggerNo); diff --git a/tests/core/Test_ddhmc_matrices.cc b/tests/core/Test_ddhmc_matrices.cc index e7ae992e..9e277376 100644 --- a/tests/core/Test_ddhmc_matrices.cc +++ b/tests/core/Test_ddhmc_matrices.cc @@ -27,9 +27,6 @@ Author: paboyle *************************************************************************************/ /* END LEGAL */ #include -#include -#include -#include using namespace std; using namespace Grid; @@ -84,13 +81,12 @@ int main (int argc, char ** argv) typedef DomainWallFermionF::Impl_t FimplF; typedef DirichletFermionOperator FermOp; typedef DirichletFermionOperator FermOpF; - Coordinate Block1({0,0,0,Nt/2}); - Coordinate Block2({0,0,0,Nt/4}); + Coordinate Block({0,0,0,Nt/2}); DomainWallFermionR DdwfPeriTmp(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5); DomainWallFermionF DdwfPeriTmpF(UmuF,*FGridF,*FrbGridF,*UGridF,*UrbGridF,mass,M5); - FermOp Ddwf(DdwfPeriTmp,Block1,Block2); - FermOpF DdwfF(DdwfPeriTmpF,Block1,Block2); + FermOp Ddwf(DdwfPeriTmp,Block); + FermOpF DdwfF(DdwfPeriTmpF,Block); Ddwf.ImportGauge(Umu); DdwfF.ImportGauge(UmuF); @@ -300,7 +296,7 @@ int main (int argc, char ** argv) SchurFactoredFermionOperator Schur(DdwfPeri,DdwfPeriF, Ddwf,DdwfF, - Block1,Block2); + Block); result = src; Schur.ProjectOmega(result); diff --git a/tests/forces/Test_ddhmc_boundary.cc b/tests/forces/Test_ddhmc_boundary.cc index 67e508eb..fcdd14de 100644 --- a/tests/forces/Test_ddhmc_boundary.cc +++ b/tests/forces/Test_ddhmc_boundary.cc @@ -26,13 +26,6 @@ Author: Peter Boyle *************************************************************************************/ /* END LEGAL */ #include -#include -#include -#include -#include -#include -#include -#include using namespace std; using namespace Grid; @@ -152,37 +145,35 @@ int main (int argc, char ** argv) RealD mass=0.01; RealD M5=1.8; - Coordinate Block1({0,0,0,Nt/2}); - Coordinate Block2({0,0,0,Nt/2-4}); + Coordinate Block({0,0,0,Nt/2}); // Double versions typedef WilsonImplD FimplD; typedef DirichletFermionOperator DirichletFermion; DomainWallFermionR DdwfPeriodic(U,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5); DomainWallFermionR Ddwf(U,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5); - DirichletFermion DdwfDirichlet(Ddwf,Block1,Block2); + DirichletFermion DdwfDirichlet(Ddwf,Block); DomainWallFermionR PVPeriodic(U,*FGrid,*FrbGrid,*UGrid,*UrbGrid,1.0,M5); DomainWallFermionR PV(U,*FGrid,*FrbGrid,*UGrid,*UrbGrid,1.0,M5); - DirichletFermion PVDirichlet(PV,Block1,Block2); + DirichletFermion PVDirichlet(PV,Block); // Single versions typedef WilsonImplF FimplF; typedef DirichletFermionOperator DirichletFermionF; DomainWallFermionF DdwfPeriodicF(UF,*FGridF,*FrbGridF,*UGridF,*UrbGridF,mass,M5); DomainWallFermionF DdwfF(UF,*FGridF,*FrbGridF,*UGridF,*UrbGridF,mass,M5); - DirichletFermionF DdwfDirichletF(DdwfF,Block1,Block2); + DirichletFermionF DdwfDirichletF(DdwfF,Block); DomainWallFermionF PVPeriodicF(UF,*FGridF,*FrbGridF,*UGridF,*UrbGridF,1.0,M5); DomainWallFermionF PVF(UF,*FGridF,*FrbGridF,*UGridF,*UrbGridF,1.0,M5); - DirichletFermionF PVDirichletF(PVF,Block1,Block2); + DirichletFermionF PVDirichletF(PVF,Block); double StoppingCondition = 1.0e-12; double MaxCGIterations = 10000; ConjugateGradient CG(StoppingCondition,MaxCGIterations); - // DDHMCFilter FilterDDHMC(Block1,Block2,1); - DirichletFilter FilterDDHMC(Block1,Block2); + DirichletFilter FilterDDHMC(Block); //////////////////// Two Flavour Determinant Ratio /////////////////////////////// TwoFlavourRatioPseudoFermionAction Nf2(PVPeriodic, DdwfPeriodic,CG,CG); @@ -202,12 +193,12 @@ int main (int argc, char ** argv) SchurFactoredFermionOperator SchurDwf(DdwfPeriodic,DdwfPeriodicF, DdwfDirichlet,DdwfDirichletF, - Block1,Block2); + Block); SchurFactoredFermionOperator SchurPV(PVPeriodic,PVPeriodicF, PVDirichlet,PVDirichletF, - Block1,Block2); + Block); std::cout << "*** NUMERATOR ***\n";