1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-12 20:27:06 +01:00

definetely the right merge upstream/develop

This commit is contained in:
Alessandro Lupo
2023-06-16 14:19:46 +01:00
446 changed files with 46860 additions and 16333 deletions

View File

@ -71,14 +71,14 @@ int main (int argc, char ** argv)
RealD mass=0.1;
RealD M5=1.8;
OverlapWilsonContFracTanhFermionR Dcf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,1.0);
OverlapWilsonContFracTanhFermionD Dcf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,1.0);
ConjugateResidual<LatticeFermion> MCR(1.0e-8,10000);
MdagMLinearOperator<OverlapWilsonContFracTanhFermionR,LatticeFermion> HermPosDefOp(Dcf);
MdagMLinearOperator<OverlapWilsonContFracTanhFermionD,LatticeFermion> HermPosDefOp(Dcf);
MCR(HermPosDefOp,src,result);
HermitianLinearOperator<OverlapWilsonContFracTanhFermionR,LatticeFermion> HermIndefOp(Dcf);
HermitianLinearOperator<OverlapWilsonContFracTanhFermionD,LatticeFermion> HermIndefOp(Dcf);
MCR(HermIndefOp,src,result);
Grid_finalize();

View File

@ -93,15 +93,16 @@ int main(int argc, char** argv) {
// Setup of Dirac Matrix and Operator //
/////////////////////////////////////////////////////////////////////////////
LatticeGaugeField Umu(Grid_f); SU<Nc>::HotConfiguration(pRNG_f, Umu);
LatticeGaugeField Umu(Grid_f);
SU<Nc>::HotConfiguration(pRNG_f, Umu);
RealD checkTolerance = (getPrecision<LatticeFermion>::value == 1) ? 1e-7 : 1e-15;
RealD mass = -0.30;
RealD csw = 1.9192;
WilsonCloverFermionR Dwc(Umu, *Grid_f, *RBGrid_f, mass, csw, csw);
MdagMLinearOperator<WilsonCloverFermionR, LatticeFermion> MdagMOp_Dwc(Dwc);
WilsonCloverFermionD Dwc(Umu, *Grid_f, *RBGrid_f, mass, csw, csw);
MdagMLinearOperator<WilsonCloverFermionD, LatticeFermion> MdagMOp_Dwc(Dwc);
/////////////////////////////////////////////////////////////////////////////
// Type definitions //

View File

@ -102,21 +102,21 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage <<"OverlapWilsonContFracTanhFermion test"<<std::endl;
OverlapWilsonContFracTanhFermionR Dcf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,1.0);
TestCGinversions<OverlapWilsonContFracTanhFermionR>(Dcf,FGrid,FrbGrid,UGrid,UrbGrid,mass,M5,&RNG4,&RNG5);
OverlapWilsonContFracTanhFermionD Dcf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,1.0);
TestCGinversions<OverlapWilsonContFracTanhFermionD>(Dcf,FGrid,FrbGrid,UGrid,UrbGrid,mass,M5,&RNG4,&RNG5);
std::cout<<GridLogMessage <<"OverlapWilsonContFracZolotarevFermion test"<<std::endl;
OverlapWilsonContFracZolotarevFermionR Dcfz(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,0.1,6.0);
TestCGinversions<OverlapWilsonContFracZolotarevFermionR>(Dcfz,FGrid,FrbGrid,UGrid,UrbGrid,mass,M5,&RNG4,&RNG5);
OverlapWilsonContFracZolotarevFermionD Dcfz(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,0.1,6.0);
TestCGinversions<OverlapWilsonContFracZolotarevFermionD>(Dcfz,FGrid,FrbGrid,UGrid,UrbGrid,mass,M5,&RNG4,&RNG5);
std::cout<<GridLogMessage <<"OverlapWilsonPartialFractionTanhFermion test"<<std::endl;
OverlapWilsonPartialFractionTanhFermionR Dpf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,1.0);
TestCGinversions<OverlapWilsonPartialFractionTanhFermionR>(Dpf,FGrid,FrbGrid,UGrid,UrbGrid,mass,M5,&RNG4,&RNG5);
OverlapWilsonPartialFractionTanhFermionD Dpf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,1.0);
TestCGinversions<OverlapWilsonPartialFractionTanhFermionD>(Dpf,FGrid,FrbGrid,UGrid,UrbGrid,mass,M5,&RNG4,&RNG5);
std::cout<<GridLogMessage <<"OverlapWilsonPartialFractionZolotarevFermion test"<<std::endl;
OverlapWilsonPartialFractionZolotarevFermionR Dpfz(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,0.1,6.0);
TestCGinversions<OverlapWilsonPartialFractionZolotarevFermionR>(Dpfz,FGrid,FrbGrid,UGrid,UrbGrid,mass,M5,&RNG4,&RNG5);
OverlapWilsonPartialFractionZolotarevFermionD Dpfz(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5,0.1,6.0);
TestCGinversions<OverlapWilsonPartialFractionZolotarevFermionD>(Dpfz,FGrid,FrbGrid,UGrid,UrbGrid,mass,M5,&RNG4,&RNG5);
Grid_finalize();

View File

