mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-25 05:05:56 +01:00
Build tests works
This commit is contained in:
parent
91bf1df018
commit
e0c9d01123
@ -30,8 +30,7 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
||||
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 <Grid/qcd/action/pseudofermion/PseudoFermion.h>
|
||||
NAMESPACE_CHECK(PseudoFermion);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -58,8 +58,8 @@ NAMESPACE_CHECK(Scalar);
|
||||
////////////////////////////////////////////
|
||||
// Utility functions
|
||||
////////////////////////////////////////////
|
||||
#include <Grid/qcd/action/momentum/MomentumFilter.h>
|
||||
//#include <Grid/qcd/action/momentum/DDHMCfilter.h>
|
||||
#include <Grid/qcd/action/domains/Domains.h>
|
||||
|
||||
#include <Grid/qcd/utils/Metric.h>
|
||||
NAMESPACE_CHECK(Metric);
|
||||
#include <Grid/qcd/utils/CovariantLaplacian.h>
|
||||
|
@ -32,7 +32,7 @@ directory
|
||||
////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include <Grid/qcd/action/momentum/Domains.h>
|
||||
#include <Grid/qcd/action/domains/DomainDecomposition.h>
|
||||
|
||||
NAMESPACE_BEGIN(Grid);
|
||||
|
39
Grid/qcd/action/domains/Domains.h
Normal file
39
Grid/qcd/action/domains/Domains.h
Normal file
@ -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 <paboyle@ph.ed.ac.uk>
|
||||
|
||||
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 <Grid/qcd/action/domains/DomainDecomposition.h>
|
||||
#include <Grid/qcd/action/domains/MomentumFilter.h>
|
||||
#include <Grid/qcd/action/domains/DirichletFilter.h>
|
||||
#include <Grid/qcd/action/domains/DDHMCFilter.h>
|
||||
|
@ -101,6 +101,12 @@ NAMESPACE_CHECK(WilsonTM5);
|
||||
#include <Grid/qcd/action/fermion/PauliVillarsInverters.h>
|
||||
#include <Grid/qcd/action/fermion/Reconstruct5Dprop.h>
|
||||
#include <Grid/qcd/action/fermion/MADWF.h>
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// DDHMC related
|
||||
////////////////////////////////////////////////////////////////////
|
||||
#include <Grid/qcd/action/fermion/DirichletFermionOperator.h>
|
||||
#include <Grid/qcd/action/fermion/SchurFactoredFermionOperator.h>
|
||||
|
||||
NAMESPACE_CHECK(DWFutils);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -25,8 +25,7 @@ Author: Peter Boyle <pabobyle@ph.ed.ac.uk>
|
||||
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 <Grid/GridCore.h>
|
||||
#include <Grid/GridQCDcore.h>
|
||||
@ -45,4 +44,3 @@ NAMESPACE_CHECK(FermionOperator);
|
||||
#include <Grid/qcd/action/fermion/StaggeredKernels.h> //used by all wilson type fermions
|
||||
NAMESPACE_CHECK(Kernels);
|
||||
|
||||
#endif
|
||||
|
@ -28,7 +28,7 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
||||
#pragma once
|
||||
|
||||
#include <Grid/qcd/utils/MixedPrecisionOperatorFunction.h>
|
||||
#include <Grid/qcd/action/momentum/Domains.h>
|
||||
#include <Grid/qcd/action/domains/Domains.h>
|
||||
|
||||
NAMESPACE_BEGIN(Grid);
|
||||
|
||||
|
@ -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 <paboyle@ph.ed.ac.uk>
|
||||
|
||||
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<class Field>
|
||||
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<Nd;d++){
|
||||
Integer B= Block[d];
|
||||
if ( B ) {
|
||||
LatticeCoordinate(coor,d+isDWF);
|
||||
domaincoor = mod(coor,B);
|
||||
mask = where(domaincoor==Integer(0),zi,mask);
|
||||
mask = where(domaincoor==Integer(B-1),zi,mask);
|
||||
}
|
||||
}
|
||||
if ( domain )
|
||||
f = where(mask==Integer(1),f,zz);
|
||||
else
|
||||
f = where(mask==Integer(0),f,zz);
|
||||
};
|
||||
template<class GaugeField>
|
||||
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<Nd;mu++) {
|
||||
Integer B1 = Block[mu];
|
||||
if ( B1 && (B1 <= Global[mu]) ) {
|
||||
LatticeCoordinate(coor,mu);
|
||||
|
||||
////////////////////////////////
|
||||
// OmegaBar - zero all links contained
|
||||
////////////////////////////////
|
||||
U = where(mod(coor,B1)==Integer(B1-1),zzz,U);
|
||||
|
||||
auto zzz_mu = PeekIndex<LorentzIndex>(zzz,mu);
|
||||
auto U_mu = PeekIndex<LorentzIndex>(U,mu);
|
||||
U_mu = where(mod(coor,B1)==Integer(0),zzz_mu,U_mu);
|
||||
U = where(mod(coor,B1)==Integer(0),zzz,U);
|
||||
PokeIndex<LorentzIndex>(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<LorentzIndex>(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<LorentzIndex>(U, U_mu, mu);
|
||||
|
||||
|
||||
U = where(mod(coor,B1)==Integer(2),Uslow,U);
|
||||
|
||||
U_mu = PeekIndex<LorentzIndex>(U,mu);
|
||||
U = where(mod(coor,B1)==Integer(3),Uslow,U);
|
||||
PokeIndex<LorentzIndex>(U, U_mu, mu);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
NAMESPACE_END(Grid);
|
@ -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 <Grid/qcd/action/pseudofermion/Bounds.h>
|
||||
@ -44,5 +43,10 @@ directory
|
||||
#include <Grid/qcd/action/pseudofermion/GeneralEvenOddRationalRatioMixedPrec.h>
|
||||
#include <Grid/qcd/action/pseudofermion/OneFlavourEvenOddRationalRatio.h>
|
||||
#include <Grid/qcd/action/pseudofermion/ExactOneFlavourRatio.h>
|
||||
#include <Grid/qcd/action/pseudofermion/DomainDecomposedBoundaryTwoFlavourPseudoFermion.h>
|
||||
#include <Grid/qcd/action/pseudofermion/DomainDecomposedBoundaryTwoFlavourBosonPseudoFermion.h>
|
||||
#include <Grid/qcd/action/pseudofermion/DomainDecomposedBoundaryTwoFlavourRatioPseudoFermion.h>
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -27,15 +27,6 @@ directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Grid.h>
|
||||
#include <Grid/qcd/action/momentum/DirichletFilter.h>
|
||||
#include <Grid/qcd/action/momentum/DDHMCfilter.h>
|
||||
#include <Grid/qcd/action/fermion/DirichletFermionOperator.h>
|
||||
#include <Grid/qcd/action/fermion/SchurFactoredFermionOperator.h>
|
||||
|
||||
#include <Grid/qcd/action/pseudofermion/DomainDecomposedBoundaryTwoFlavourPseudoFermion.h>
|
||||
#include <Grid/qcd/action/pseudofermion/DomainDecomposedBoundaryTwoFlavourRatioPseudoFermion.h>
|
||||
#include <Grid/qcd/action/pseudofermion/DomainDecomposedBoundaryTwoFlavourBosonPseudoFermion.h>
|
||||
|
||||
|
||||
|
||||
NAMESPACE_BEGIN(Grid);
|
||||
|
@ -28,9 +28,6 @@
|
||||
#ifdef CUDA_PROFILE
|
||||
#include <cuda_profiler_api.h>
|
||||
#endif
|
||||
#include <Grid/qcd/action/momentum/DirichletFilter.h>
|
||||
#include <Grid/qcd/action/momentum/DDHMCfilter.h>
|
||||
#include <Grid/qcd/action/fermion/DirichletFermionOperator.h>
|
||||
|
||||
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;d<Nd;d++){
|
||||
local[d] = latt[d]/mpi[d];
|
||||
}
|
||||
@ -381,8 +377,8 @@ int main (int argc, char ** argv)
|
||||
DomainWallFermionF::ImplParams DirichletParams(boundary);
|
||||
DirichletParams.locally_periodic=true;
|
||||
DomainWallFermionF DwDirichlet(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,DirichletParams);
|
||||
DirichletFermionF Dirichlet(DwDirichlet,local,nil);
|
||||
|
||||
DirichletFermionF Dirichlet(DwDirichlet,local);
|
||||
Dirichlet.ImportGauge(Umu);
|
||||
{
|
||||
FGrid->Barrier();
|
||||
Dirichlet.DhopEO(src_o,r_e,DaggerNo);
|
||||
|
@ -27,9 +27,6 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Grid.h>
|
||||
#include <Grid/qcd/action/momentum/DirichletFilter.h>
|
||||
#include <Grid/qcd/action/fermion/DirichletFermionOperator.h>
|
||||
#include <Grid/qcd/action/fermion/SchurFactoredFermionOperator.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace Grid;
|
||||
@ -84,13 +81,12 @@ int main (int argc, char ** argv)
|
||||
typedef DomainWallFermionF::Impl_t FimplF;
|
||||
typedef DirichletFermionOperator<FimplD> FermOp;
|
||||
typedef DirichletFermionOperator<FimplF> 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<FimplD,FimplF> Schur(DdwfPeri,DdwfPeriF,
|
||||
Ddwf,DdwfF,
|
||||
Block1,Block2);
|
||||
Block);
|
||||
|
||||
result = src;
|
||||
Schur.ProjectOmega(result);
|
||||
|
@ -26,13 +26,6 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Grid.h>
|
||||
#include <Grid/qcd/action/momentum/DirichletFilter.h>
|
||||
#include <Grid/qcd/action/momentum/DDHMCfilter.h>
|
||||
#include <Grid/qcd/action/fermion/DirichletFermionOperator.h>
|
||||
#include <Grid/qcd/action/fermion/SchurFactoredFermionOperator.h>
|
||||
#include <Grid/qcd/action/pseudofermion/DomainDecomposedBoundaryTwoFlavourPseudoFermion.h>
|
||||
#include <Grid/qcd/action/pseudofermion/DomainDecomposedBoundaryTwoFlavourRatioPseudoFermion.h>
|
||||
#include <Grid/qcd/action/pseudofermion/DomainDecomposedBoundaryTwoFlavourBosonPseudoFermion.h>
|
||||
|
||||
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<WilsonImplR> 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<WilsonImplF> 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<LatticeFermion> CG(StoppingCondition,MaxCGIterations);
|
||||
|
||||
// DDHMCFilter<LatticeGaugeField> FilterDDHMC(Block1,Block2,1);
|
||||
DirichletFilter<LatticeGaugeField> FilterDDHMC(Block1,Block2);
|
||||
DirichletFilter<LatticeGaugeField> FilterDDHMC(Block);
|
||||
|
||||
//////////////////// Two Flavour Determinant Ratio ///////////////////////////////
|
||||
TwoFlavourRatioPseudoFermionAction<FimplD> Nf2(PVPeriodic, DdwfPeriodic,CG,CG);
|
||||
@ -202,12 +193,12 @@ int main (int argc, char ** argv)
|
||||
SchurFactoredFermionOperator<FimplD,FimplF>
|
||||
SchurDwf(DdwfPeriodic,DdwfPeriodicF,
|
||||
DdwfDirichlet,DdwfDirichletF,
|
||||
Block1,Block2);
|
||||
Block);
|
||||
|
||||
SchurFactoredFermionOperator<FimplD,FimplF>
|
||||
SchurPV(PVPeriodic,PVPeriodicF,
|
||||
PVDirichlet,PVDirichletF,
|
||||
Block1,Block2);
|
||||
Block);
|
||||
|
||||
|
||||
std::cout << "*** NUMERATOR ***\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user