From b00d2d2c39f8fdc976446072faaa884e8596b777 Mon Sep 17 00:00:00 2001 From: Guido Cossu Date: Wed, 17 Jan 2018 13:46:12 +0000 Subject: [PATCH] Correction of Representations compilation and small compilation error for Intel 17 --- lib/qcd/action/fermion/FermionOperatorImpl.h | 89 +++++++++++--------- lib/qcd/action/fermion/WilsonFermion.cc | 4 +- lib/qcd/action/fermion/WilsonFermion5D.cc | 4 +- lib/qcd/action/fermion/WilsonKernels.h | 8 +- lib/qcd/representations/adjoint.h | 1 + lib/qcd/representations/fundamental.h | 1 + lib/qcd/representations/two_index.h | 1 + 7 files changed, 58 insertions(+), 50 deletions(-) diff --git a/lib/qcd/action/fermion/FermionOperatorImpl.h b/lib/qcd/action/fermion/FermionOperatorImpl.h index 2b900569..c21a07ee 100644 --- a/lib/qcd/action/fermion/FermionOperatorImpl.h +++ b/lib/qcd/action/fermion/FermionOperatorImpl.h @@ -164,6 +164,7 @@ namespace QCD { public: static const int Dimension = Representation::Dimension; + static const bool isFundamental = Representation::isFundamental; static const bool LsVectorised=false; static const int Nhcs = Options::Nhcs; @@ -298,27 +299,28 @@ namespace QCD { //////////////////////////////////////////////////////////////////////////////////// // Single flavour four spinors with colour index, 5d redblack //////////////////////////////////////////////////////////////////////////////////// -template -class DomainWallVec5dImpl : public PeriodicGaugeImpl< GaugeImplTypes< S,Nrepresentation> > { +template +class DomainWallVec5dImpl : public PeriodicGaugeImpl< GaugeImplTypes< S,Representation::Dimension> > { public: - typedef PeriodicGaugeImpl > Gimpl; + typedef PeriodicGaugeImpl > Gimpl; INHERIT_GIMPL_TYPES(Gimpl); - static const int Dimension = Nrepresentation; + static const int Dimension = Representation::Dimension; + static const bool isFundamental = Representation::isFundamental; static const bool LsVectorised=true; static const int Nhcs = Options::Nhcs; typedef typename Options::_Coeff_t Coeff_t; typedef typename Options::template PrecisionMapper::LowerPrecVector SimdL; - template using iImplSpinor = iScalar, Ns> >; - template using iImplPropagator = iScalar, Ns> >; - template using iImplHalfSpinor = iScalar, Nhs> >; - template using iImplHalfCommSpinor = iScalar, Nhcs> >; - template using iImplDoubledGaugeField = iVector >, Nds>; - template using iImplGaugeField = iVector >, Nd>; - template using iImplGaugeLink = iScalar > >; + template using iImplSpinor = iScalar, Ns> >; + template using iImplPropagator = iScalar, Ns> >; + template using iImplHalfSpinor = iScalar, Nhs> >; + template using iImplHalfCommSpinor = iScalar, Nhcs> >; + template using iImplDoubledGaugeField = iVector >, Nds>; + template using iImplGaugeField = iVector >, Nd>; + template using iImplGaugeLink = iScalar > >; typedef iImplSpinor SiteSpinor; typedef iImplPropagator SitePropagator; @@ -354,8 +356,8 @@ class DomainWallVec5dImpl : public PeriodicGaugeImpl< GaugeImplTypes< S,Nrepres const SiteHalfSpinor &chi, int mu, StencilEntry *SE, StencilImpl &St) { SiteGaugeLink UU; - for (int i = 0; i < Nrepresentation; i++) { - for (int j = 0; j < Nrepresentation; j++) { + for (int i = 0; i < Dimension; i++) { + for (int j = 0; j < Dimension; j++) { vsplat(UU()()(i, j), U(mu)()(i, j)); } } @@ -367,8 +369,8 @@ class DomainWallVec5dImpl : public PeriodicGaugeImpl< GaugeImplTypes< S,Nrepres const SitePropagator &chi, int mu) { SiteGaugeLink UU; - for (int i = 0; i < Nrepresentation; i++) { - for (int j = 0; j < Nrepresentation; j++) { + for (int i = 0; i < Dimension; i++) { + for (int j = 0; j < Dimension; j++) { vsplat(UU()()(i, j), U(mu)()(i, j)); } } @@ -472,25 +474,26 @@ class DomainWallVec5dImpl : public PeriodicGaugeImpl< GaugeImplTypes< S,Nrepres //////////////////////////////////////////////////////////////////////////////////////// // Flavour doubled spinors; is Gparity the only? what about C*? //////////////////////////////////////////////////////////////////////////////////////// -template -class GparityWilsonImpl : public ConjugateGaugeImpl > { +template +class GparityWilsonImpl : public ConjugateGaugeImpl > { public: - static const int Dimension = Nrepresentation; + static const int Dimension = Representation::Dimension; + static const bool isFundamental = Representation::isFundamental; static const int Nhcs = Options::Nhcs; static const bool LsVectorised=false; - typedef ConjugateGaugeImpl< GaugeImplTypes > Gimpl; + typedef ConjugateGaugeImpl< GaugeImplTypes > Gimpl; INHERIT_GIMPL_TYPES(Gimpl); typedef typename Options::_Coeff_t Coeff_t; typedef typename Options::template PrecisionMapper::LowerPrecVector SimdL; - template using iImplSpinor = iVector, Ns>, Ngp>; - template using iImplPropagator = iVector, Ns>, Ngp>; - template using iImplHalfSpinor = iVector, Nhs>, Ngp>; - template using iImplHalfCommSpinor = iVector, Nhcs>, Ngp>; - template using iImplDoubledGaugeField = iVector >, Nds>, Ngp>; + template using iImplSpinor = iVector, Ns>, Ngp>; + template using iImplPropagator = iVector, Ns>, Ngp>; + template using iImplHalfSpinor = iVector, Nhs>, Ngp>; + template using iImplHalfCommSpinor = iVector, Nhcs>, Ngp>; + template using iImplDoubledGaugeField = iVector >, Nds>, Ngp>; typedef iImplSpinor SiteSpinor; typedef iImplPropagator SitePropagator; @@ -711,6 +714,7 @@ class StaggeredImpl : public PeriodicGaugeImpl > Gimpl; @@ -839,6 +843,7 @@ class StaggeredImpl : public PeriodicGaugeImpl > Gimpl; @@ -1033,29 +1038,29 @@ typedef WilsonImpl W typedef WilsonImpl WilsonTwoIndexAntiSymmetricImplF; // Float typedef WilsonImpl WilsonTwoIndexAntiSymmetricImplD; // Double -typedef DomainWallVec5dImpl DomainWallVec5dImplR; // Real.. whichever prec -typedef DomainWallVec5dImpl DomainWallVec5dImplF; // Float -typedef DomainWallVec5dImpl DomainWallVec5dImplD; // Double +typedef DomainWallVec5dImpl DomainWallVec5dImplR; // Real.. whichever prec +typedef DomainWallVec5dImpl DomainWallVec5dImplF; // Float +typedef DomainWallVec5dImpl DomainWallVec5dImplD; // Double -typedef DomainWallVec5dImpl DomainWallVec5dImplRL; // Real.. whichever prec -typedef DomainWallVec5dImpl DomainWallVec5dImplFH; // Float -typedef DomainWallVec5dImpl DomainWallVec5dImplDF; // Double +typedef DomainWallVec5dImpl DomainWallVec5dImplRL; // Real.. whichever prec +typedef DomainWallVec5dImpl DomainWallVec5dImplFH; // Float +typedef DomainWallVec5dImpl DomainWallVec5dImplDF; // Double -typedef DomainWallVec5dImpl ZDomainWallVec5dImplR; // Real.. whichever prec -typedef DomainWallVec5dImpl ZDomainWallVec5dImplF; // Float -typedef DomainWallVec5dImpl ZDomainWallVec5dImplD; // Double +typedef DomainWallVec5dImpl ZDomainWallVec5dImplR; // Real.. whichever prec +typedef DomainWallVec5dImpl ZDomainWallVec5dImplF; // Float +typedef DomainWallVec5dImpl ZDomainWallVec5dImplD; // Double -typedef DomainWallVec5dImpl ZDomainWallVec5dImplRL; // Real.. whichever prec -typedef DomainWallVec5dImpl ZDomainWallVec5dImplFH; // Float -typedef DomainWallVec5dImpl ZDomainWallVec5dImplDF; // Double +typedef DomainWallVec5dImpl ZDomainWallVec5dImplRL; // Real.. whichever prec +typedef DomainWallVec5dImpl ZDomainWallVec5dImplFH; // Float +typedef DomainWallVec5dImpl ZDomainWallVec5dImplDF; // Double -typedef GparityWilsonImpl GparityWilsonImplR; // Real.. whichever prec -typedef GparityWilsonImpl GparityWilsonImplF; // Float -typedef GparityWilsonImpl GparityWilsonImplD; // Double +typedef GparityWilsonImpl GparityWilsonImplR; // Real.. whichever prec +typedef GparityWilsonImpl GparityWilsonImplF; // Float +typedef GparityWilsonImpl GparityWilsonImplD; // Double -typedef GparityWilsonImpl GparityWilsonImplRL; // Real.. whichever prec -typedef GparityWilsonImpl GparityWilsonImplFH; // Float -typedef GparityWilsonImpl GparityWilsonImplDF; // Double +typedef GparityWilsonImpl GparityWilsonImplRL; // Real.. whichever prec +typedef GparityWilsonImpl GparityWilsonImplFH; // Float +typedef GparityWilsonImpl GparityWilsonImplDF; // Double typedef StaggeredImpl StaggeredImplR; // Real.. whichever prec typedef StaggeredImpl StaggeredImplF; // Float diff --git a/lib/qcd/action/fermion/WilsonFermion.cc b/lib/qcd/action/fermion/WilsonFermion.cc index 2336f4b6..dfaa6758 100644 --- a/lib/qcd/action/fermion/WilsonFermion.cc +++ b/lib/qcd/action/fermion/WilsonFermion.cc @@ -419,7 +419,7 @@ void WilsonFermion::SeqConservedCurrent(PropagatorField &q_in, conformable(_grid, q_in._grid); conformable(_grid, q_out._grid); Lattice> ph(_grid), coor(_grid); - Complex i(0.0,1.0); + ComplexD i(0.0,1.0); PropagatorField tmpFwd(_grid), tmpBwd(_grid), tmp(_grid); unsigned int tshift = (mu == Tp) ? 1 : 0; unsigned int LLt = GridDefaultLatt()[Tp]; @@ -431,7 +431,7 @@ void WilsonFermion::SeqConservedCurrent(PropagatorField &q_in, LatticeCoordinate(coor, mu); ph = ph + mom[mu]*coor*((1./(_grid->_fdimensions[mu]))); } - ph = exp((Real)(2*M_PI)*i*ph); + ph = exp((RealD)(2*M_PI)*i*ph); q_out = zero; LatticeInteger coords(_grid); diff --git a/lib/qcd/action/fermion/WilsonFermion5D.cc b/lib/qcd/action/fermion/WilsonFermion5D.cc index 393ee7f3..3e58fed6 100644 --- a/lib/qcd/action/fermion/WilsonFermion5D.cc +++ b/lib/qcd/action/fermion/WilsonFermion5D.cc @@ -793,7 +793,7 @@ void WilsonFermion5D::SeqConservedCurrent(PropagatorField &q_in, Lattice> ph(FermionGrid()), coor(FermionGrid()); PropagatorField tmpFwd(FermionGrid()), tmpBwd(FermionGrid()), tmp(FermionGrid()); - Complex i(0.0, 1.0); + ComplexD i(0.0, 1.0); unsigned int tshift = (mu == Tp) ? 1 : 0; unsigned int LLs = q_in._grid->_rdimensions[0]; unsigned int LLt = GridDefaultLatt()[Tp]; @@ -806,7 +806,7 @@ void WilsonFermion5D::SeqConservedCurrent(PropagatorField &q_in, LatticeCoordinate(coor, nu + 1); ph = ph + mom[nu]*coor*((1./(_FourDimGrid->_fdimensions[nu]))); } - ph = exp((Real)(2*M_PI)*i*ph); + ph = exp((RealD)(2*M_PI)*i*ph); q_out = zero; LatticeInteger coords(_FourDimGrid); diff --git a/lib/qcd/action/fermion/WilsonKernels.h b/lib/qcd/action/fermion/WilsonKernels.h index ed8d6be9..2369c98d 100644 --- a/lib/qcd/action/fermion/WilsonKernels.h +++ b/lib/qcd/action/fermion/WilsonKernels.h @@ -55,7 +55,7 @@ template class WilsonKernels : public FermionOperator , public public: template - typename std::enable_if::type + typename std::enable_if::type DhopSite(StencilImpl &st, LebesgueOrder &lo, DoubledGaugeField &U, SiteHalfSpinor * buf, int sF, int sU, int Ls, int Ns, const FermionField &in, FermionField &out,int interior=1,int exterior=1) { @@ -99,7 +99,7 @@ public: } template - typename std::enable_if<(Impl::Dimension != 3 || (Impl::Dimension == 3 && Nc != 3)) && EnableBool, void>::type + typename std::enable_if<(Impl::isFundamental==false || (Impl::isFundamental==true && Nc != 3)) && EnableBool, void>::type DhopSite(StencilImpl &st, LebesgueOrder &lo, DoubledGaugeField &U, SiteHalfSpinor * buf, int sF, int sU, int Ls, int Ns, const FermionField &in, FermionField &out,int interior=1,int exterior=1 ) { // no kernel choice @@ -116,7 +116,7 @@ public: } template - typename std::enable_if::type + typename std::enable_if::type DhopSiteDag(StencilImpl &st, LebesgueOrder &lo, DoubledGaugeField &U, SiteHalfSpinor * buf, int sF, int sU, int Ls, int Ns, const FermionField &in, FermionField &out,int interior=1,int exterior=1) { @@ -161,7 +161,7 @@ public: } template - typename std::enable_if<(Impl::Dimension != 3 || (Impl::Dimension == 3 && Nc != 3)) && EnableBool,void>::type + typename std::enable_if<(Impl::isFundamental==false || (Impl::isFundamental==true && Nc != 3)) && EnableBool,void>::type DhopSiteDag(StencilImpl &st, LebesgueOrder &lo, DoubledGaugeField &U,SiteHalfSpinor * buf, int sF, int sU, int Ls, int Ns, const FermionField &in, FermionField &out,int interior=1,int exterior=1) { diff --git a/lib/qcd/representations/adjoint.h b/lib/qcd/representations/adjoint.h index 078d12a1..052cd7a8 100644 --- a/lib/qcd/representations/adjoint.h +++ b/lib/qcd/representations/adjoint.h @@ -23,6 +23,7 @@ class AdjointRep { typedef typename SU_Adjoint::LatticeAdjMatrix LatticeMatrix; typedef typename SU_Adjoint::LatticeAdjField LatticeField; static const int Dimension = ncolour * ncolour - 1; + static const bool isFundamental = false; LatticeField U; diff --git a/lib/qcd/representations/fundamental.h b/lib/qcd/representations/fundamental.h index db52d893..9f039a07 100644 --- a/lib/qcd/representations/fundamental.h +++ b/lib/qcd/representations/fundamental.h @@ -19,6 +19,7 @@ template class FundamentalRep { public: static const int Dimension = ncolour; + static const bool isFundamental = true; // typdef to be used by the Representations class in HMC to get the // types for the higher representation fields diff --git a/lib/qcd/representations/two_index.h b/lib/qcd/representations/two_index.h index 082a52a5..2c7e8b3a 100644 --- a/lib/qcd/representations/two_index.h +++ b/lib/qcd/representations/two_index.h @@ -29,6 +29,7 @@ class TwoIndexRep { typedef typename SU_TwoIndex::LatticeTwoIndexMatrix LatticeMatrix; typedef typename SU_TwoIndex::LatticeTwoIndexField LatticeField; static const int Dimension = ncolour * (ncolour + S) / 2; + static const bool isFundamental = false; LatticeField U;