@ -79,7 +79,7 @@ int main(int argc, char** argv) {
RealD mass = 0.01;
RealD M5 = 1.8;
DomainWallFermionR Ddwf(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mass, M5);
DomainWallFermionD Ddwf(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mass, M5);
LatticeFermion src_o(FrbGrid);
LatticeFermion result_o(FrbGrid);
@ -88,7 +88,7 @@ int main(int argc, char** argv) {
GridStopWatch CGTimer;
SchurDiagMooeeOperator<DomainWallFermionR, LatticeFermion> HermOpEO(Ddwf);
SchurDiagMooeeOperator<DomainWallFermionD, LatticeFermion> HermOpEO(Ddwf);
ConjugateGradient<LatticeFermion> CG(1.0e-5, 10000, 0);// switch off the assert
CGTimer.Start();
@ -98,8 +98,5 @@ int main(int argc, char** argv) {
std::cout << GridLogMessage << "Total CG time : " << CGTimer.Elapsed()
<< std::endl;
std::cout << GridLogMessage << "######## Dhop calls summary" << std::endl;
Ddwf.Report();
Grid_finalize();
}

View File

@ -70,7 +70,7 @@ int main (int argc, char ** argv)
RealD mass=0.1;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
ConjugateGradient<LatticeFermion> CG(1.0e-8,10000);
SchurRedBlackDiagMooeeSolve<LatticeFermion> SchurSolver(CG);

View File

@ -70,9 +70,9 @@ int main (int argc, char ** argv)
RealD mass=0.1;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> HermOp(Ddwf);
ConjugateGradient<LatticeFermion> CG(1.0e-6,10000);
CG(HermOp,src,result);

View File

@ -77,12 +77,12 @@ int main (int argc, char ** argv)
RealD mass=0.5;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> HermOp(Ddwf);
MCR(HermOp,src,result);
Gamma5R5HermitianLinearOperator<DomainWallFermionR,LatticeFermion> g5HermOp(Ddwf);
Gamma5R5HermitianLinearOperator<DomainWallFermionD,LatticeFermion> g5HermOp(Ddwf);
MCR(g5HermOp,src,result);

View File

@ -77,12 +77,12 @@ int main (int argc, char ** argv)
RealD mass=0.5;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
std::cout<<GridLogMessage<<"*********************************************************"<<std::endl;
std::cout<<GridLogMessage<<"* Solving with MdagM VPGCR "<<std::endl;
std::cout<<GridLogMessage<<"*********************************************************"<<std::endl;
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> HermOp(Ddwf);
TrivialPrecon<LatticeFermion> simple;
PrecGeneralisedConjugateResidual<LatticeFermion> PGCR(1.0e-6,10000,HermOp,simple,4,160);
@ -92,7 +92,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage<<"*********************************************************"<<std::endl;
std::cout<<GridLogMessage<<"* Solving with g5-VPGCR "<<std::endl;
std::cout<<GridLogMessage<<"*********************************************************"<<std::endl;
Gamma5R5HermitianLinearOperator<DomainWallFermionR,LatticeFermion> g5HermOp(Ddwf);
Gamma5R5HermitianLinearOperator<DomainWallFermionD,LatticeFermion> g5HermOp(Ddwf);
PrecGeneralisedConjugateResidual<LatticeFermion> PGCR5(1.0e-6,10000,g5HermOp,simple,4,160);
result=Zero();
PGCR5(src,result);

View File

@ -55,6 +55,7 @@ RealD InverseApproximation(RealD x){
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & _SmootherMatrix;
FineOperator & _SmootherOperator;
@ -78,6 +79,7 @@ public:
template<class Field,class Matrix> class MirsSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & SmootherMatrix;
FineOperator & SmootherOperator;
@ -108,6 +110,7 @@ public:
template<class Fobj,class CComplex,int nbasis, class Matrix, class Guesser, class CoarseSolver>
class MultiGridPreconditioner : public LinearFunction< Lattice<Fobj> > {
public:
using LinearFunction<Lattice<Fobj> >::operator();
typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
@ -251,7 +254,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
RealD mass=0.001;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
typedef Aggregation<vSpinColourVector,vTComplex,nbasis> Subspace;
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> CoarseOperator;
@ -260,7 +263,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Calling Aggregation class to build subspace" <<std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> HermDefOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> HermDefOp(Ddwf);
Subspace Aggregates(Coarse5d,FGrid,0);
@ -287,7 +290,7 @@ int main (int argc, char ** argv)
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> Level1Op;
typedef CoarsenedMatrix<siteVector,iScalar<vTComplex>,nbasisc> Level2Op;
Gamma5R5HermitianLinearOperator<DomainWallFermionR,LatticeFermion> HermIndefOp(Ddwf);
Gamma5R5HermitianLinearOperator<DomainWallFermionD,LatticeFermion> HermIndefOp(Ddwf);
Level1Op LDOp(*Coarse5d,*Coarse5dRB,1); LDOp.CoarsenOperator(FGrid,HermIndefOp,Aggregates);
@ -348,16 +351,16 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Building 3 level Multigrid "<< std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionR,DeflatedGuesser<CoarseVector> , NormalEquations<CoarseVector> > TwoLevelMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionD,DeflatedGuesser<CoarseVector> , NormalEquations<CoarseVector> > TwoLevelMG;
typedef MultiGridPreconditioner<siteVector,iScalar<vTComplex>,nbasisc,Level1Op, DeflatedGuesser<CoarseCoarseVector>, NormalEquations<CoarseCoarseVector> > CoarseMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionR,ZeroGuesser<CoarseVector>, LinearFunction<CoarseVector> > ThreeLevelMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionD,ZeroGuesser<CoarseVector>, LinearFunction<CoarseVector> > ThreeLevelMG;
// MultiGrid preconditioner acting on the coarse space <-> coarsecoarse space
ChebyshevSmoother<CoarseVector, Level1Op > CoarseSmoother(0.1,12.0,3,L1LinOp,LDOp);
ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(0.5,60.0,10,HermIndefOp,Ddwf);
ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(0.5,60.0,10,HermIndefOp,Ddwf);
// MirsSmoother<CoarseVector, Level1Op > CoarseCGSmoother(0.1,0.1,4,L1LinOp,LDOp);
// MirsSmoother<LatticeFermion,DomainWallFermionR> FineCGSmoother(0.0,0.01,8,HermIndefOp,Ddwf);
// MirsSmoother<LatticeFermion,DomainWallFermionD> FineCGSmoother(0.0,0.01,8,HermIndefOp,Ddwf);
CoarseMG Level2Precon (CoarseAggregates, L2Op,
L1LinOp,LDOp,

View File

@ -56,9 +56,9 @@ template<class Field> class SolverWrapper : public LinearFunction<Field> {
private:
CheckerBoardedSparseMatrixBase<Field> & _Matrix;
SchurRedBlackBase<Field> & _Solver;
public:
/////////////////////////////////////////////////////
public:
using LinearFunction<Field>::operator();
/////////////////////////////////////////////////////
// Wrap the usual normal equations trick
/////////////////////////////////////////////////////
SolverWrapper(CheckerBoardedSparseMatrixBase<Field> &Matrix,
@ -75,6 +75,7 @@ public:
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & _SmootherMatrix;
FineOperator & _SmootherOperator;
@ -98,6 +99,7 @@ public:
template<class Field,class Matrix> class MirsSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & SmootherMatrix;
FineOperator & SmootherOperator;
@ -128,6 +130,7 @@ public:
template<class Fobj,class CComplex,int nbasis, class Matrix, class Guesser, class CoarseSolver>
class MultiGridPreconditioner : public LinearFunction< Lattice<Fobj> > {
public:
using LinearFunction<Lattice<Fobj> >::operator();
typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
@ -265,7 +268,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
RealD mass=0.001;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
typedef Aggregation<vSpinColourVector,vTComplex,nbasis> Subspace;
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> CoarseOperator;
@ -274,7 +277,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Calling Aggregation class to build subspace" <<std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> HermDefOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> HermDefOp(Ddwf);
Subspace Aggregates(Coarse5d,FGrid,0);
@ -308,7 +311,7 @@ int main (int argc, char ** argv)
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> Level1Op;
typedef CoarsenedMatrix<siteVector,iScalar<vTComplex>,nbasisc> Level2Op;
Gamma5R5HermitianLinearOperator<DomainWallFermionR,LatticeFermion> HermIndefOp(Ddwf);
Gamma5R5HermitianLinearOperator<DomainWallFermionD,LatticeFermion> HermIndefOp(Ddwf);
GridRedBlackCartesian * Coarse4dRB = SpaceTimeGrid::makeFourDimRedBlackGrid(Coarse4d);
@ -335,11 +338,11 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "Building 3 level Multigrid "<< std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionR,ZeroGuesser<CoarseVector> , SolverWrapper<CoarseVector> > TwoLevelMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionD,ZeroGuesser<CoarseVector> , SolverWrapper<CoarseVector> > TwoLevelMG;
typedef MultiGridPreconditioner<siteVector,iScalar<vTComplex>,nbasisc,Level1Op, DeflatedGuesser<CoarseCoarseVector>, NormalEquations<CoarseCoarseVector> > CoarseMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionR,ZeroGuesser<CoarseVector>, LinearFunction<CoarseVector> > ThreeLevelMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionD,ZeroGuesser<CoarseVector>, LinearFunction<CoarseVector> > ThreeLevelMG;
ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(0.5,60.0,12,HermIndefOp,Ddwf);
ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(0.5,60.0,12,HermIndefOp,Ddwf);
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Calling 2 level Multigrid "<< std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
@ -379,7 +382,7 @@ int main (int argc, char ** argv)
LatticeFermion result_o(FrbGrid);
pickCheckerboard(Odd,src_o,src);
result_o=Zero();
SchurDiagMooeeOperator<DomainWallFermionR,LatticeFermion> HermOpEO(Ddwf);
SchurDiagMooeeOperator<DomainWallFermionD,LatticeFermion> HermOpEO(Ddwf);
// pCG(HermOpEO,src_o,result_o);
std::cout<<GridLogMessage << "**************************************************"<< std::endl;

View File

@ -55,6 +55,7 @@ RealD InverseApproximation(RealD x){
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & _SmootherMatrix;
FineOperator & _SmootherOperator;
@ -78,6 +79,7 @@ public:
template<class Field,class Matrix> class MirsSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & SmootherMatrix;
FineOperator & SmootherOperator;
@ -108,6 +110,8 @@ public:
template<class Fobj,class CComplex,int nbasis, class Matrix, class Guesser, class CoarseSolver>
class MultiGridPreconditioner : public LinearFunction< Lattice<Fobj> > {
public:
using LinearFunction<Lattice<Fobj> >::operator();
typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
@ -246,7 +250,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
RealD mass=0.00078;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
typedef Aggregation<vSpinColourVector,vTComplex,nbasis> Subspace;
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> CoarseOperator;
@ -255,7 +259,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Calling Aggregation class to build subspace" <<std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> HermDefOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> HermDefOp(Ddwf);
Subspace Aggregates(Coarse5d,FGrid,0);
@ -288,7 +292,7 @@ int main (int argc, char ** argv)
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> Level1Op;
typedef CoarsenedMatrix<siteVector,iScalar<vTComplex>,nbasisc> Level2Op;
Gamma5R5HermitianLinearOperator<DomainWallFermionR,LatticeFermion> HermIndefOp(Ddwf);
Gamma5R5HermitianLinearOperator<DomainWallFermionD,LatticeFermion> HermIndefOp(Ddwf);
GridRedBlackCartesian * Coarse4dRB = SpaceTimeGrid::makeFourDimRedBlackGrid(Coarse4d);
@ -387,18 +391,18 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Building 3 level Multigrid "<< std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
// typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionR,DeflatedGuesser<CoarseVector> , NormalEquations<CoarseVector> > TwoLevelMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionR,ZeroGuesser<CoarseVector> , NormalEquations<CoarseVector> > TwoLevelMG;
// typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionD,DeflatedGuesser<CoarseVector> , NormalEquations<CoarseVector> > TwoLevelMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionD,ZeroGuesser<CoarseVector> , NormalEquations<CoarseVector> > TwoLevelMG;
typedef MultiGridPreconditioner<siteVector,iScalar<vTComplex>,nbasisc,Level1Op, DeflatedGuesser<CoarseCoarseVector>, NormalEquations<CoarseCoarseVector> > CoarseMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionR,ZeroGuesser<CoarseVector>, LinearFunction<CoarseVector> > ThreeLevelMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionD,ZeroGuesser<CoarseVector>, LinearFunction<CoarseVector> > ThreeLevelMG;
ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(0.25,60.0,12,HermIndefOp,Ddwf);
ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(0.25,60.0,12,HermIndefOp,Ddwf);
/*
// MultiGrid preconditioner acting on the coarse space <-> coarsecoarse space
ChebyshevSmoother<CoarseVector, Level1Op > CoarseSmoother(0.1,15.0,3,L1LinOp,LDOp);
// MirsSmoother<CoarseVector, Level1Op > CoarseCGSmoother(0.1,0.1,4,L1LinOp,LDOp);
// MirsSmoother<LatticeFermion,DomainWallFermionR> FineCGSmoother(0.0,0.01,8,HermIndefOp,Ddwf);
// MirsSmoother<LatticeFermion,DomainWallFermionD> FineCGSmoother(0.0,0.01,8,HermIndefOp,Ddwf);
CoarseMG Level2Precon (CoarseAggregates, L2Op,
L1LinOp,LDOp,
@ -459,7 +463,7 @@ int main (int argc, char ** argv)
LatticeFermion result_o(FrbGrid);
pickCheckerboard(Odd,src_o,src);
result_o=Zero();
SchurDiagMooeeOperator<DomainWallFermionR,LatticeFermion> HermOpEO(Ddwf);
SchurDiagMooeeOperator<DomainWallFermionD,LatticeFermion> HermOpEO(Ddwf);
// pCG(HermOpEO,src_o,result_o);
std::cout<<GridLogMessage << "**************************************************"<< std::endl;

View File

@ -56,6 +56,7 @@ RealD InverseApproximation(RealD x){
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & _SmootherMatrix;
FineOperator & _SmootherOperator;
@ -79,6 +80,7 @@ public:
template<class Field,class Matrix> class MirsSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & SmootherMatrix;
FineOperator & SmootherOperator;
@ -108,6 +110,7 @@ public:
template<class Field,class Matrix> class RedBlackSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & SmootherMatrix;
RealD tol;
@ -134,6 +137,7 @@ public:
template<class Fobj,class CComplex,int nbasis, class Matrix, class Guesser, class CoarseSolver>
class MultiGridPreconditioner : public LinearFunction< Lattice<Fobj> > {
public:
using LinearFunction<Lattice<Fobj> >::operator();
typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
@ -241,7 +245,7 @@ int main (int argc, char ** argv)
Grid_init(&argc,&argv);
const int Ls=16;
const int rLs=8;
// const int rLs=8;
GridCartesian * UGrid = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplex::Nsimd()),GridDefaultMpi());
GridRedBlackCartesian * UrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid);
@ -284,7 +288,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
RealD mass=0.001;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
typedef Aggregation<vSpinColourVector,vTComplex,nbasis> Subspace;
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> CoarseOperator;
@ -293,7 +297,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Calling Aggregation class to build subspace" <<std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> HermDefOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> HermDefOp(Ddwf);
Subspace Aggregates(Coarse5d,FGrid,0);
@ -328,7 +332,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> Level1Op;
Gamma5R5HermitianLinearOperator<DomainWallFermionR,LatticeFermion> HermIndefOp(Ddwf);
Gamma5R5HermitianLinearOperator<DomainWallFermionD,LatticeFermion> HermIndefOp(Ddwf);
Level1Op LDOp(*Coarse5d,*Coarse5dRB,1); LDOp.CoarsenOperator(FGrid,HermIndefOp,Aggregates);
@ -371,24 +375,24 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Building 2 level Multigrid "<< std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionR,DeflatedGuesser<CoarseVector> , NormalEquations<CoarseVector> > TwoLevelMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionD,DeflatedGuesser<CoarseVector> , NormalEquations<CoarseVector> > TwoLevelMG;
// MultiGrid preconditioner acting on the coarse space <-> coarsecoarse space
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(0.5,60.0,14,HermIndefOp,Ddwf); // 72 iter 63s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(0.1,60.0,20,HermIndefOp,Ddwf); // 66 iter 69s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(0.5,60.0,20,HermIndefOp,Ddwf); // 63 iter 65 s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(1.0,60.0,20,HermIndefOp,Ddwf); // 69, 70
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(1.0,60.0,14,HermIndefOp,Ddwf); // 77
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(0.5,60.0,14,HermIndefOp,Ddwf); // 72 iter 63s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(0.1,60.0,20,HermIndefOp,Ddwf); // 66 iter 69s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(0.5,60.0,20,HermIndefOp,Ddwf); // 63 iter 65 s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(1.0,60.0,20,HermIndefOp,Ddwf); // 69, 70
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(1.0,60.0,14,HermIndefOp,Ddwf); // 77
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(0.5,60.0,10,HermIndefOp,Ddwf); // 23 iter 15.9s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(0.5,60.0,14,HermIndefOp,Ddwf); // 20, 16.9s
ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(0.5,60.0,12,HermIndefOp,Ddwf); // 21, 15.6s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(0.5,60.0,10,HermIndefOp,Ddwf); // 23 iter 15.9s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(0.5,60.0,14,HermIndefOp,Ddwf); // 20, 16.9s
ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(0.5,60.0,12,HermIndefOp,Ddwf); // 21, 15.6s
// MirsSmoother<LatticeFermion,DomainWallFermionR> FineCGSmoother(0.05,0.01,20,HermIndefOp,Ddwf);
// RedBlackSmoother<LatticeFermion,DomainWallFermionR> FineRBSmoother(0.00,0.001,100,Ddwf);
// MirsSmoother<LatticeFermion,DomainWallFermionD> FineCGSmoother(0.05,0.01,20,HermIndefOp,Ddwf);
// RedBlackSmoother<LatticeFermion,DomainWallFermionD> FineRBSmoother(0.00,0.001,100,Ddwf);
// Wrap the 2nd level solver in a MultiGrid preconditioner acting on the fine space
ZeroGuesser<CoarseVector> CoarseZeroGuesser;
// ZeroGuesser<CoarseVector> CoarseZeroGuesser;
TwoLevelMG TwoLevelPrecon(Aggregates, LDOp,
HermIndefOp,Ddwf,
FineSmoother,
@ -412,7 +416,7 @@ int main (int argc, char ** argv)
ConjugateGradient<LatticeFermion> FineCG(1.0e-8,10000);
SchurDiagMooeeOperator<DomainWallFermionR,LatticeFermion> FineDiagMooee(Ddwf); // M_ee - Meo Moo^-1 Moe
SchurDiagMooeeOperator<DomainWallFermionD,LatticeFermion> FineDiagMooee(Ddwf); // M_ee - Meo Moo^-1 Moe
LatticeFermion f_src_e(FrbGrid); f_src_e=1.0;
LatticeFermion f_res_e(FrbGrid); f_res_e=Zero();
FineCG(FineDiagMooee,f_src_e,f_res_e);

View File

@ -57,7 +57,7 @@ private:
CheckerBoardedSparseMatrixBase<Field> & _Matrix;
SchurRedBlackBase<Field> & _Solver;
public:
using LinearFunction<Field>::operator();
/////////////////////////////////////////////////////
// Wrap the usual normal equations trick
/////////////////////////////////////////////////////
@ -75,6 +75,7 @@ public:
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & _SmootherMatrix;
FineOperator & _SmootherOperator;
@ -98,6 +99,7 @@ public:
template<class Field,class Matrix> class MirsSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & SmootherMatrix;
FineOperator & SmootherOperator;
@ -128,6 +130,7 @@ public:
template<class Fobj,class CComplex,int nbasis, class Matrix, class Guesser, class CoarseSolver>
class MultiGridPreconditioner : public LinearFunction< Lattice<Fobj> > {
public:
using LinearFunction<Lattice<Fobj> >::operator();
typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
@ -261,7 +264,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
RealD mass=0.00078;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
typedef Aggregation<vSpinColourVector,vTComplex,nbasis> Subspace;
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> CoarseOperator;
@ -270,7 +273,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Calling Aggregation class to build subspace" <<std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> HermDefOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> HermDefOp(Ddwf);
Subspace Aggregates(Coarse5d,FGrid,0);
@ -303,7 +306,7 @@ int main (int argc, char ** argv)
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> Level1Op;
typedef CoarsenedMatrix<siteVector,iScalar<vTComplex>,nbasisc> Level2Op;
Gamma5R5HermitianLinearOperator<DomainWallFermionR,LatticeFermion> HermIndefOp(Ddwf);
Gamma5R5HermitianLinearOperator<DomainWallFermionD,LatticeFermion> HermIndefOp(Ddwf);
GridRedBlackCartesian * Coarse4dRB = SpaceTimeGrid::makeFourDimRedBlackGrid(Coarse4d);
@ -329,9 +332,9 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "Building 3 level Multigrid "<< std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionR,ZeroGuesser<CoarseVector> , SolverWrapper<CoarseVector> > TwoLevelMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionD,ZeroGuesser<CoarseVector> , SolverWrapper<CoarseVector> > TwoLevelMG;
typedef MultiGridPreconditioner<siteVector,iScalar<vTComplex>,nbasisc,Level1Op, DeflatedGuesser<CoarseCoarseVector>, NormalEquations<CoarseCoarseVector> > CoarseMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionR,ZeroGuesser<CoarseVector>, LinearFunction<CoarseVector> > ThreeLevelMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionD,ZeroGuesser<CoarseVector>, LinearFunction<CoarseVector> > ThreeLevelMG;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Calling 2 level Multigrid "<< std::endl;
@ -346,7 +349,7 @@ int main (int argc, char ** argv)
result=Zero();
std::cout << GridLogMessage <<" tol " << tols[t] << " cheby order " <<ords[o]<< " lo "<<los[l] <<std::endl;
ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(los[l],60.0,ords[o],HermIndefOp,Ddwf);
ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(los[l],60.0,ords[o],HermIndefOp,Ddwf);
ZeroGuesser<CoarseVector> CoarseZeroGuesser;
ConjugateGradient<CoarseVector> CoarseCG(tols[t],10000);
SchurRedBlackDiagMooeeSolve<CoarseVector> CoarseRBCG(CoarseCG);
@ -373,7 +376,7 @@ int main (int argc, char ** argv)
LatticeFermion result_o(FrbGrid);
pickCheckerboard(Odd,src_o,src);
result_o=Zero();
SchurDiagMooeeOperator<DomainWallFermionR,LatticeFermion> HermOpEO(Ddwf);
SchurDiagMooeeOperator<DomainWallFermionD,LatticeFermion> HermOpEO(Ddwf);
pCG(HermOpEO,src_o,result_o);
std::cout<<GridLogMessage << "**************************************************"<< std::endl;

View File

@ -55,6 +55,7 @@ RealD InverseApproximation(RealD x){
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & _SmootherMatrix;
FineOperator & _SmootherOperator;
@ -78,6 +79,7 @@ public:
template<class Field,class Matrix> class MirsSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & SmootherMatrix;
FineOperator & SmootherOperator;
@ -108,6 +110,7 @@ public:
template<class Fobj,class CComplex,int nbasis, class Matrix, class Guesser, class CoarseSolver>
class MultiGridPreconditioner : public LinearFunction< Lattice<Fobj> > {
public:
using LinearFunction<Lattice<Fobj> >::operator();
typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
@ -245,7 +248,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
RealD mass=0.00078;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
typedef Aggregation<vSpinColourVector,vTComplex,nbasis> Subspace;
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> CoarseOperator;
@ -254,7 +257,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Calling Aggregation class to build subspace" <<std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> HermDefOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> HermDefOp(Ddwf);
Subspace Aggregates(Coarse5d,FGrid,0);
@ -287,7 +290,7 @@ int main (int argc, char ** argv)
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> Level1Op;
typedef CoarsenedMatrix<siteVector,iScalar<vTComplex>,nbasisc> Level2Op;
Gamma5R5HermitianLinearOperator<DomainWallFermionR,LatticeFermion> HermIndefOp(Ddwf);
Gamma5R5HermitianLinearOperator<DomainWallFermionD,LatticeFermion> HermIndefOp(Ddwf);
GridRedBlackCartesian * Coarse4dRB = SpaceTimeGrid::makeFourDimRedBlackGrid(Coarse4d);
@ -383,18 +386,18 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Building 3 level Multigrid "<< std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
// typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionR,DeflatedGuesser<CoarseVector> , NormalEquations<CoarseVector> > TwoLevelMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionR,ZeroGuesser<CoarseVector> , NormalEquations<CoarseVector> > TwoLevelMG;
// typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionD,DeflatedGuesser<CoarseVector> , NormalEquations<CoarseVector> > TwoLevelMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionD,ZeroGuesser<CoarseVector> , NormalEquations<CoarseVector> > TwoLevelMG;
typedef MultiGridPreconditioner<siteVector,iScalar<vTComplex>,nbasisc,Level1Op, DeflatedGuesser<CoarseCoarseVector>, NormalEquations<CoarseCoarseVector> > CoarseMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionR,ZeroGuesser<CoarseVector>, LinearFunction<CoarseVector> > ThreeLevelMG;
typedef MultiGridPreconditioner<vSpinColourVector, vTComplex,nbasis, DomainWallFermionD,ZeroGuesser<CoarseVector>, LinearFunction<CoarseVector> > ThreeLevelMG;
ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(0.25,60.0,12,HermIndefOp,Ddwf);
ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(0.25,60.0,12,HermIndefOp,Ddwf);
/*
// MultiGrid preconditioner acting on the coarse space <-> coarsecoarse space
ChebyshevSmoother<CoarseVector, Level1Op > CoarseSmoother(0.1,15.0,3,L1LinOp,LDOp);
// MirsSmoother<CoarseVector, Level1Op > CoarseCGSmoother(0.1,0.1,4,L1LinOp,LDOp);
// MirsSmoother<LatticeFermion,DomainWallFermionR> FineCGSmoother(0.0,0.01,8,HermIndefOp,Ddwf);
// MirsSmoother<LatticeFermion,DomainWallFermionD> FineCGSmoother(0.0,0.01,8,HermIndefOp,Ddwf);
CoarseMG Level2Precon (CoarseAggregates, L2Op,
L1LinOp,LDOp,
@ -455,7 +458,7 @@ int main (int argc, char ** argv)
LatticeFermion result_o(FrbGrid);
pickCheckerboard(Odd,src_o,src);
result_o=Zero();
SchurDiagMooeeOperator<DomainWallFermionR,LatticeFermion> HermOpEO(Ddwf);
SchurDiagMooeeOperator<DomainWallFermionD,LatticeFermion> HermOpEO(Ddwf);
pCG(HermOpEO,src_o,result_o);
std::cout<<GridLogMessage << "**************************************************"<< std::endl;

View File

@ -0,0 +1,122 @@
/*************************************************************************************
Grid physics library, www.github.com/paboyle/Grid
Source file: ./tests/Test_dwf_cg_prec.cc
Copyright (C) 2015
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 */
#include <Grid/Grid.h>
//using namespace std;
using namespace Grid;
int main (int argc, char ** argv)
{
Grid_init(&argc,&argv);
const int Ls=12;
std::cout << GridLogMessage << "::::: NB: to enable a quick bit reproducibility check use the --checksums flag. " << std::endl;
GridCartesian * UGrid = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplexD::Nsimd()),GridDefaultMpi());
GridRedBlackCartesian * UrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid);
GridCartesian * FGrid = SpaceTimeGrid::makeFiveDimGrid(Ls,UGrid);
GridRedBlackCartesian * FrbGrid = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls,UGrid);
GridCartesian * UGrid_f = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplexF::Nsimd()),GridDefaultMpi());
GridRedBlackCartesian * UrbGrid_f = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid_f);
GridCartesian * FGrid_f = SpaceTimeGrid::makeFiveDimGrid(Ls,UGrid_f);
GridRedBlackCartesian * FrbGrid_f = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls,UGrid_f);
std::vector<int> seeds4({1,2,3,4});
std::vector<int> seeds5({5,6,7,8});
GridParallelRNG RNG5(FGrid); RNG5.SeedFixedIntegers(seeds5);
GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4);
LatticeFermionD src(FGrid); random(RNG5,src);
LatticeFermionD result(FGrid); result=Zero();
LatticeGaugeFieldD Umu(UGrid);
LatticeGaugeFieldF Umu_f(UGrid_f);
SU<Nc>::HotConfiguration(RNG4,Umu);
precisionChange(Umu_f,Umu);
RealD mass=0.1;
RealD M5=1.8;
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionF Ddwf_f(Umu_f,*FGrid_f,*FrbGrid_f,*UGrid_f,*UrbGrid_f,mass,M5);
LatticeFermionD src_o(FrbGrid);
LatticeFermionD result_o(FrbGrid);
LatticeFermionD result_o_2(FrbGrid);
pickCheckerboard(Odd,src_o,src);
result_o.Checkerboard() = Odd;
result_o = Zero();
result_o_2.Checkerboard() = Odd;
result_o_2 = Zero();
SchurDiagMooeeOperator<DomainWallFermionD,LatticeFermionD> HermOpEO(Ddwf);
SchurDiagMooeeOperator<DomainWallFermionF,LatticeFermionF> HermOpEO_f(Ddwf_f);
std::cout << GridLogMessage << "::::::::::::: Starting mixed CG" << std::endl;
MixedPrecisionConjugateGradient<LatticeFermionD,LatticeFermionF> mCG(1.0e-8, 10000, 50, FrbGrid_f, HermOpEO_f, HermOpEO);
double t1,t2,flops;
double MdagMsiteflops = 1452; // Mobius (real coeffs)
// CG overhead: 8 inner product, 4+8 axpy_norm, 4+4 linear comb (2 of)
double CGsiteflops = (8+4+8+4+4)*Nc*Ns ;
std:: cout << " MdagM site flops = "<< 4*MdagMsiteflops<<std::endl;
std:: cout << " CG site flops = "<< CGsiteflops <<std::endl;
result_o = Zero();
t1=usecond();
mCG(src_o,result_o);
t2=usecond();
int iters = mCG.TotalInnerIterations; //Number of inner CG iterations
flops = MdagMsiteflops*4*FrbGrid->gSites()*iters;
flops+= CGsiteflops*FrbGrid->gSites()*iters;
std::cout << " SinglePrecision iterations/sec "<< iters/(t2-t1)*1000.*1000.<<std::endl;
std::cout << " SinglePrecision GF/s "<< flops/(t2-t1)/1000.<<std::endl;
std::cout << GridLogMessage << "::::::::::::: Starting regular CG" << std::endl;
ConjugateGradient<LatticeFermionD> CG(1.0e-8,10000);
result_o_2 = Zero();
t1=usecond();
CG(HermOpEO,src_o,result_o_2);
t2=usecond();
iters = CG.IterationsToComplete;
flops = MdagMsiteflops*4*FrbGrid->gSites()*iters;
flops+= CGsiteflops*FrbGrid->gSites()*iters;
std::cout << " DoublePrecision iterations/sec "<< iters/(t2-t1)*1000.*1000.<<std::endl;
std::cout << " DoublePrecision GF/s "<< flops/(t2-t1)/1000.<<std::endl;
LatticeFermionD diff_o(FrbGrid);
RealD diff = axpy_norm(diff_o, -1.0, result_o, result_o_2);
std::cout << GridLogMessage << "::::::::::::: Diff between mixed and regular CG: " << diff << std::endl;
MemoryManager::Print();
Grid_finalize();
}

View File

@ -34,9 +34,10 @@ using namespace Grid;
int main (int argc, char ** argv)
{
typedef typename DomainWallFermionR::FermionField FermionField;
typedef typename DomainWallFermionR::ComplexField ComplexField;
typename DomainWallFermionR::ImplParams params;
#ifdef HAVE_LIME
typedef typename DomainWallFermionD::FermionField FermionField;
typedef typename DomainWallFermionD::ComplexField ComplexField;
typename DomainWallFermionD::ImplParams params;
const int Ls=4;
@ -193,15 +194,15 @@ int main (int argc, char ** argv)
RealD mass=0.01;
RealD M5=1.8;
DomainWallFermionR Dchk(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5);
DomainWallFermionR Ddwf(s_Umu,*SFGrid,*SFrbGrid,*SGrid,*SrbGrid,mass,M5);
DomainWallFermionD Dchk(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5);
DomainWallFermionD Ddwf(s_Umu,*SFGrid,*SFrbGrid,*SGrid,*SrbGrid,mass,M5);
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
std::cout << GridLogMessage << " Calling DWF CG "<<std::endl;
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
MdagMLinearOperator<DomainWallFermionR,FermionField> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionR,FermionField> HermOpCk(Dchk);
MdagMLinearOperator<DomainWallFermionD,FermionField> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,FermionField> HermOpCk(Dchk);
ConjugateGradient<FermionField> CG((1.0e-5/(me+1)),10000);
s_res = Zero();
CG(HermOp,s_src,s_res);
@ -237,4 +238,5 @@ int main (int argc, char ** argv)
}
Grid_finalize();
#endif // HAVE_LIME
}

View File

@ -34,9 +34,9 @@ using namespace Grid;
int main (int argc, char ** argv)
{
typedef typename DomainWallFermionR::FermionField FermionField;
typedef typename DomainWallFermionR::ComplexField ComplexField;
typename DomainWallFermionR::ImplParams params;
typedef typename DomainWallFermionD::FermionField FermionField;
typedef typename DomainWallFermionD::ComplexField ComplexField;
typename DomainWallFermionD::ImplParams params;
double stp=1.0e-5;
const int Ls=4;
@ -189,15 +189,15 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << " Building the solvers"<<std::endl;
RealD mass=0.01;
RealD M5=1.8;
DomainWallFermionR Dchk(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5);
DomainWallFermionR Ddwf(s_Umu,*SFGrid,*SFrbGrid,*SGrid,*SrbGrid,mass,M5);
DomainWallFermionD Dchk(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5);
DomainWallFermionD Ddwf(s_Umu,*SFGrid,*SFrbGrid,*SGrid,*SrbGrid,mass,M5);
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
std::cout << GridLogMessage << " Calling DWF CG "<<std::endl;
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
MdagMLinearOperator<DomainWallFermionR,FermionField> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionR,FermionField> HermOpCk(Dchk);
MdagMLinearOperator<DomainWallFermionD,FermionField> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,FermionField> HermOpCk(Dchk);
ConjugateGradient<FermionField> CG((stp),10000);
s_res = Zero();
CG(HermOp,s_src,s_res);

View File

@ -34,9 +34,9 @@ using namespace Grid;
int main (int argc, char ** argv)
{
typedef typename DomainWallFermionR::FermionField FermionField;
typedef typename DomainWallFermionR::ComplexField ComplexField;
typename DomainWallFermionR::ImplParams params;
typedef typename DomainWallFermionD::FermionField FermionField;
typedef typename DomainWallFermionD::ComplexField ComplexField;
typename DomainWallFermionD::ImplParams params;
const int Ls=4;
@ -124,15 +124,15 @@ int main (int argc, char ** argv)
///////////////////////////////////////////////////////////////
RealD mass=0.01;
RealD M5=1.8;
DomainWallFermionR Dchk(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5);
DomainWallFermionR Ddwf(s_Umu,*SFGrid,*SFrbGrid,*SGrid,*SrbGrid,mass,M5);
DomainWallFermionD Dchk(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5);
DomainWallFermionD Ddwf(s_Umu,*SFGrid,*SFrbGrid,*SGrid,*SrbGrid,mass,M5);
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
std::cout << GridLogMessage << " Calling DWF CG "<<std::endl;
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
MdagMLinearOperator<DomainWallFermionR,FermionField> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionR,FermionField> HermOpCk(Dchk);
MdagMLinearOperator<DomainWallFermionD,FermionField> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,FermionField> HermOpCk(Dchk);
ConjugateGradient<FermionField> CG((1.0e-8/(me+1)),10000);
s_res = Zero();
CG(HermOp,s_src,s_res);

View File

@ -57,6 +57,7 @@ private:
OperatorFunction<Field> & _Solver;
LinearFunction<Field> & _Guess;
public:
using LinearFunction<Field>::operator();
/////////////////////////////////////////////////////
// Wrap the usual normal equations trick
@ -118,6 +119,7 @@ RealD InverseApproximation(RealD x){
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & _SmootherMatrix;
FineOperator & _SmootherOperator;
@ -174,6 +176,7 @@ public:
template<class Fobj,class CComplex,int nbasis, class CoarseSolver>
class HDCRPreconditioner : public LinearFunction< Lattice<Fobj> > {
public:
using LinearFunction<Lattice<Fobj> >::operator();
typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
@ -394,8 +397,8 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
RealD mass=0.001;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionR Dpv (Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,1.0,M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Dpv (Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,1.0,M5);
typedef Aggregation<vSpinColourVector,vTComplex,nbasis> Subspace;
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> CoarseOperator;
@ -404,7 +407,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Calling Aggregation class to build subspace" <<std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> HermDefOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> HermDefOp(Ddwf);
Subspace Aggregates(Coarse5d,FGrid,0);
@ -432,8 +435,8 @@ int main (int argc, char ** argv)
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> Level1Op;
typedef CoarsenedMatrix<siteVector,iScalar<vTComplex>,nbasisc> Level2Op;
Gamma5R5HermitianLinearOperator<DomainWallFermionR,LatticeFermion> HermIndefOp(Ddwf);
Gamma5R5HermitianLinearOperator<DomainWallFermionR,LatticeFermion> HermIndefOpPV(Dpv);
Gamma5R5HermitianLinearOperator<DomainWallFermionD,LatticeFermion> HermIndefOp(Ddwf);
Gamma5R5HermitianLinearOperator<DomainWallFermionD,LatticeFermion> HermIndefOpPV(Dpv);
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Building coarse representation of Indef operator" <<std::endl;
@ -467,10 +470,10 @@ int main (int argc, char ** argv)
ConjugateGradient<LatticeFermion> FineCG(tol,MaxIt);
// GeneralisedMinimalResidual<LatticeFermion> FineGMRES(tol,MaxIt,20);
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> FineMdagM(Ddwf); // M^\dag M
PVdagMLinearOperator<DomainWallFermionR,LatticeFermion> FinePVdagM(Ddwf,Dpv);// M_{pv}^\dag M
SchurDiagMooeeOperator<DomainWallFermionR,LatticeFermion> FineDiagMooee(Ddwf); // M_ee - Meo Moo^-1 Moe
SchurDiagOneOperator<DomainWallFermionR,LatticeFermion> FineDiagOne(Ddwf); // 1 - M_ee^{-1} Meo Moo^{-1} Moe e
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> FineMdagM(Ddwf); // M^\dag M
PVdagMLinearOperator<DomainWallFermionD,LatticeFermion> FinePVdagM(Ddwf,Dpv);// M_{pv}^\dag M
SchurDiagMooeeOperator<DomainWallFermionD,LatticeFermion> FineDiagMooee(Ddwf); // M_ee - Meo Moo^-1 Moe
SchurDiagOneOperator<DomainWallFermionD,LatticeFermion> FineDiagOne(Ddwf); // 1 - M_ee^{-1} Meo Moo^{-1} Moe e
MdagMLinearOperator<Level1Op,CoarseVector> CoarseMdagM(LDOp);
PVdagMLinearOperator<Level1Op,CoarseVector> CoarsePVdagM(LDOp,LDOpPV);
@ -549,7 +552,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
ConjugateGradient<CoarseVector> CoarseMgridCG(0.001,1000);
ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(0.5,60.0,10,HermIndefOp,Ddwf);
ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(0.5,60.0,10,HermIndefOp,Ddwf);
typedef HDCRPreconditioner<vSpinColourVector, vTComplex,nbasis, NormalEquations<CoarseVector> > TwoLevelHDCR;
TwoLevelHDCR TwoLevelPrecon(Aggregates,

View File

@ -0,0 +1,184 @@
/*************************************************************************************
Grid physics library, www.github.com/paboyle/Grid
Source file: ./tests/Test_dwf_multishift_mixedprec.cc
Copyright (C) 2015
Author: Christopher Kelly <ckelly@bnl.gov>
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 <Grid/Grid.h>
using namespace Grid;
template<typename SpeciesD, typename SpeciesF, typename GaugeStatisticsType>
void run_test(int argc, char ** argv, const typename SpeciesD::ImplParams &params){
const int Ls = 16;
GridCartesian* UGrid_d = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd, vComplexD::Nsimd()), GridDefaultMpi());
GridRedBlackCartesian* UrbGrid_d = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid_d);
GridCartesian* FGrid_d = SpaceTimeGrid::makeFiveDimGrid(Ls, UGrid_d);
GridRedBlackCartesian* FrbGrid_d = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls, UGrid_d);
GridCartesian* UGrid_f = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd, vComplexF::Nsimd()), GridDefaultMpi());
GridRedBlackCartesian* UrbGrid_f = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid_f);
GridCartesian* FGrid_f = SpaceTimeGrid::makeFiveDimGrid(Ls, UGrid_f);
GridRedBlackCartesian* FrbGrid_f = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls, UGrid_f);
typedef typename SpeciesD::FermionField FermionFieldD;
typedef typename SpeciesF::FermionField FermionFieldF;
std::vector<int> seeds4({1, 2, 3, 4});
std::vector<int> seeds5({5, 6, 7, 8});
GridParallelRNG RNG5(FGrid_d);
RNG5.SeedFixedIntegers(seeds5);
GridParallelRNG RNG4(UGrid_d);
RNG4.SeedFixedIntegers(seeds4);
FermionFieldD src_d(FGrid_d);
random(RNG5, src_d);
LatticeGaugeFieldD Umu_d(UGrid_d);
//CPS-created G-parity ensembles have a factor of 2 error in the plaquette that causes the read to fail unless we workaround it
bool gparity_plaquette_fix = false;
for(int i=1;i<argc;i++){
if(std::string(argv[i]) == "--gparity_plaquette_fix"){
gparity_plaquette_fix=true;
break;
}
}
bool cfg_loaded=false;
for(int i=1;i<argc;i++){
if(std::string(argv[i]) == "--load_config"){
assert(i != argc-1);
std::string file = argv[i+1];
NerscIO io;
FieldMetaData metadata;
if(gparity_plaquette_fix) NerscIO::exitOnReadPlaquetteMismatch() = false;
io.readConfiguration<GaugeStatisticsType>(Umu_d, metadata, file);
if(gparity_plaquette_fix){
metadata.plaquette *= 2.; //correct header value
//Get the true plaquette
FieldMetaData tmp;
GaugeStatisticsType gs; gs(Umu_d, tmp);
std::cout << "After correction: plaqs " << tmp.plaquette << " " << metadata.plaquette << std::endl;
assert(fabs(tmp.plaquette -metadata.plaquette ) < 1.0e-5 );
}
cfg_loaded=true;
break;
}
}
if(!cfg_loaded)
SU<Nc>::HotConfiguration(RNG4, Umu_d);
LatticeGaugeFieldF Umu_f(UGrid_f);
precisionChange(Umu_f, Umu_d);
std::cout << GridLogMessage << "Lattice dimensions: " << GridDefaultLatt() << " Ls: " << Ls << std::endl;
RealD mass = 0.01;
RealD M5 = 1.8;
SpeciesD Ddwf_d(Umu_d, *FGrid_d, *FrbGrid_d, *UGrid_d, *UrbGrid_d, mass, M5, params);
SpeciesF Ddwf_f(Umu_f, *FGrid_f, *FrbGrid_f, *UGrid_f, *UrbGrid_f, mass, M5, params);
FermionFieldD src_o_d(FrbGrid_d);
pickCheckerboard(Odd, src_o_d, src_d);
SchurDiagMooeeOperator<SpeciesD, FermionFieldD> HermOpEO_d(Ddwf_d);
SchurDiagMooeeOperator<SpeciesF, FermionFieldF> HermOpEO_f(Ddwf_f);
AlgRemez remez(1e-4, 64, 50);
int order = 15;
remez.generateApprox(order, 1, 2); //sqrt
MultiShiftFunction shifts(remez, 1e-10, false);
int relup_freq = 50;
double t1=usecond();
ConjugateGradientMultiShiftMixedPrec<FermionFieldD,FermionFieldF> mcg(10000, shifts, FrbGrid_f, HermOpEO_f, relup_freq);
std::vector<FermionFieldD> results_o_d(order, FrbGrid_d);
mcg(HermOpEO_d, src_o_d, results_o_d);
double t2=usecond();
//Crosscheck double and mixed prec results
ConjugateGradientMultiShift<FermionFieldD> dmcg(10000, shifts);
std::vector<FermionFieldD> results_o_d_2(order, FrbGrid_d);
dmcg(HermOpEO_d, src_o_d, results_o_d_2);
double t3=usecond();
std::cout << GridLogMessage << "Comparison of mixed prec results to double prec results |mixed - double|^2 :" << std::endl;
FermionFieldD tmp(FrbGrid_d);
for(int i=0;i<order;i++){
RealD ndiff = axpy_norm(tmp, -1., results_o_d[i], results_o_d_2[i]);
std::cout << i << " " << ndiff << std::endl;
}
std::cout<<GridLogMessage << "Mixed precision algorithm: Total usec = "<< (t2-t1)<<std::endl;
std::cout<<GridLogMessage << "Double precision algorithm: Total usec = "<< (t3-t2)<<std::endl;
}
int main (int argc, char ** argv)
{
Grid_init(&argc, &argv);
bool gparity = false;
int gpdir;
for(int i=1;i<argc;i++){
std::string arg(argv[i]);
if(arg == "--Gparity"){
assert(i!=argc-1);
gpdir = std::stoi(argv[i+1]);
assert(gpdir >= 0 && gpdir <= 2); //spatial!
gparity = true;
}
}
if(gparity){
std::cout << "Running test with G-parity BCs in " << gpdir << " direction" << std::endl;
GparityWilsonImplParams params;
params.twists[gpdir] = 1;
std::vector<int> conj_dirs(Nd,0);
conj_dirs[gpdir] = 1;
ConjugateGimplD::setDirections(conj_dirs);
run_test<GparityDomainWallFermionD, GparityDomainWallFermionF, ConjugateGaugeStatistics>(argc,argv,params);
}else{
std::cout << "Running test with periodic BCs" << std::endl;
WilsonImplParams params;
run_test<DomainWallFermionD, DomainWallFermionF, PeriodicGaugeStatistics>(argc,argv,params);
}
Grid_finalize();
}

View File

@ -66,17 +66,17 @@ int main (int argc, char ** argv)
RealD mass=0.0;
RealD M5=-1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
Gamma5R5HermitianLinearOperator<DomainWallFermionR,LatticeFermion> g5HermOp(Ddwf);
Gamma5R5HermitianLinearOperator<DomainWallFermionD,LatticeFermion> g5HermOp(Ddwf);
QMR(g5HermOp,src,result);
GMR(g5HermOp,src,result);
NonHermitianLinearOperator<DomainWallFermionR,LatticeFermion> NonHermOp(Ddwf);
NonHermitianLinearOperator<DomainWallFermionD,LatticeFermion> NonHermOp(Ddwf);
QMR(NonHermOp,src,result);
GMR(NonHermOp,src,result);
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> HermOp(Ddwf);
ConjugateGradient<LatticeFermion> CG(1.0e-8,10000);
CG(HermOp,src,result);

View File

@ -0,0 +1,143 @@
/*************************************************************************************
Grid physics library, www.github.com/paboyle/Grid
Source file: ./tests/solver/Test_dwf_relupcg_prec.cc
Copyright (C) 2015
Author: Christopher Kelly <ckelly@bnl.gov>
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 */
#include <Grid/Grid.h>
using namespace std;
using namespace Grid;
int main (int argc, char ** argv)
{
Grid_init(&argc,&argv);
double relup_delta = 0.2;
for(int i=1;i<argc-1;i++){
std::string sarg = argv[i];
if(sarg == "--relup_delta"){
std::stringstream ss; ss << argv[i+1]; ss >> relup_delta;
std::cout << GridLogMessage << "Set reliable update Delta to " << relup_delta << std::endl;
}
}
const int Ls=12;
{
GridCartesian * UGrid = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplexD::Nsimd()),GridDefaultMpi());
GridRedBlackCartesian * UrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid);
GridCartesian * FGrid = SpaceTimeGrid::makeFiveDimGrid(Ls,UGrid);
GridRedBlackCartesian * FrbGrid = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls,UGrid);
GridCartesian * UGrid_f = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplexF::Nsimd()),GridDefaultMpi());
GridRedBlackCartesian * UrbGrid_f = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid_f);
GridCartesian * FGrid_f = SpaceTimeGrid::makeFiveDimGrid(Ls,UGrid_f);
GridRedBlackCartesian * FrbGrid_f = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls,UGrid_f);
std::vector<int> seeds4({1,2,3,4});
std::vector<int> seeds5({5,6,7,8});
GridParallelRNG RNG5(FGrid); RNG5.SeedFixedIntegers(seeds5);
GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4);
LatticeFermionD src(FGrid); random(RNG5,src);
LatticeFermionD result(FGrid); result=Zero();
LatticeGaugeFieldD Umu(UGrid);
LatticeGaugeFieldF Umu_f(UGrid_f);
SU<Nc>::HotConfiguration(RNG4,Umu);
precisionChange(Umu_f,Umu);
RealD mass=0.1;
RealD M5=1.8;
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionF Ddwf_f(Umu_f,*FGrid_f,*FrbGrid_f,*UGrid_f,*UrbGrid_f,mass,M5);
LatticeFermionD src_o(FrbGrid);
LatticeFermionD result_o(FrbGrid);
LatticeFermionD result_o_2(FrbGrid);
pickCheckerboard(Odd,src_o,src);
result_o.Checkerboard() = Odd;
result_o = Zero();
result_o_2.Checkerboard() = Odd;
result_o_2 = Zero();
SchurDiagMooeeOperator<DomainWallFermionD,LatticeFermionD> HermOpEO(Ddwf);
SchurDiagMooeeOperator<DomainWallFermionF,LatticeFermionF> HermOpEO_f(Ddwf_f);
std::cout << GridLogMessage << "::::::::::::: Starting mixed CG" << std::endl;
ConjugateGradientReliableUpdate<LatticeFermionD,LatticeFermionF> mCG(1e-8, 10000, relup_delta, FrbGrid_f, HermOpEO_f, HermOpEO);
double t1,t2,flops;
double MdagMsiteflops = 1452; // Mobius (real coeffs)
// CG overhead: 8 inner product, 4+8 axpy_norm, 4+4 linear comb (2 of)
double CGsiteflops = (8+4+8+4+4)*Nc*Ns ;
std:: cout << " MdagM site flops = "<< 4*MdagMsiteflops<<std::endl;
std:: cout << " CG site flops = "<< CGsiteflops <<std::endl;
int iters, iters_cleanup, relups, tot_iters;
for(int i=0;i<10;i++){
result_o = Zero();
t1=usecond();
mCG(src_o,result_o);
t2=usecond();
iters = mCG.IterationsToComplete; //Number of single prec CG iterations
iters_cleanup = mCG.IterationsToCleanup;
relups = mCG.ReliableUpdatesPerformed;
tot_iters = iters + iters_cleanup + relups; //relup cost MdagM application in double
flops = MdagMsiteflops*4*FrbGrid->gSites()*tot_iters;
flops+= CGsiteflops*FrbGrid->gSites()*tot_iters;
std::cout << " SinglePrecision single prec iterations/sec "<< iters/(t2-t1)*1000.*1000.<<std::endl;
std::cout << " SinglePrecision double prec cleanup iterations/sec "<< iters_cleanup/(t2-t1)*1000.*1000.<<std::endl;
std::cout << " SinglePrecision reliable updates/sec "<< relups/(t2-t1)*1000.*1000.<<std::endl;
std::cout << " SinglePrecision GF/s "<< flops/(t2-t1)/1000.<<std::endl;
}
std::cout << GridLogMessage << "::::::::::::: Starting regular CG" << std::endl;
ConjugateGradient<LatticeFermionD> CG(1.0e-8,10000);
for(int i=0;i<1;i++){
result_o_2 = Zero();
t1=usecond();
CG(HermOpEO,src_o,result_o_2);
t2=usecond();
iters = CG.IterationsToComplete;
flops = MdagMsiteflops*4*FrbGrid->gSites()*iters;
flops+= CGsiteflops*FrbGrid->gSites()*iters;
std::cout << " DoublePrecision iterations/sec "<< iters/(t2-t1)*1000.*1000.<<std::endl;
std::cout << " DoublePrecision GF/s "<< flops/(t2-t1)/1000.<<std::endl;
}
// MemoryManager::Print();
LatticeFermionD diff_o(FrbGrid);
RealD diff = axpy_norm(diff_o, -1.0, result_o, result_o_2);
std::cout << GridLogMessage << "::::::::::::: Diff between mixed and regular CG: " << diff << std::endl;
}
MemoryManager::Print();
Grid_finalize();
}

View File

@ -0,0 +1,125 @@
/*************************************************************************************
Grid physics library, www.github.com/paboyle/Grid
Source file: ./tests/solver/Test_eofa_inv.cc
Copyright (C) 2017
Author: Christopher Kelly <ckelly@bnl.gov>
Author: Peter Boyle <paboyle@ph.ed.ac.uk>
Author: David Murphy <dmurphy@phys.columbia.edu>
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 <Grid/Grid.h>
using namespace std;
using namespace Grid;
;
int main (int argc, char** argv)
{
Grid_init(&argc, &argv);
Coordinate latt_size = GridDefaultLatt();
Coordinate simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
Coordinate mpi_layout = GridDefaultMpi();
const int Ls = 8;
GridCartesian *UGrid = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplex::Nsimd()), GridDefaultMpi());
GridRedBlackCartesian *UrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid);
GridCartesian *FGrid = SpaceTimeGrid::makeFiveDimGrid(Ls, UGrid);
GridRedBlackCartesian *FrbGrid = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls, UGrid);
// Want a different conf at every run
// First create an instance of an engine.
std::random_device rnd_device;
// Specify the engine and distribution.
std::mt19937 mersenne_engine(rnd_device());
std::uniform_int_distribution<int> dist(1, 100);
auto gen = std::bind(dist, mersenne_engine);
std::vector<int> seeds4(4);
generate(begin(seeds4), end(seeds4), gen);
//std::vector<int> seeds4({1,2,3,5});
std::vector<int> seeds5({5,6,7,8});
GridParallelRNG RNG5(FGrid); RNG5.SeedFixedIntegers(seeds5);
GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4);
int threads = GridThread::GetThreads();
std::cout << GridLogMessage << "Grid is setup to use " << threads << " threads" << std::endl;
LatticeFermion phi (FGrid); gaussian(RNG5, phi);
LatticeFermion Mphi (FGrid);
LatticeFermion MphiPrime (FGrid);
LatticeGaugeField U(UGrid);
SU<Nc>::HotConfiguration(RNG4,U);
////////////////////////////////////
// Unmodified matrix element
////////////////////////////////////
RealD b = 2.5;
RealD c = 1.5;
RealD mf = 0.01;
RealD mb = 1.0;
RealD M5 = 1.8;
MobiusEOFAFermionD Lop(U, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mf, mf, mb, 0.0, -1, M5, b, c);
MobiusEOFAFermionD Rop(U, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mb, mf, mb, -1.0, 1, M5, b, c);
OneFlavourRationalParams Params(0.95, 100.0, 5000, 1.0e-10, 12);
ConjugateGradient<LatticeFermion> CG(1.0e-10, 5000);
ExactOneFlavourRatioPseudoFermionAction<WilsonImplR> Meofa(Lop, Rop, CG, CG, CG, CG, CG, Params, false);
GridSerialRNG sRNG; sRNG.SeedFixedIntegers(seeds4);
//Random field
LatticeFermion eta(FGrid);
gaussian(RNG5,eta);
//Check left inverse
LatticeFermion Meta(FGrid);
Meofa.Meofa(U, eta, Meta);
LatticeFermion MinvMeta(FGrid);
Meofa.MeofaInv(U, Meta, MinvMeta);
LatticeFermion diff = MinvMeta - eta;
std::cout << GridLogMessage << "eta: " << norm2(eta) << " M*eta: " << norm2(Meta) << " M^{-1}*M*eta: " << norm2(MinvMeta) << " M^{-1}*M*eta - eta: " << norm2(diff) << " (expect 0)" << std::endl;
assert(norm2(diff) < 1e-8);
//Check right inverse
LatticeFermion MinvEta(FGrid);
Meofa.MeofaInv(U, eta, MinvEta);
LatticeFermion MMinvEta(FGrid);
Meofa.Meofa(U, MinvEta, MMinvEta);
diff = MMinvEta - eta;
std::cout << GridLogMessage << "eta: " << norm2(eta) << " M^{-1}*eta: " << norm2(MinvEta) << " M*M^{-1}*eta: " << norm2(MMinvEta) << " M*M^{-1}*eta - eta: " << norm2(diff) << " (expect 0)" << std::endl;
assert(norm2(diff) < 1e-8);
std::cout << GridLogMessage << "Done" << std::endl;
Grid_finalize();
}

View File

@ -292,9 +292,9 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
RealD mass=0.001;
RealD M5=1.8;
WilsonFermionR Dw(Umu,*UGrid,*UrbGrid,-M5);
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionR Dpv (Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,1.0,M5);
WilsonFermionD Dw(Umu,*UGrid,*UrbGrid,-M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Dpv (Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,1.0,M5);
typedef Aggregation<vSpinColourVector,vTComplex,nbasis> Subspace;
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> CoarseOperator;
@ -304,7 +304,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Calling Aggregation class to build subspace" <<std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
MdagMLinearOperator<WilsonFermionR,LatticeFermion> SubspaceOp(Dw);
MdagMLinearOperator<WilsonFermionD,LatticeFermion> SubspaceOp(Dw);
Subspace Aggregates4D(Coarse4d,UGrid,0);
Subspace Aggregates5D(Coarse5d,FGrid,0);
@ -335,7 +335,7 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> Level1Op;
NonHermitianLinearOperator<DomainWallFermionR,LatticeFermion> LinOpDwf(Ddwf);
NonHermitianLinearOperator<DomainWallFermionD,LatticeFermion> LinOpDwf(Ddwf);
Level1Op LDOp (*Coarse5d,*Coarse5dRB,0);

View File

@ -395,7 +395,7 @@ public:
Geometry geom;
GridBase *Coarse5D;
GridBase *Coarse4D;
CartesianStencil<siteVector,siteVector,int> Stencil;
CartesianStencil<siteVector,siteVector,DefaultImplParams> Stencil;
CoarsenedMatrix<Fobj,CComplex,nbasis> &Dw;
GridBase * Grid(void) { return Coarse5D; }; // this is all the linalg routines need to know
@ -409,7 +409,7 @@ public:
Coarse5D(&CoarseGrid5),
Dw(_Dw),
geom(CoarseGrid5._ndimension),
Stencil( &CoarseGrid5,geom.npoint,Even,geom.directions,geom.displacements,0)
Stencil( &CoarseGrid5,geom.npoint,Even,geom.directions,geom.displacements,DefaultImplParams())
{
};
@ -456,8 +456,8 @@ public:
siteVector *CBp=Stencil.CommBuf();
int ptype;
int nb2=nbasis/2;
// int ptype;
// int nb2=nbasis/2;
autoView(in_v , in, AcceleratorRead);
autoView(st, Stencil, AcceleratorRead);
@ -471,7 +471,7 @@ public:
typedef decltype(coalescedRead(in_v[0])) calcVector;
typedef decltype(coalescedRead(in_v[0](0))) calcComplex;
int sU = sF/Ls;
int s = sF%Ls;
// int s = sF%Ls;
calcComplex res = Zero();
calcVector nbr;
@ -517,14 +517,14 @@ public:
autoView(st, Stencil, AcceleratorRead);
siteVector *CBp=Stencil.CommBuf();
int ptype;
int nb2=nbasis/2;
// int ptype;
// int nb2=nbasis/2;
accelerator_for2d(sF, Coarse5D->oSites(), b, nbasis, Nsimd, {
typedef decltype(coalescedRead(in_v[0])) calcVector;
typedef decltype(coalescedRead(in_v[0](0))) calcComplex;
int sU = sF/Ls;
int s = sF%Ls;
// int s = sF%Ls;
calcComplex res = Zero();
@ -650,7 +650,7 @@ private:
OperatorFunction<Field> & _Solver;
LinearFunction<Field> & _Guess;
public:
using LinearFunction<Field>::operator();
/////////////////////////////////////////////////////
// Wrap the usual normal equations trick
/////////////////////////////////////////////////////
@ -712,6 +712,7 @@ RealD InverseApproximation(RealD x){
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & _SmootherMatrix;
FineOperator & _SmootherOperator;
@ -735,6 +736,7 @@ public:
template<class Fobj,class CComplex,int nbasis, class CoarseSolver>
class MGPreconditioner : public LinearFunction< Lattice<Fobj> > {
public:
using LinearFunction<Lattice<Fobj> >::operator();
typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
typedef typename Aggregation<Fobj,CComplex,nbasis>::CoarseVector CoarseVector;
@ -831,6 +833,7 @@ public:
template<class Fobj,class CComplex,int nbasis, class CoarseSolver>
class HDCRPreconditioner : public LinearFunction< Lattice<Fobj> > {
public:
using LinearFunction<Lattice<Fobj> >::operator();
typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
typedef typename Aggregation<Fobj,CComplex,nbasis>::CoarseVector CoarseVector;
@ -978,9 +981,9 @@ int main (int argc, char ** argv)
RealD mass=0.00078;
WilsonFermionR Dw(Umu,*UGrid,*UrbGrid,-M5);
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionR Dpv (Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,1.0,M5);
WilsonFermionD Dw(Umu,*UGrid,*UrbGrid,-M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Dpv (Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,1.0,M5);
typedef Aggregation<vSpinColourVector,vTComplex,nbasis> Subspace;
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> CoarseOperator;
@ -991,21 +994,21 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "Calling Aggregation class to build subspace" <<std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
// How to find criticall mass?
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.75); // 600 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.80); // 800 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.82); // 1023 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.85); // 1428 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.87); // 1900 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.90); // 3900 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.92); // 6200 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.94); // 8882 iters
WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.95); // 9170 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.96); // 8882 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.97); // 8406 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.99); // 6900 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-1.01); // 6397 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-1.00); // 5900 iters
MdagMLinearOperator<WilsonFermionR,LatticeFermion> MdagM_Dw(Dw_null);
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.75); // 600 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.80); // 800 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.82); // 1023 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.85); // 1428 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.87); // 1900 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.90); // 3900 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.92); // 6200 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.94); // 8882 iters
WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.95); // 9170 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.96); // 8882 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.97); // 8406 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.99); // 6900 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-1.01); // 6397 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-1.00); // 5900 iters
MdagMLinearOperator<WilsonFermionD,LatticeFermion> MdagM_Dw(Dw_null);
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Testing Wilson criticality " <<std::endl;
@ -1054,7 +1057,7 @@ int main (int argc, char ** argv)
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> Level1Op4;
typedef CoarseCayleyFermion<vSpinColourVector,vTComplex,nbasis> Level1Op5;
Level1Op4 c_Dw (*Coarse4d,0);
NonHermitianLinearOperator<WilsonFermionR,LatticeFermion> LinOpDw(Dw);
NonHermitianLinearOperator<WilsonFermionD,LatticeFermion> LinOpDw(Dw);
c_Dw.CoarsenOperator(UGrid,LinOpDw,Aggregates4D); // contains the M5 from Dw(-M5)
// c_Dw.Test(Aggregates4D,UGrid,LinOpDw);
@ -1124,8 +1127,8 @@ int main (int argc, char ** argv)
ConjugateGradient<CoarseVector> CoarseCG(tol,MaxIt);
ConjugateGradient<LatticeFermion> FineCG(tol,MaxIt);
NonHermitianLinearOperator<DomainWallFermionR,LatticeFermion> FineM(Ddwf);
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> FineMdagM(Ddwf); // M^\dag M
NonHermitianLinearOperator<DomainWallFermionD,LatticeFermion> FineM(Ddwf);
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> FineMdagM(Ddwf); // M^\dag M
NonHermitianLinearOperator<Level1Op5,CoarseVector> CoarseM(c_Dwf);
MdagMLinearOperator<Level1Op5,CoarseVector> CoarseMdagM(c_Dwf);
@ -1174,18 +1177,18 @@ int main (int argc, char ** argv)
PlainHermOp<CoarseCoarseVector> IRLOpL2 (IRLHermOpL2);
ImplicitlyRestartedLanczos<CoarseCoarseVector> IRLL2(IRLOpChebyL2,IRLOpL2,cNstop,cNk,cNm,1.0e-3,20);
int cNconv;
cNm=0;
std::vector<RealD> eval2(cNm);
std::vector<CoarseCoarseVector> evec2(cNm,CoarseCoarse5d);
cc_src=1.0;
// int cNconv;
// IRLL2.calc(eval2,evec2,cc_src,cNconv);
ConjugateGradient<CoarseCoarseVector> CoarseCoarseCG(0.02,10000);
DeflatedGuesser<CoarseCoarseVector> DeflCoarseCoarseGuesser(evec2,eval2);
NormalEquations<CoarseCoarseVector> DeflCoarseCoarseCGNE(cc_Dwf,CoarseCoarseCG,DeflCoarseCoarseGuesser);
ZeroGuesser<CoarseVector> CoarseZeroGuesser;
// ZeroGuesser<CoarseVector> CoarseZeroGuesser;
ZeroGuesser<CoarseCoarseVector> CoarseCoarseZeroGuesser;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
@ -1230,39 +1233,39 @@ typedef HDCRPreconditioner<siteVector,iScalar<vTComplex>,nbasisc,NormalEquations
// Wrap the 2nd level solver in a MultiGrid preconditioner acting on the fine space
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,14,FineM,Ddwf); // 26 iter, 39s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,14,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,14,FineM,Ddwf); // 26 iter, 39s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,14,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 25 iter, 38s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,16,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 25 iter, 38s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,16,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 23 iter, 39s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,20,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 23 iter, 39s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,20,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,10,FineM,Ddwf);24 iter, 44s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,24,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,10,FineM,Ddwf);24 iter, 44s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,24,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // odd convergence tail at 10^-9 ish
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.1,60.0,24,FineM,Ddwf); // 33 iter, waas O(10-9 by 26)
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // odd convergence tail at 10^-9 ish
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.1,60.0,24,FineM,Ddwf); // 33 iter, waas O(10-9 by 26)
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 25 iter, 39s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,18,FineM,Ddwf); //
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 25 iter, 39s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,18,FineM,Ddwf); //
ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,16,FineM,Ddwf);
ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,16,FineM,Ddwf); //
ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,16,FineM,Ddwf);
ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,16,FineM,Ddwf); //
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,11,FineM,Ddwf); // 33 iter, 49s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,11,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 26 iter, 37s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.4,60.0,12,FineM,Ddwf); // iter 26 no change in final residual
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.4,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.3,60.0,12,FineM,Ddwf); // 27 iter 39s.
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.3,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.3,60.0,13,FineM,Ddwf); // 26 iter, but slower
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.3,60.0,13,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(1.0,60.0,12,FineM,Ddwf); // 34 iter, slower
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(1.0,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,11,FineM,Ddwf); // 33 iter, 49s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,11,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 26 iter, 37s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.4,60.0,12,FineM,Ddwf); // iter 26 no change in final residual
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.4,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.3,60.0,12,FineM,Ddwf); // 27 iter 39s.
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.3,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.3,60.0,13,FineM,Ddwf); // 26 iter, but slower
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.3,60.0,13,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(1.0,60.0,12,FineM,Ddwf); // 34 iter, slower
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(1.0,60.0,12,FineM,Ddwf);
ThreeLevelMG ThreeLevelPrecon(Aggregates4D,
FineM,

View File

@ -395,7 +395,7 @@ public:
Geometry geom;
GridBase *Coarse5D;
GridBase *Coarse4D;
CartesianStencil<siteVector,siteVector,int> Stencil;
CartesianStencil<siteVector,siteVector,DefaultImplParams> Stencil;
CoarsenedMatrix<Fobj,CComplex,nbasis> &Dw;
GridBase * Grid(void) { return Coarse5D; }; // this is all the linalg routines need to know
@ -409,7 +409,7 @@ public:
Coarse5D(&CoarseGrid5),
Dw(_Dw),
geom(CoarseGrid5._ndimension),
Stencil( &CoarseGrid5,geom.npoint,Even,geom.directions,geom.displacements,0)
Stencil( &CoarseGrid5,geom.npoint,Even,geom.directions,geom.displacements,DefaultImplParams())
{
};
@ -456,8 +456,8 @@ public:
siteVector *CBp=Stencil.CommBuf();
int ptype;
int nb2=nbasis/2;
//int ptype;
// int nb2=nbasis/2;
autoView(in_v , in, AcceleratorRead);
autoView(st, Stencil, AcceleratorRead);
@ -471,7 +471,7 @@ public:
typedef decltype(coalescedRead(in_v[0])) calcVector;
typedef decltype(coalescedRead(in_v[0](0))) calcComplex;
int sU = sF/Ls;
int s = sF%Ls;
// int s = sF%Ls;
calcComplex res = Zero();
calcVector nbr;
@ -517,14 +517,14 @@ public:
autoView(st, Stencil, AcceleratorRead);
siteVector *CBp=Stencil.CommBuf();
int ptype;
int nb2=nbasis/2;
// int ptype;
// int nb2=nbasis/2;
accelerator_for2d(sF, Coarse5D->oSites(), b, nbasis, Nsimd, {
typedef decltype(coalescedRead(in_v[0])) calcVector;
typedef decltype(coalescedRead(in_v[0](0))) calcComplex;
int sU = sF/Ls;
int s = sF%Ls;
// int s = sF%Ls;
calcComplex res = Zero();
@ -648,7 +648,7 @@ private:
CheckerBoardedSparseMatrixBase<Field> & _Matrix;
SchurRedBlackBase<Field> & _Solver;
public:
using LinearFunction<Field>::operator();
/////////////////////////////////////////////////////
// Wrap the usual normal equations trick
/////////////////////////////////////////////////////
@ -669,6 +669,7 @@ private:
OperatorFunction<Field> & _Solver;
LinearFunction<Field> & _Guess;
public:
using LinearFunction<Field>::operator();
/////////////////////////////////////////////////////
// Wrap the usual normal equations trick
@ -731,6 +732,7 @@ RealD InverseApproximation(RealD x){
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
{
public:
using LinearFunction<Field>::operator();
typedef LinearOperatorBase<Field> FineOperator;
Matrix & _SmootherMatrix;
FineOperator & _SmootherOperator;
@ -754,6 +756,7 @@ public:
template<class Fobj,class CComplex,int nbasis, class CoarseSolver>
class MGPreconditioner : public LinearFunction< Lattice<Fobj> > {
public:
using LinearFunction<Lattice<Fobj> >::operator();
typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
typedef typename Aggregation<Fobj,CComplex,nbasis>::CoarseVector CoarseVector;
@ -850,7 +853,8 @@ public:
template<class Fobj,class CComplex,int nbasis, class CoarseSolver>
class HDCRPreconditioner : public LinearFunction< Lattice<Fobj> > {
public:
using LinearFunction<Lattice<Fobj> >::operator();
typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
typedef typename Aggregation<Fobj,CComplex,nbasis>::CoarseVector CoarseVector;
typedef typename Aggregation<Fobj,CComplex,nbasis>::CoarseMatrix CoarseMatrix;
@ -1001,9 +1005,9 @@ int main (int argc, char ** argv)
RealD mass=0.00078;
WilsonFermionR Dw(Umu,*UGrid,*UrbGrid,-M5);
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionR Dpv (Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,1.0,M5);
WilsonFermionD Dw(Umu,*UGrid,*UrbGrid,-M5);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,M5);
DomainWallFermionD Dpv (Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,1.0,M5);
typedef Aggregation<vSpinColourVector,vTComplex,nbasis> Subspace;
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> CoarseOperator;
@ -1014,21 +1018,21 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "Calling Aggregation class to build subspace" <<std::endl;
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
// How to find criticall mass?
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.75); // 600 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.80); // 800 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.82); // 1023 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.85); // 1428 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.87); // 1900 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.90); // 3900 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.92); // 6200 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.94); // 8882 iters
WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.95); // 9170 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.96); // 8882 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.97); // 8406 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-0.99); // 6900 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-1.01); // 6397 iters
// WilsonFermionR Dw_null(Umu,*UGrid,*UrbGrid,-1.00); // 5900 iters
MdagMLinearOperator<WilsonFermionR,LatticeFermion> MdagM_Dw(Dw_null);
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.75); // 600 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.80); // 800 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.82); // 1023 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.85); // 1428 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.87); // 1900 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.90); // 3900 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.92); // 6200 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.94); // 8882 iters
WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.95); // 9170 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.96); // 8882 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.97); // 8406 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-0.99); // 6900 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-1.01); // 6397 iters
// WilsonFermionD Dw_null(Umu,*UGrid,*UrbGrid,-1.00); // 5900 iters
MdagMLinearOperator<WilsonFermionD,LatticeFermion> MdagM_Dw(Dw_null);
std::cout<<GridLogMessage << "**************************************************"<< std::endl;
std::cout<<GridLogMessage << "Testing Wilson criticality " <<std::endl;
@ -1077,7 +1081,7 @@ int main (int argc, char ** argv)
typedef CoarsenedMatrix<vSpinColourVector,vTComplex,nbasis> Level1Op4;
typedef CoarseCayleyFermion<vSpinColourVector,vTComplex,nbasis> Level1Op5;
Level1Op4 c_Dw (*Coarse4d,0);
NonHermitianLinearOperator<WilsonFermionR,LatticeFermion> LinOpDw(Dw);
NonHermitianLinearOperator<WilsonFermionD,LatticeFermion> LinOpDw(Dw);
c_Dw.CoarsenOperator(UGrid,LinOpDw,Aggregates4D); // contains the M5 from Dw(-M5)
// c_Dw.Test(Aggregates4D,UGrid,LinOpDw);
@ -1144,8 +1148,8 @@ int main (int argc, char ** argv)
ConjugateGradient<CoarseVector> CoarseCG(tol,MaxIt);
ConjugateGradient<LatticeFermion> FineCG(tol,MaxIt);
NonHermitianLinearOperator<DomainWallFermionR,LatticeFermion> FineM(Ddwf);
MdagMLinearOperator<DomainWallFermionR,LatticeFermion> FineMdagM(Ddwf); // M^\dag M
NonHermitianLinearOperator<DomainWallFermionD,LatticeFermion> FineM(Ddwf);
MdagMLinearOperator<DomainWallFermionD,LatticeFermion> FineMdagM(Ddwf); // M^\dag M
NonHermitianLinearOperator<Level1Op5,CoarseVector> CoarseM(c_Dwf);
MdagMLinearOperator<Level1Op5,CoarseVector> CoarseMdagM(c_Dwf);
@ -1194,11 +1198,11 @@ int main (int argc, char ** argv)
PlainHermOp<CoarseCoarseVector> IRLOpL2 (IRLHermOpL2);
ImplicitlyRestartedLanczos<CoarseCoarseVector> IRLL2(IRLOpChebyL2,IRLOpL2,cNstop,cNk,cNm,1.0e-3,20);
int cNconv;
cNm=0;
std::vector<RealD> eval2(cNm);
std::vector<CoarseCoarseVector> evec2(cNm,CoarseCoarse5d);
cc_src=1.0;
// int cNconv;
// IRLL2.calc(eval2,evec2,cc_src,cNconv);
std::vector<RealD> tols ({0.005,0.001});
@ -1218,10 +1222,10 @@ int main (int argc, char ** argv)
for(auto c_hi : c_his ) {
for(auto f_lo : f_los ) {
for(auto f_hi : f_his ) {
ZeroGuesser<CoarseVector> CoarseZeroGuesser;
ZeroGuesser<CoarseCoarseVector> CoarseCoarseZeroGuesser;
// ZeroGuesser<CoarseVector> CoarseZeroGuesser;
// ZeroGuesser<CoarseCoarseVector> CoarseCoarseZeroGuesser;
ConjugateGradient<CoarseCoarseVector> CoarseCoarseCG(tol,10000);
ZeroGuesser<CoarseCoarseVector> CoarseCoarseGuesser;
// ZeroGuesser<CoarseCoarseVector> CoarseCoarseGuesser;
SchurRedBlackDiagMooeeSolve<CoarseCoarseVector> CoarseCoarseRBCG(CoarseCoarseCG);
SchurSolverWrapper<CoarseCoarseVector> CoarseCoarseSolver(cc_Dwf,CoarseCoarseRBCG);
@ -1268,38 +1272,38 @@ typedef HDCRPreconditioner<siteVector,iScalar<vTComplex>,nbasisc,LinearFunction<
// Wrap the 2nd level solver in a MultiGrid preconditioner acting on the fine space
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,14,FineM,Ddwf); // 26 iter, 39s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,14,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,14,FineM,Ddwf); // 26 iter, 39s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,14,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 25 iter, 38s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,16,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 25 iter, 38s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,16,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 23 iter, 39s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,20,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 23 iter, 39s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,20,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,10,FineM,Ddwf);24 iter, 44s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,24,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,10,FineM,Ddwf);24 iter, 44s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,24,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // odd convergence tail at 10^-9 ish
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.1,60.0,24,FineM,Ddwf); // 33 iter, waas O(10-9 by 26)
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // odd convergence tail at 10^-9 ish
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.1,60.0,24,FineM,Ddwf); // 33 iter, waas O(10-9 by 26)
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 25 iter, 39s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,18,FineM,Ddwf); //
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 25 iter, 39s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,18,FineM,Ddwf); //
ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother(f_lo,f_hi,f_ord,FineM,Ddwf);
ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother(f_lo,f_hi,f_ord,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,11,FineM,Ddwf); // 33 iter, 49s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,11,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 26 iter, 37s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.5,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.4,60.0,12,FineM,Ddwf); // iter 26 no change in final residual
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.4,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.3,60.0,12,FineM,Ddwf); // 27 iter 39s.
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.3,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(0.3,60.0,13,FineM,Ddwf); // 26 iter, but slower
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(0.3,60.0,13,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother1(1.0,60.0,12,FineM,Ddwf); // 34 iter, slower
// ChebyshevSmoother<LatticeFermion,DomainWallFermionR> FineSmoother2(1.0,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,11,FineM,Ddwf); // 33 iter, 49s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,11,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.5,60.0,12,FineM,Ddwf); // 26 iter, 37s
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.5,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.4,60.0,12,FineM,Ddwf); // iter 26 no change in final residual
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.4,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.3,60.0,12,FineM,Ddwf); // 27 iter 39s.
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.3,60.0,12,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(0.3,60.0,13,FineM,Ddwf); // 26 iter, but slower
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(0.3,60.0,13,FineM,Ddwf);
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother1(1.0,60.0,12,FineM,Ddwf); // 34 iter, slower
// ChebyshevSmoother<LatticeFermion,DomainWallFermionD> FineSmoother2(1.0,60.0,12,FineM,Ddwf);
ThreeLevelMG ThreeLevelPrecon(Aggregates4D,
FineM,

View File

@ -33,9 +33,9 @@ using namespace Grid;
int main (int argc, char ** argv)
{
typedef typename MobiusFermionR::FermionField FermionField;
typedef typename MobiusFermionR::ComplexField ComplexField;
typename MobiusFermionR::ImplParams params;
typedef typename MobiusFermionD::FermionField FermionField;
typedef typename MobiusFermionD::ComplexField ComplexField;
typename MobiusFermionD::ImplParams params;
const int Ls=12;
@ -158,15 +158,15 @@ int main (int argc, char ** argv)
RealD mobius_factor=32./12.;
RealD mobius_b=0.5*(mobius_factor+1.);
RealD mobius_c=0.5*(mobius_factor-1.);
MobiusFermionR Dchk(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5,mobius_b,mobius_c,params);
MobiusFermionR Ddwf(s_Umu,*SFGrid,*SFrbGrid,*SGrid,*SrbGrid,mass,M5,mobius_b,mobius_c,params);
MobiusFermionD Dchk(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5,mobius_b,mobius_c,params);
MobiusFermionD Ddwf(s_Umu,*SFGrid,*SFrbGrid,*SGrid,*SrbGrid,mass,M5,mobius_b,mobius_c,params);
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
std::cout << GridLogMessage << " Calling DWF CG "<<std::endl;
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
MdagMLinearOperator<MobiusFermionR,FermionField> HermOp(Ddwf);
MdagMLinearOperator<MobiusFermionR,FermionField> HermOpCk(Dchk);
MdagMLinearOperator<MobiusFermionD,FermionField> HermOp(Ddwf);
MdagMLinearOperator<MobiusFermionD,FermionField> HermOpCk(Dchk);
ConjugateGradient<FermionField> CG((stp),100000);
s_res = Zero();

View File

@ -35,9 +35,9 @@ using namespace Grid;
int main (int argc, char ** argv)
{
typedef typename DomainWallFermionR::FermionField FermionField;
typedef typename DomainWallFermionR::ComplexField ComplexField;
typename DomainWallFermionR::ImplParams params;
typedef typename DomainWallFermionD::FermionField FermionField;
typedef typename DomainWallFermionD::ComplexField ComplexField;
typename DomainWallFermionD::ImplParams params;
const int Ls=16;
@ -106,13 +106,13 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << " Building the solvers"<<std::endl;
RealD mass=0.01;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5,params);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5,params);
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
std::cout << GridLogMessage << " Calling DWF CG "<<std::endl;
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
MdagMLinearOperator<DomainWallFermionR,FermionField> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,FermionField> HermOp(Ddwf);
ConjugateGradient<FermionField> CG((stp),100000);
for(int rhs=0;rhs<1;rhs++){

View File

@ -35,9 +35,9 @@ using namespace Grid;
int main (int argc, char ** argv)
{
typedef typename DomainWallFermionR::FermionField FermionField;
typedef typename DomainWallFermionR::ComplexField ComplexField;
typename DomainWallFermionR::ImplParams params;
typedef typename DomainWallFermionD::FermionField FermionField;
typedef typename DomainWallFermionD::ComplexField ComplexField;
typename DomainWallFermionD::ImplParams params;
const int Ls=16;
@ -107,7 +107,7 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << " Building the solvers"<<std::endl;
RealD mass=0.01;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5,params);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5,params);
for(int s=0;s<nrhs;s++) {
Ddwf.ImportPhysicalFermionSource(src4[s],src[s]);
}
@ -116,7 +116,7 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << " Calling DWF CG "<<std::endl;
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
MdagMLinearOperator<DomainWallFermionR,FermionField> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,FermionField> HermOp(Ddwf);
ConjugateGradient<FermionField> CG((stp),100000);
for(int rhs=0;rhs<1;rhs++){

View File

@ -35,9 +35,9 @@ using namespace Grid;
int main (int argc, char ** argv)
{
typedef typename DomainWallFermionR::FermionField FermionField;
typedef typename DomainWallFermionR::ComplexField ComplexField;
typename DomainWallFermionR::ImplParams params;
typedef typename DomainWallFermionD::FermionField FermionField;
typedef typename DomainWallFermionD::ComplexField ComplexField;
typename DomainWallFermionD::ImplParams params;
const int Ls=16;
@ -106,13 +106,13 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << " Building the solvers"<<std::endl;
RealD mass=0.01;
RealD M5=1.8;
DomainWallFermionR Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5,params);
DomainWallFermionD Ddwf(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5,params);
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
std::cout << GridLogMessage << " Calling DWF CG "<<std::endl;
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
MdagMLinearOperator<DomainWallFermionR,FermionField> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,FermionField> HermOp(Ddwf);
ConjugateGradient<FermionField> CG((stp),100000);
for(int rhs=0;rhs<1;rhs++){

View File

@ -143,6 +143,7 @@ public:
template<class Field> class MultiGridPreconditionerBase : public LinearFunction<Field> {
public:
using LinearFunction<Field>::operator();
virtual ~MultiGridPreconditionerBase() = default;
virtual void setup() = 0;
virtual void operator()(Field const &in, Field &out) = 0;
@ -156,6 +157,7 @@ public:
/////////////////////////////////////////////
// Type Definitions
/////////////////////////////////////////////
using MultiGridPreconditionerBase<Lattice<Fobj>>::operator();
// clang-format off
typedef Aggregation<Fobj, CComplex, nBasis> Aggregates;
@ -568,6 +570,7 @@ public:
/////////////////////////////////////////////
// Type Definitions
/////////////////////////////////////////////
using MultiGridPreconditionerBase<Lattice<Fobj>>::operator();
typedef Matrix FineDiracMatrix;
typedef Lattice<Fobj> FineVector;

View File

@ -34,9 +34,9 @@ using namespace Grid;
int main (int argc, char ** argv)
{
typedef typename DomainWallFermionR::FermionField FermionField;
typedef typename DomainWallFermionR::ComplexField ComplexField;
typename DomainWallFermionR::ImplParams params;
typedef typename DomainWallFermionD::FermionField FermionField;
typedef typename DomainWallFermionD::ComplexField ComplexField;
typename DomainWallFermionD::ImplParams params;
const int Ls=4;
@ -117,15 +117,15 @@ int main (int argc, char ** argv)
///////////////////////////////////////////////////////////////
RealD mass=0.01;
RealD M5=1.8;
DomainWallFermionR Dchk(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5);
DomainWallFermionR Ddwf(s_Umu,*SFGrid,*SFrbGrid,*SGrid,*SrbGrid,mass,M5);
DomainWallFermionD Dchk(Umu,*FGrid,*FrbGrid,*UGrid,*rbGrid,mass,M5);
DomainWallFermionD Ddwf(s_Umu,*SFGrid,*SFrbGrid,*SGrid,*SrbGrid,mass,M5);
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
std::cout << GridLogMessage << " Calling DWF CG "<<std::endl;
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
MdagMLinearOperator<DomainWallFermionR,FermionField> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionR,FermionField> HermOpCk(Dchk);
MdagMLinearOperator<DomainWallFermionD,FermionField> HermOp(Ddwf);
MdagMLinearOperator<DomainWallFermionD,FermionField> HermOpCk(Dchk);
ConjugateGradient<FermionField> CG((1.0e-8/(me+1)),10000);
s_res = Zero();
CG(HermOp,s_src,s_res);

View File

@ -46,9 +46,9 @@ struct scal {
int main (int argc, char ** argv)
{
typedef typename ImprovedStaggeredFermion5DR::FermionField FermionField;
typedef typename ImprovedStaggeredFermion5DR::ComplexField ComplexField;
typename ImprovedStaggeredFermion5DR::ImplParams params;
typedef typename ImprovedStaggeredFermion5DD::FermionField FermionField;
typedef typename ImprovedStaggeredFermion5DD::ComplexField ComplexField;
typename ImprovedStaggeredFermion5DD::ImplParams params;
const int Ls=8;
@ -98,8 +98,8 @@ int main (int argc, char ** argv)
RealD c1=9.0/8.0;
RealD c2=-1.0/24.0;
RealD u0=1.0;
ImprovedStaggeredFermion5DR Ds(Umu,Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,c1,c2,u0);
SchurStaggeredOperator<ImprovedStaggeredFermion5DR,FermionField> HermOp(Ds);
ImprovedStaggeredFermion5DD Ds(Umu,Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,c1,c2,u0);
SchurStaggeredOperator<ImprovedStaggeredFermion5DD,FermionField> HermOp(Ds);
ConjugateGradient<FermionField> CG(1.0e-8,10000);
int blockDim = 0;
@ -111,8 +111,8 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
std::cout << GridLogMessage << " Calling 4d CG "<<std::endl;
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
ImprovedStaggeredFermionR Ds4d(Umu,Umu,*UGrid,*UrbGrid,mass,c1,c2,u0);
SchurStaggeredOperator<ImprovedStaggeredFermionR,FermionField> HermOp4d(Ds4d);
ImprovedStaggeredFermionD Ds4d(Umu,Umu,*UGrid,*UrbGrid,mass,c1,c2,u0);
SchurStaggeredOperator<ImprovedStaggeredFermionD,FermionField> HermOp4d(Ds4d);
FermionField src4d(UGrid); random(pRNG,src4d);
FermionField src4d_o(UrbGrid); pickCheckerboard(Odd,src4d_o,src4d);
FermionField result4d_o(UrbGrid);
@ -135,7 +135,6 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
std::cout << GridLogMessage << " Calling 5d CG for "<<Ls <<" right hand sides" <<std::endl;
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
Ds.ZeroCounters();
result_o=Zero();
{
double t1=usecond();
@ -152,7 +151,6 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
std::cout << GridLogMessage << " Calling multiRHS CG for "<<Ls <<" right hand sides" <<std::endl;
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
Ds.ZeroCounters();
result_o=Zero();
{
double t1=usecond();
@ -170,7 +168,6 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
std::cout << GridLogMessage << " Calling Block CGrQ for "<<Ls <<" right hand sides" <<std::endl;
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
Ds.ZeroCounters();
result_o=Zero();
{
double t1=usecond();
@ -187,7 +184,6 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
std::cout << GridLogMessage << " Calling Block CG for "<<Ls <<" right hand sides" <<std::endl;
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
Ds.ZeroCounters();
result_o=Zero();
{
double t1=usecond();

View File

@ -30,12 +30,6 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
using namespace std;
using namespace Grid;
;
template<class d>
struct scal {
d internal;
};
Gamma::Algebra Gmu [] = {
Gamma::Algebra::GammaX,
@ -46,9 +40,9 @@ struct scal {
int main (int argc, char ** argv)
{
typedef typename ImprovedStaggeredFermion5DR::FermionField FermionField;
typedef typename ImprovedStaggeredFermion5DR::ComplexField ComplexField;
typename ImprovedStaggeredFermion5DR::ImplParams params;
typedef typename ImprovedStaggeredFermion5DD::FermionField FermionField;
typedef typename ImprovedStaggeredFermion5DD::ComplexField ComplexField;
typename ImprovedStaggeredFermion5DD::ImplParams params;
const int Ls=8;
@ -83,8 +77,8 @@ int main (int argc, char ** argv)
volume=volume*latt_size[mu];
}
ImprovedStaggeredFermion5DR Ds(Umu,Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,c1,c2,u0);
MdagMLinearOperator<ImprovedStaggeredFermion5DR,FermionField> HermOp(Ds);
ImprovedStaggeredFermion5DD Ds(Umu,Umu,*FGrid,*FrbGrid,*UGrid,*UrbGrid,mass,c1,c2,u0);
MdagMLinearOperator<ImprovedStaggeredFermion5DD,FermionField> HermOp(Ds);
ConjugateGradient<FermionField> CG(1.0e-8,10000);
int blockDim = 0;
@ -95,8 +89,8 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
std::cout << GridLogMessage << " Calling 4d CG "<<std::endl;
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
ImprovedStaggeredFermionR Ds4d(Umu,Umu,*UGrid,*UrbGrid,mass,c1,c2,u0);
MdagMLinearOperator<ImprovedStaggeredFermionR,FermionField> HermOp4d(Ds4d);
ImprovedStaggeredFermionD Ds4d(Umu,Umu,*UGrid,*UrbGrid,mass,c1,c2,u0);
MdagMLinearOperator<ImprovedStaggeredFermionD,FermionField> HermOp4d(Ds4d);
FermionField src4d(UGrid); random(pRNG,src4d);
FermionField result4d(UGrid); result4d=Zero();
@ -120,7 +114,6 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
result=Zero();
{
Ds.ZeroCounters();
double t1=usecond();
CG(HermOp,src,result);
double t2=usecond();
@ -129,7 +122,6 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "usec = "<< (t2-t1)<<std::endl;
std::cout<<GridLogMessage << "flops = "<< flops<<std::endl;
std::cout<<GridLogMessage << "mflop/s = "<< flops/(t2-t1)<<std::endl;
Ds.Report();
}
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
@ -137,7 +129,6 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << " Calling multiRHS CG for "<<Ls <<" right hand sides" <<std::endl;
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
result=Zero();
Ds.ZeroCounters();
{
double t1=usecond();
mCG(HermOp,src,result);
@ -148,14 +139,12 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "flops = "<< flops<<std::endl;
std::cout<<GridLogMessage << "mflop/s = "<< flops/(t2-t1)<<std::endl;
}
Ds.Report();
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
std::cout << GridLogMessage << " Calling Block CG for "<<Ls <<" right hand sides" <<std::endl;
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
result=Zero();
Ds.ZeroCounters();
{
double t1=usecond();
BCGrQ(HermOp,src,result);
@ -166,7 +155,6 @@ int main (int argc, char ** argv)
std::cout<<GridLogMessage << "flops = "<< flops<<std::endl;
std::cout<<GridLogMessage << "mflop/s = "<< flops/(t2-t1)<<std::endl;
}
Ds.Report();
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;

View File

@ -33,9 +33,9 @@ using namespace Grid;
int main (int argc, char ** argv)
{
typedef typename ImprovedStaggeredFermionR::FermionField FermionField;
typedef typename ImprovedStaggeredFermionR::ComplexField ComplexField;
typename ImprovedStaggeredFermionR::ImplParams params;
typedef typename ImprovedStaggeredFermionD::FermionField FermionField;
typedef typename ImprovedStaggeredFermionD::ComplexField ComplexField;
typename ImprovedStaggeredFermionD::ImplParams params;
Grid_init(&argc,&argv);
@ -62,9 +62,9 @@ int main (int argc, char ** argv)
RealD c1=9.0/8.0;
RealD c2=-1.0/24.0;
RealD u0=1.0;
ImprovedStaggeredFermionR Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
ImprovedStaggeredFermionD Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
MdagMLinearOperator<ImprovedStaggeredFermionR,FermionField> HermOp(Ds);
MdagMLinearOperator<ImprovedStaggeredFermionD,FermionField> HermOp(Ds);
CommunicationAvoidingGeneralisedMinimalResidual<FermionField> CAGMRES(1.0e-8, 10000, 25);
CAGMRES(HermOp,src,result);

View File

@ -47,8 +47,8 @@ struct scal {
int main (int argc, char ** argv)
{
typedef typename ImprovedStaggeredFermionR::FermionField FermionField;
typename ImprovedStaggeredFermionR::ImplParams params;
typedef typename ImprovedStaggeredFermionD::FermionField FermionField;
typename ImprovedStaggeredFermionD::ImplParams params;
Grid_init(&argc,&argv);
@ -74,14 +74,14 @@ int main (int argc, char ** argv)
RealD c1=9.0/8.0;
RealD c2=-1.0/24.0;
RealD u0=1.0;
ImprovedStaggeredFermionR Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
ImprovedStaggeredFermionD Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
FermionField res_o(&RBGrid);
FermionField src_o(&RBGrid);
pickCheckerboard(Odd,src_o,src);
res_o=Zero();
SchurStaggeredOperator<ImprovedStaggeredFermionR,FermionField> HermOpEO(Ds);
SchurStaggeredOperator<ImprovedStaggeredFermionD,FermionField> HermOpEO(Ds);
ConjugateGradient<FermionField> CG(1.0e-8,10000);
double t1=usecond();
CG(HermOpEO,src_o,res_o);

View File

@ -45,8 +45,8 @@ struct scal {
int main (int argc, char ** argv)
{
typedef typename ImprovedStaggeredFermionR::FermionField FermionField;
typename ImprovedStaggeredFermionR::ImplParams params;
typedef typename ImprovedStaggeredFermionD::FermionField FermionField;
typename ImprovedStaggeredFermionD::ImplParams params;
Grid_init(&argc,&argv);
Coordinate latt_size = GridDefaultLatt();
@ -68,7 +68,7 @@ int main (int argc, char ** argv)
RealD c1=9.0/8.0;
RealD c2=-1.0/24.0;
RealD u0=1.0;
ImprovedStaggeredFermionR Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
ImprovedStaggeredFermionD Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
ConjugateGradient<FermionField> CG(1.0e-8,10000);
SchurRedBlackStaggeredSolve<FermionField> SchurSolver(CG);

View File

@ -47,9 +47,9 @@ struct scal {
int main (int argc, char ** argv)
{
typedef typename ImprovedStaggeredFermionR::FermionField FermionField;
typedef typename ImprovedStaggeredFermionR::ComplexField ComplexField;
typename ImprovedStaggeredFermionR::ImplParams params;
typedef typename ImprovedStaggeredFermionD::FermionField FermionField;
typedef typename ImprovedStaggeredFermionD::ComplexField ComplexField;
typename ImprovedStaggeredFermionD::ImplParams params;
Grid_init(&argc,&argv);
@ -76,9 +76,9 @@ int main (int argc, char ** argv)
RealD c1=9.0/8.0;
RealD c2=-1.0/24.0;
RealD u0=1.0;
ImprovedStaggeredFermionR Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
ImprovedStaggeredFermionD Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
MdagMLinearOperator<ImprovedStaggeredFermionR,FermionField> HermOp(Ds);
MdagMLinearOperator<ImprovedStaggeredFermionD,FermionField> HermOp(Ds);
ConjugateGradient<FermionField> CG(1.0e-6,10000);
CG(HermOp,src,result);

View File

@ -33,9 +33,9 @@ using namespace Grid;
int main (int argc, char ** argv)
{
typedef typename ImprovedStaggeredFermionR::FermionField FermionField;
typedef typename ImprovedStaggeredFermionR::ComplexField ComplexField;
typename ImprovedStaggeredFermionR::ImplParams params;
typedef typename ImprovedStaggeredFermionD::FermionField FermionField;
typedef typename ImprovedStaggeredFermionD::ComplexField ComplexField;
typename ImprovedStaggeredFermionD::ImplParams params;
Grid_init(&argc,&argv);
@ -62,9 +62,9 @@ int main (int argc, char ** argv)
RealD c1=9.0/8.0;
RealD c2=-1.0/24.0;
RealD u0=1.0;
ImprovedStaggeredFermionR Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
ImprovedStaggeredFermionD Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
MdagMLinearOperator<ImprovedStaggeredFermionR,FermionField> HermOp(Ds);
MdagMLinearOperator<ImprovedStaggeredFermionD,FermionField> HermOp(Ds);
TrivialPrecon<FermionField> simple;

View File

@ -33,9 +33,9 @@ using namespace Grid;
int main (int argc, char ** argv)
{
typedef typename ImprovedStaggeredFermionR::FermionField FermionField;
typedef typename ImprovedStaggeredFermionR::ComplexField ComplexField;
typename ImprovedStaggeredFermionR::ImplParams params;
typedef typename ImprovedStaggeredFermionD::FermionField FermionField;
typedef typename ImprovedStaggeredFermionD::ComplexField ComplexField;
typename ImprovedStaggeredFermionD::ImplParams params;
Grid_init(&argc,&argv);
@ -62,9 +62,9 @@ int main (int argc, char ** argv)
RealD c1=9.0/8.0;
RealD c2=-1.0/24.0;
RealD u0=1.0;
ImprovedStaggeredFermionR Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
ImprovedStaggeredFermionD Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
MdagMLinearOperator<ImprovedStaggeredFermionR,FermionField> HermOp(Ds);
MdagMLinearOperator<ImprovedStaggeredFermionD,FermionField> HermOp(Ds);
TrivialPrecon<FermionField> simple;

View File

@ -33,9 +33,9 @@ using namespace Grid;
int main (int argc, char ** argv)
{
typedef typename ImprovedStaggeredFermionR::FermionField FermionField;
typedef typename ImprovedStaggeredFermionR::ComplexField ComplexField;
typename ImprovedStaggeredFermionR::ImplParams params;
typedef typename ImprovedStaggeredFermionD::FermionField FermionField;
typedef typename ImprovedStaggeredFermionD::ComplexField ComplexField;
typename ImprovedStaggeredFermionD::ImplParams params;
Grid_init(&argc,&argv);
@ -62,9 +62,9 @@ int main (int argc, char ** argv)
RealD c1=9.0/8.0;
RealD c2=-1.0/24.0;
RealD u0=1.0;
ImprovedStaggeredFermionR Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
ImprovedStaggeredFermionD Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
MdagMLinearOperator<ImprovedStaggeredFermionR,FermionField> HermOp(Ds);
MdagMLinearOperator<ImprovedStaggeredFermionD,FermionField> HermOp(Ds);
GeneralisedMinimalResidual<FermionField> GMRES(1.0e-8, 10000, 25);
GMRES(HermOp,src,result);

View File

@ -33,9 +33,9 @@ using namespace Grid;
int main (int argc, char ** argv)
{
typedef typename ImprovedStaggeredFermionR::FermionField FermionField;
typedef typename ImprovedStaggeredFermionR::ComplexField ComplexField;
typename ImprovedStaggeredFermionR::ImplParams params;
typedef typename ImprovedStaggeredFermionD::FermionField FermionField;
typedef typename ImprovedStaggeredFermionD::ComplexField ComplexField;
typename ImprovedStaggeredFermionD::ImplParams params;
Grid_init(&argc,&argv);
@ -62,9 +62,9 @@ int main (int argc, char ** argv)
RealD c1=9.0/8.0;
RealD c2=-1.0/24.0;
RealD u0=1.0;
ImprovedStaggeredFermionR Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
ImprovedStaggeredFermionD Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
MdagMLinearOperator<ImprovedStaggeredFermionR,FermionField> HermOp(Ds);
MdagMLinearOperator<ImprovedStaggeredFermionD,FermionField> HermOp(Ds);
MinimalResidual<FermionField> MR(1.0e-8,10000,0.8);
MR(HermOp,src,result);

View File

@ -46,8 +46,8 @@ struct scal {
int main (int argc, char ** argv)
{
typedef typename ImprovedStaggeredFermionR::FermionField FermionField;
typename ImprovedStaggeredFermionR::ImplParams params;
typedef typename ImprovedStaggeredFermionD::FermionField FermionField;
typename ImprovedStaggeredFermionD::ImplParams params;
Grid_init(&argc,&argv);
@ -90,8 +90,8 @@ int main (int argc, char ** argv)
RealD c2=-1.0/24.0;
RealD u0=1.0;
ImprovedStaggeredFermionR Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
SchurStaggeredOperator<ImprovedStaggeredFermionR,FermionField> HermOpEO(Ds);
ImprovedStaggeredFermionD Ds(Umu,Umu,Grid,RBGrid,mass,c1,c2,u0);
SchurStaggeredOperator<ImprovedStaggeredFermionD,FermionField> HermOpEO(Ds);
FermionField src(&Grid); random(pRNG,src);
FermionField src_o(&RBGrid);

View File

@ -55,9 +55,9 @@ int main (int argc, char ** argv)
}
RealD mass=0.5;
WilsonFermionR Dw(Umu,Grid,RBGrid,mass);
WilsonFermionD Dw(Umu,Grid,RBGrid,mass);
MdagMLinearOperator<WilsonFermionR,LatticeFermion> HermOp(Dw);
MdagMLinearOperator<WilsonFermionD,LatticeFermion> HermOp(Dw);
CommunicationAvoidingGeneralisedMinimalResidual<LatticeFermion> CAGMRES(1.0e-8, 10000, 25);
CAGMRES(HermOp,src,result);

View File

@ -69,7 +69,7 @@ int main (int argc, char ** argv)
}
RealD mass=0.5;
WilsonFermionR Dw(Umu,Grid,RBGrid,mass);
WilsonFermionD Dw(Umu,Grid,RBGrid,mass);
// HermitianOperator<WilsonFermion,LatticeFermion> HermOp(Dw);
// ConjugateGradient<LatticeFermion> CG(1.0e-8,10000);
@ -80,7 +80,7 @@ int main (int argc, char ** argv)
pickCheckerboard(Odd,src_o,src);
result_o=Zero();
SchurDiagMooeeOperator<WilsonFermionR,LatticeFermion> HermOpEO(Dw);
SchurDiagMooeeOperator<WilsonFermionD,LatticeFermion> HermOpEO(Dw);
ConjugateGradient<LatticeFermion> CG(1.0e-8,10000);
CG(HermOpEO,src_o,result_o);

View File

@ -64,7 +64,7 @@ int main (int argc, char ** argv)
LatticeFermion resid(&Grid);
RealD mass=0.5;
WilsonFermionR Dw(Umu,Grid,RBGrid,mass);
WilsonFermionD Dw(Umu,Grid,RBGrid,mass);
ConjugateGradient<LatticeFermion> CG(1.0e-8,10000);
SchurRedBlackDiagMooeeSolve<LatticeFermion> SchurSolver(CG);

View File

@ -68,9 +68,9 @@ int main (int argc, char ** argv)
}
RealD mass=0.5;
WilsonFermionR Dw(Umu,Grid,RBGrid,mass);
WilsonFermionD Dw(Umu,Grid,RBGrid,mass);
MdagMLinearOperator<WilsonFermionR,LatticeFermion> HermOp(Dw);
MdagMLinearOperator<WilsonFermionD,LatticeFermion> HermOp(Dw);
ConjugateGradient<LatticeFermion> CG(1.0e-8,10000);
CG(HermOp,src,result);

View File

@ -70,9 +70,9 @@ int main (int argc, char ** argv)
}
RealD mass=0.5;
WilsonFermionR Dw(Umu,Grid,RBGrid,mass);
WilsonFermionD Dw(Umu,Grid,RBGrid,mass);
MdagMLinearOperator<WilsonFermionR,LatticeFermion> HermOp(Dw);
MdagMLinearOperator<WilsonFermionD,LatticeFermion> HermOp(Dw);
ConjugateResidual<LatticeFermion> MCR(1.0e-8,10000);

View File

@ -55,9 +55,9 @@ int main (int argc, char ** argv)
}
RealD mass=0.5;
WilsonFermionR Dw(Umu,Grid,RBGrid,mass);
WilsonFermionD Dw(Umu,Grid,RBGrid,mass);
MdagMLinearOperator<WilsonFermionR,LatticeFermion> HermOp(Dw);
MdagMLinearOperator<WilsonFermionD,LatticeFermion> HermOp(Dw);
TrivialPrecon<LatticeFermion> simple;

View File

@ -55,9 +55,9 @@ int main (int argc, char ** argv)
}
RealD mass=0.5;
WilsonFermionR Dw(Umu,Grid,RBGrid,mass);
WilsonFermionD Dw(Umu,Grid,RBGrid,mass);
MdagMLinearOperator<WilsonFermionR,LatticeFermion> HermOp(Dw);
MdagMLinearOperator<WilsonFermionD,LatticeFermion> HermOp(Dw);
TrivialPrecon<LatticeFermion> simple;

View File

@ -55,9 +55,9 @@ int main (int argc, char ** argv)
}
RealD mass=0.5;
WilsonFermionR Dw(Umu,Grid,RBGrid,mass);
WilsonFermionD Dw(Umu,Grid,RBGrid,mass);
MdagMLinearOperator<WilsonFermionR,LatticeFermion> HermOp(Dw);
MdagMLinearOperator<WilsonFermionD,LatticeFermion> HermOp(Dw);
GeneralisedMinimalResidual<LatticeFermion> GMRES(1.0e-8, 10000, 25);
GMRES(HermOp,src,result);

View File

@ -77,16 +77,16 @@ int main(int argc, char **argv) {
// Note: We do chiral doubling, so actually only nbasis/2 full basis vectors are used
const int nbasis = 40;
WilsonFermionR Dw(Umu, *FGrid, *FrbGrid, mass);
WilsonFermionD Dw(Umu, *FGrid, *FrbGrid, mass);
MdagMLinearOperator<WilsonFermionR, LatticeFermion> MdagMOpDw(Dw);
MdagMLinearOperator<WilsonFermionD, LatticeFermion> MdagMOpDw(Dw);
std::cout << GridLogMessage << "**************************************************" << std::endl;
std::cout << GridLogMessage << "Testing Multigrid for Wilson" << std::endl;
std::cout << GridLogMessage << "**************************************************" << std::endl;
TrivialPrecon<LatticeFermion> TrivialPrecon;
auto MGPreconDw = createMGInstance<vSpinColourVector, vTComplex, nbasis, WilsonFermionR>(mgParams, levelInfo, Dw, Dw);
auto MGPreconDw = createMGInstance<vSpinColourVector, vTComplex, nbasis, WilsonFermionD>(mgParams, levelInfo, Dw, Dw);
MGPreconDw->setup();

View File

@ -55,9 +55,9 @@ int main (int argc, char ** argv)
}
RealD mass=0.5;
WilsonFermionR Dw(Umu,Grid,RBGrid,mass);
WilsonFermionD Dw(Umu,Grid,RBGrid,mass);
MdagMLinearOperator<WilsonFermionR,LatticeFermion> HermOp(Dw);
MdagMLinearOperator<WilsonFermionD,LatticeFermion> HermOp(Dw);
MinimalResidual<LatticeFermion> MR(1.0e-8,10000,0.8);
MR(HermOp,src,result);

View File

@ -56,10 +56,9 @@ int main (int argc, char ** argv)
QuasiMinimalResidual<LatticeFermion> QMR(1.0e-8,10000);
RealD mass=0.0;
RealD M5=1.8;
WilsonFermionR Dw(Umu,*Grid,*rbGrid,mass);
WilsonFermionD Dw(Umu,*Grid,*rbGrid,mass);
NonHermitianLinearOperator<WilsonFermionR,LatticeFermion> NonHermOp(Dw);
NonHermitianLinearOperator<WilsonFermionD,LatticeFermion> NonHermOp(Dw);
QMR(NonHermOp,src,result);
Grid_finalize();

View File

@ -70,14 +70,14 @@ int main (int argc, char ** argv)
RealD mass = -0.1;
RealD csw_r = 1.0;
RealD csw_t = 1.0;
WilsonCloverFermionR Dw(Umu, Grid, RBGrid, mass, csw_r, csw_t);
WilsonCloverFermionD Dw(Umu, Grid, RBGrid, mass, csw_r, csw_t);
LatticeFermion src_o(&RBGrid);
LatticeFermion result_o(&RBGrid);
pickCheckerboard(Odd, src_o, src);
result_o = Zero();
NonHermitianSchurDiagMooeeOperator<WilsonCloverFermionR,LatticeFermion> HermOp(Dw);
NonHermitianSchurDiagMooeeOperator<WilsonCloverFermionD,LatticeFermion> HermOp(Dw);
BiCGSTAB<LatticeFermion> CG(1.0e-8,10000);
CG(HermOp, src_o, result_o);

View File

@ -70,7 +70,7 @@ int main (int argc, char ** argv)
RealD mass = -0.1;
RealD csw_r = 1.0;
RealD csw_t = 1.0;
WilsonCloverFermionR Dw(Umu, Grid, RBGrid, mass, csw_r, csw_t);
WilsonCloverFermionD Dw(Umu, Grid, RBGrid, mass, csw_r, csw_t);
BiCGSTAB<LatticeFermion> CG(1.0e-8,10000);
NonHermitianSchurRedBlackDiagMooeeSolve<LatticeFermion> SchurSolver(CG);

View File

@ -70,9 +70,9 @@ int main (int argc, char ** argv)
RealD mass = -0.1;
RealD csw_r = 1.0;
RealD csw_t = 1.0;
WilsonCloverFermionR Dw(Umu, Grid, RBGrid, mass, csw_r, csw_t);
WilsonCloverFermionD Dw(Umu, Grid, RBGrid, mass, csw_r, csw_t);
NonHermitianLinearOperator<WilsonCloverFermionR,LatticeFermion> HermOp(Dw);
NonHermitianLinearOperator<WilsonCloverFermionD,LatticeFermion> HermOp(Dw);
BiCGSTAB<LatticeFermion> CG(1.0e-8,10000);
CG(HermOp,src,result);

View File

@ -44,8 +44,8 @@ int main (int argc, char ** argv)
std::vector<int> seeds({1,2,3,4});
GridParallelRNG pRNG(&Grid); pRNG.SeedFixedIntegers(seeds);
typedef typename WilsonCloverFermionR::FermionField FermionField;
typename WilsonCloverFermionR::ImplParams params;
typedef typename WilsonCloverFermionD::FermionField FermionField;
typename WilsonCloverFermionD::ImplParams params;
WilsonAnisotropyCoefficients anis;
FermionField src(&Grid); random(pRNG,src);
@ -61,9 +61,9 @@ int main (int argc, char ** argv)
RealD mass = 0.5;
RealD csw_r = 1.0;
RealD csw_t = 1.0;
WilsonCloverFermionR Dwc(Umu,Grid,RBGrid,mass,csw_r,csw_t,anis,params);
WilsonCloverFermionD Dwc(Umu,Grid,RBGrid,mass,csw_r,csw_t,anis,params);
MdagMLinearOperator<WilsonCloverFermionR,FermionField> HermOp(Dwc);
MdagMLinearOperator<WilsonCloverFermionD,FermionField> HermOp(Dwc);
CommunicationAvoidingGeneralisedMinimalResidual<FermionField> CAGMRES(1.0e-8, 10000, 25);
CAGMRES(HermOp,src,result);

View File

@ -71,7 +71,12 @@ int main (int argc, char ** argv)
RealD mass = -0.1;
RealD csw_r = 1.0;
RealD csw_t = 1.0;
WilsonCloverFermionR Dw(Umu, Grid, RBGrid, mass, csw_r, csw_t);
RealD cF = 1.0;
WilsonCloverFermionD Dw(Umu, Grid, RBGrid, mass, csw_r, csw_t);
CompactWilsonCloverFermionD Dw_compact(Umu, Grid, RBGrid, mass, csw_r, csw_t, 0.0);
WilsonExpCloverFermionD Dwe(Umu, Grid, RBGrid, mass, csw_r, csw_t);
CompactWilsonExpCloverFermionD Dwe_compact(Umu, Grid, RBGrid, mass, csw_r, csw_t, 0.0);
// HermitianOperator<WilsonFermion,LatticeFermion> HermOp(Dw);
// ConjugateGradient<LatticeFermion> CG(1.0e-8,10000);
@ -80,12 +85,28 @@ int main (int argc, char ** argv)
LatticeFermion src_o(&RBGrid);
LatticeFermion result_o(&RBGrid);
pickCheckerboard(Odd,src_o,src);
result_o=Zero();
SchurDiagMooeeOperator<WilsonCloverFermionR,LatticeFermion> HermOpEO(Dw);
ConjugateGradient<LatticeFermion> CG(1.0e-8,10000);
std::cout << GridLogMessage << "Testing Wilson Clover" << std::endl;
SchurDiagMooeeOperator<WilsonCloverFermionD,LatticeFermion> HermOpEO(Dw);
result_o=Zero();
CG(HermOpEO,src_o,result_o);
std::cout << GridLogMessage << "Testing Compact Wilson Clover" << std::endl;
SchurDiagMooeeOperator<CompactWilsonCloverFermionD,LatticeFermion> HermOpEO_compact(Dw_compact);
result_o=Zero();
CG(HermOpEO_compact,src_o,result_o);
std::cout << GridLogMessage << "Testing Wilson Exp Clover" << std::endl;
SchurDiagMooeeOperator<WilsonExpCloverFermionD,LatticeFermion> HermOpEO_exp(Dwe);
result_o=Zero();
CG(HermOpEO_exp,src_o,result_o);
std::cout << GridLogMessage << "Testing Compact Wilson Exp Clover" << std::endl;
SchurDiagMooeeOperator<CompactWilsonExpCloverFermionD,LatticeFermion> HermOpEO_exp_compact(Dwe_compact);
result_o=Zero();
CG(HermOpEO_exp_compact,src_o,result_o);
Grid_finalize();
}

View File

@ -60,18 +60,36 @@ int main (int argc, char ** argv)
LatticeGaugeField Umu(&Grid); SU<Nc>::HotConfiguration(pRNG,Umu);
LatticeFermion src(&Grid); random(pRNG,src);
LatticeFermion result(&Grid); result=Zero();
LatticeFermion resid(&Grid);
RealD mass = -0.1;
RealD csw_r = 1.0;
RealD csw_t = 1.0;
WilsonCloverFermionR Dw(Umu, Grid, RBGrid, mass, csw_r, csw_t);
LatticeFermion result(&Grid);
LatticeFermion resid(&Grid);
ConjugateGradient<LatticeFermion> CG(1.0e-8,10000);
SchurRedBlackDiagMooeeSolve<LatticeFermion> SchurSolver(CG);
RealD mass = -0.1;
RealD csw_r = 1.0;
RealD csw_t = 1.0;
RealD cF = 1.0;
std::cout << GridLogMessage << "Testing Wilson Clover" << std::endl;
WilsonCloverFermionD Dw(Umu, Grid, RBGrid, mass, csw_r, csw_t);
result=Zero();
SchurSolver(Dw,src,result);
std::cout << GridLogMessage << "Testing Compact Wilson Clover" << std::endl;
CompactWilsonCloverFermionD Dw_compact(Umu, Grid, RBGrid, mass, csw_r, csw_t, 0.0);
result=Zero();
SchurSolver(Dw_compact,src,result);
std::cout << GridLogMessage << "Testing Wilson Exp Clover" << std::endl;
WilsonExpCloverFermionD Dwe(Umu, Grid, RBGrid, mass, csw_r, csw_t);
result=Zero();
SchurSolver(Dwe,src,result);
std::cout << GridLogMessage << "Testing Compact Wilson Exp Clover" << std::endl;
CompactWilsonExpCloverFermionD Dwe_compact(Umu, Grid, RBGrid, mass, csw_r, csw_t, 0.0);
result=Zero();
SchurSolver(Dwe_compact,src,result);
Grid_finalize();
}

View File

@ -59,7 +59,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);
LatticeGaugeField Umu(&Grid); SU<Nc>::HotConfiguration(pRNG,Umu);
double volume=1;
@ -70,11 +70,34 @@ int main (int argc, char ** argv)
RealD mass = -0.1;
RealD csw_r = 1.0;
RealD csw_t = 1.0;
WilsonCloverFermionR Dw(Umu, Grid, RBGrid, mass, csw_r, csw_t);
RealD cF = 1.0;
WilsonCloverFermionD Dw(Umu, Grid, RBGrid, mass, csw_r, csw_t);
CompactWilsonCloverFermionD Dw_compact(Umu, Grid, RBGrid, mass, csw_r, csw_t, 0.0);
WilsonExpCloverFermionD Dwe(Umu, Grid, RBGrid, mass, csw_r, csw_t);
CompactWilsonExpCloverFermionD Dwe_compact(Umu, Grid, RBGrid, mass, csw_r, csw_t, 0.0);
MdagMLinearOperator<WilsonFermionR,LatticeFermion> HermOp(Dw);
ConjugateGradient<LatticeFermion> CG(1.0e-8,10000);
std::cout << GridLogMessage << "Testing Wilson Clover" << std::endl;
MdagMLinearOperator<WilsonCloverFermionD,LatticeFermion> HermOp(Dw);
result=Zero();
CG(HermOp,src,result);
std::cout << GridLogMessage << "Testing Compact Wilson Clover" << std::endl;
MdagMLinearOperator<CompactWilsonCloverFermionD,LatticeFermion> HermOp_compact(Dw_compact);
result=Zero();
CG(HermOp_compact,src,result);
std::cout << GridLogMessage << "Testing Wilson Exp Clover" << std::endl;
MdagMLinearOperator<WilsonExpCloverFermionD,LatticeFermion> HermOp_exp(Dwe);
result=Zero();
CG(HermOp_exp,src,result);
std::cout << GridLogMessage << "Testing Compact Wilson Exp Clover" << std::endl;
MdagMLinearOperator<CompactWilsonExpCloverFermionD,LatticeFermion> HermOp_exp_compact(Dwe_compact);
result=Zero();
CG(HermOp_exp_compact,src,result);
Grid_finalize();
}

View File

@ -44,8 +44,8 @@ int main (int argc, char ** argv)
std::vector<int> seeds({1,2,3,4});
GridParallelRNG pRNG(&Grid); pRNG.SeedFixedIntegers(seeds);
typedef typename WilsonCloverFermionR::FermionField FermionField;
typename WilsonCloverFermionR::ImplParams params;
typedef typename WilsonCloverFermionD::FermionField FermionField;
typename WilsonCloverFermionD::ImplParams params;
WilsonAnisotropyCoefficients anis;
FermionField src(&Grid); random(pRNG,src);
@ -61,9 +61,9 @@ int main (int argc, char ** argv)
RealD mass = 0.5;
RealD csw_r = 1.0;
RealD csw_t = 1.0;
WilsonCloverFermionR Dwc(Umu,Grid,RBGrid,mass,csw_r,csw_t,anis,params);
WilsonCloverFermionD Dwc(Umu,Grid,RBGrid,mass,csw_r,csw_t,anis,params);
MdagMLinearOperator<WilsonCloverFermionR,FermionField> HermOp(Dwc);
MdagMLinearOperator<WilsonCloverFermionD,FermionField> HermOp(Dwc);
TrivialPrecon<FermionField> simple;

View File

@ -44,8 +44,8 @@ int main (int argc, char ** argv)
std::vector<int> seeds({1,2,3,4});
GridParallelRNG pRNG(&Grid); pRNG.SeedFixedIntegers(seeds);
typedef typename WilsonCloverFermionR::FermionField FermionField;
typename WilsonCloverFermionR::ImplParams params;
typedef typename WilsonCloverFermionD::FermionField FermionField;
typename WilsonCloverFermionD::ImplParams params;
WilsonAnisotropyCoefficients anis;
FermionField src(&Grid); random(pRNG,src);
@ -61,9 +61,9 @@ int main (int argc, char ** argv)
RealD mass = 0.5;
RealD csw_r = 1.0;
RealD csw_t = 1.0;
WilsonCloverFermionR Dwc(Umu,Grid,RBGrid,mass,csw_r,csw_t,anis,params);
WilsonCloverFermionD Dwc(Umu,Grid,RBGrid,mass,csw_r,csw_t,anis,params);
MdagMLinearOperator<WilsonCloverFermionR,FermionField> HermOp(Dwc);
MdagMLinearOperator<WilsonCloverFermionD,FermionField> HermOp(Dwc);
TrivialPrecon<FermionField> simple;

View File

@ -44,8 +44,8 @@ int main (int argc, char ** argv)
std::vector<int> seeds({1,2,3,4});
GridParallelRNG pRNG(&Grid); pRNG.SeedFixedIntegers(seeds);
typedef typename WilsonCloverFermionR::FermionField FermionField;
typename WilsonCloverFermionR::ImplParams params;
typedef typename WilsonCloverFermionD::FermionField FermionField;
typename WilsonCloverFermionD::ImplParams params;
WilsonAnisotropyCoefficients anis;
FermionField src(&Grid); random(pRNG,src);
@ -61,9 +61,9 @@ int main (int argc, char ** argv)
RealD mass = 0.5;
RealD csw_r = 1.0;
RealD csw_t = 1.0;
WilsonCloverFermionR Dwc(Umu,Grid,RBGrid,mass,csw_r,csw_t,anis,params);
WilsonCloverFermionD Dwc(Umu,Grid,RBGrid,mass,csw_r,csw_t,anis,params);
MdagMLinearOperator<WilsonCloverFermionR,FermionField> HermOp(Dwc);
MdagMLinearOperator<WilsonCloverFermionD,FermionField> HermOp(Dwc);
GeneralisedMinimalResidual<FermionField> GMRES(1.0e-8, 10000, 25);
GMRES(HermOp,src,result);

View File

@ -80,16 +80,16 @@ int main(int argc, char **argv) {
// Note: We do chiral doubling, so actually only nbasis/2 full basis vectors are used
const int nbasis = 40;
WilsonCloverFermionR Dwc(Umu, *FGrid, *FrbGrid, mass, csw_r, csw_t);
WilsonCloverFermionD Dwc(Umu, *FGrid, *FrbGrid, mass, csw_r, csw_t);
MdagMLinearOperator<WilsonCloverFermionR, LatticeFermion> MdagMOpDwc(Dwc);
MdagMLinearOperator<WilsonCloverFermionD, LatticeFermion> MdagMOpDwc(Dwc);
std::cout << GridLogMessage << "**************************************************" << std::endl;
std::cout << GridLogMessage << "Testing Multigrid for Wilson Clover" << std::endl;
std::cout << GridLogMessage << "**************************************************" << std::endl;
TrivialPrecon<LatticeFermion> TrivialPrecon;
auto MGPreconDwc = createMGInstance<vSpinColourVector, vTComplex, nbasis, WilsonCloverFermionR>(mgParams, levelInfo, Dwc, Dwc);
auto MGPreconDwc = createMGInstance<vSpinColourVector, vTComplex, nbasis, WilsonCloverFermionD>(mgParams, levelInfo, Dwc, Dwc);
MGPreconDwc->setup();

View File

@ -44,8 +44,8 @@ int main (int argc, char ** argv)
std::vector<int> seeds({1,2,3,4});
GridParallelRNG pRNG(&Grid); pRNG.SeedFixedIntegers(seeds);
typedef typename WilsonCloverFermionR::FermionField FermionField;
typename WilsonCloverFermionR::ImplParams params;
typedef typename WilsonCloverFermionD::FermionField FermionField;
typename WilsonCloverFermionD::ImplParams params;
WilsonAnisotropyCoefficients anis;
FermionField src(&Grid); random(pRNG,src);
@ -61,9 +61,9 @@ int main (int argc, char ** argv)
RealD mass = 0.5;
RealD csw_r = 1.0;
RealD csw_t = 1.0;
WilsonCloverFermionR Dwc(Umu,Grid,RBGrid,mass,csw_r,csw_t,anis,params);
WilsonCloverFermionD Dwc(Umu,Grid,RBGrid,mass,csw_r,csw_t,anis,params);
MdagMLinearOperator<WilsonCloverFermionR,FermionField> HermOp(Dwc);
MdagMLinearOperator<WilsonCloverFermionD,FermionField> HermOp(Dwc);
MinimalResidual<FermionField> MR(1.0e-8,10000,0.8);
MR(HermOp,src,result);

View File

@ -101,7 +101,7 @@ int main(int argc, char** argv) {
omegas.push_back( std::complex<double>(0.0686324988446592,-0.0550658530827402) );
#endif
ZMobiusFermionR Ddwf(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mass, M5, omegas,1.,0.);
ZMobiusFermionD Ddwf(Umu, *FGrid, *FrbGrid, *UGrid, *UrbGrid, mass, M5, omegas,1.,0.);
LatticeFermion src_o(FrbGrid);
LatticeFermion result_o(FrbGrid);
@ -110,7 +110,7 @@ int main(int argc, char** argv) {
GridStopWatch CGTimer;
SchurDiagMooeeOperator<ZMobiusFermionR, LatticeFermion> HermOpEO(Ddwf);
SchurDiagMooeeOperator<ZMobiusFermionD, LatticeFermion> HermOpEO(Ddwf);
ConjugateGradient<LatticeFermion> CG(1.0e-8, 10000, 0);// switch off the assert
CGTimer.Start();
@ -121,7 +121,6 @@ int main(int argc, char** argv) {
<< std::endl;
std::cout << GridLogMessage << "######## Dhop calls summary" << std::endl;
Ddwf.Report();
Grid_finalize();
}