diff --git a/Grid/parallelIO/NerscIO.h b/Grid/parallelIO/NerscIO.h index 99011e25..dabef9e5 100644 --- a/Grid/parallelIO/NerscIO.h +++ b/Grid/parallelIO/NerscIO.h @@ -209,26 +209,27 @@ public: template static inline void writeConfiguration(Lattice &Umu, std::string file, - std::string ens_label = std::string("DWF")) + std::string ens_label = std::string("DWF"), + std::string ens_id = std::string("UKQCD"), + unsigned int sequence_number = 1) { - writeConfiguration(Umu,file,0,1,ens_label); + writeConfiguration(Umu,file,0,1,ens_label,ens_id,sequence_number); } template static inline void writeConfiguration(Lattice &Umu, std::string file, int two_row, int bits32, - std::string ens_label = std::string("DWF")) + std::string ens_label = std::string("DWF"), + std::string ens_id = std::string("UKQCD"), + unsigned int sequence_number = 1) { typedef vLorentzColourMatrixD vobj; typedef typename vobj::scalar_object sobj; FieldMetaData header; - /////////////////////////////////////////// - // Following should become arguments - /////////////////////////////////////////// - header.sequence_number = 1; - header.ensemble_id = std::string("UKQCD"); + header.sequence_number = sequence_number; + header.ensemble_id = ens_id; header.ensemble_label = ens_label; typedef LorentzColourMatrixD fobj3D; diff --git a/Grid/qcd/action/fermion/CayleyFermion5D.h b/Grid/qcd/action/fermion/CayleyFermion5D.h index c7d68d73..3e06aa26 100644 --- a/Grid/qcd/action/fermion/CayleyFermion5D.h +++ b/Grid/qcd/action/fermion/CayleyFermion5D.h @@ -68,9 +68,16 @@ public: /////////////////////////////////////////////////////////////// // Support for MADWF tricks /////////////////////////////////////////////////////////////// - RealD Mass(void) { return mass; }; + RealD Mass(void) { return (mass_plus + mass_minus) / 2.0; }; + RealD MassPlus(void) { return mass_plus; }; + RealD MassMinus(void) { return mass_minus; }; void SetMass(RealD _mass) { - mass=_mass; + mass_plus=mass_minus=_mass; + SetCoefficientsInternal(_zolo_hi,_gamma,_b,_c); // Reset coeffs + } ; + void SetMass(RealD _mass_plus, RealD _mass_minus) { + mass_plus=_mass_plus; + mass_minus=_mass_minus; SetCoefficientsInternal(_zolo_hi,_gamma,_b,_c); // Reset coeffs } ; void P(const FermionField &psi, FermionField &chi); @@ -108,7 +115,7 @@ public: void MeooeDag5D (const FermionField &in, FermionField &out); // protected: - RealD mass; + RealD mass_plus, mass_minus; // Save arguments to SetCoefficientsInternal Vector _gamma; diff --git a/Grid/qcd/action/fermion/implementation/CayleyFermion5DImplementation.h b/Grid/qcd/action/fermion/implementation/CayleyFermion5DImplementation.h index 1e2b13e3..51a7990c 100644 --- a/Grid/qcd/action/fermion/implementation/CayleyFermion5DImplementation.h +++ b/Grid/qcd/action/fermion/implementation/CayleyFermion5DImplementation.h @@ -47,7 +47,7 @@ CayleyFermion5D::CayleyFermion5D(GaugeField &_Umu, FiveDimRedBlackGrid, FourDimGrid, FourDimRedBlackGrid,_M5,p), - mass(_mass) + mass_plus(_mass), mass_minus(_mass) { } @@ -209,8 +209,8 @@ void CayleyFermion5D::M5D (const FermionField &psi, FermionField &chi) { int Ls=this->Ls; Vector diag (Ls,1.0); - Vector upper(Ls,-1.0); upper[Ls-1]=mass; - Vector lower(Ls,-1.0); lower[0] =mass; + Vector upper(Ls,-1.0); upper[Ls-1]=mass_minus; + Vector lower(Ls,-1.0); lower[0] =mass_plus; M5D(psi,chi,chi,lower,diag,upper); } template @@ -220,8 +220,8 @@ void CayleyFermion5D::Meooe5D (const FermionField &psi, FermionField &D Vector diag = bs; Vector upper= cs; Vector lower= cs; - upper[Ls-1]=-mass*upper[Ls-1]; - lower[0] =-mass*lower[0]; + upper[Ls-1]=-mass_minus*upper[Ls-1]; + lower[0] =-mass_plus*lower[0]; M5D(psi,psi,Din,lower,diag,upper); } // FIXME Redunant with the above routine; check this and eliminate @@ -235,8 +235,8 @@ template void CayleyFermion5D::Meo5D (const FermionField & upper[i]=-ceo[i]; lower[i]=-ceo[i]; } - upper[Ls-1]=-mass*upper[Ls-1]; - lower[0] =-mass*lower[0]; + upper[Ls-1]=-mass_minus*upper[Ls-1]; + lower[0] =-mass_plus*lower[0]; M5D(psi,psi,chi,lower,diag,upper); } template @@ -250,8 +250,8 @@ void CayleyFermion5D::Mooee (const FermionField &psi, FermionField & upper[i]=-cee[i]; lower[i]=-cee[i]; } - upper[Ls-1]=-mass*upper[Ls-1]; - lower[0] =-mass*lower[0]; + upper[Ls-1]=-mass_minus*upper[Ls-1]; + lower[0] =-mass_plus*lower[0]; M5D(psi,psi,chi,lower,diag,upper); } template @@ -266,9 +266,9 @@ void CayleyFermion5D::MooeeDag (const FermionField &psi, FermionField & // Assemble the 5d matrix if ( s==0 ) { upper[s] = -cee[s+1] ; - lower[s] = mass*cee[Ls-1]; + lower[s] = mass_minus*cee[Ls-1]; } else if ( s==(Ls-1)) { - upper[s] = mass*cee[0]; + upper[s] = mass_plus*cee[0]; lower[s] = -cee[s-1]; } else { upper[s]=-cee[s+1]; @@ -291,8 +291,8 @@ void CayleyFermion5D::M5Ddag (const FermionField &psi, FermionField &chi) Vector diag(Ls,1.0); Vector upper(Ls,-1.0); Vector lower(Ls,-1.0); - upper[Ls-1]=-mass*upper[Ls-1]; - lower[0] =-mass*lower[0]; + upper[Ls-1]=-mass_plus*upper[Ls-1]; + lower[0] =-mass_minus*lower[0]; M5Ddag(psi,chi,chi,lower,diag,upper); } @@ -307,9 +307,9 @@ void CayleyFermion5D::MeooeDag5D (const FermionField &psi, FermionField for (int s=0;s::SetCoefficientsInternal(RealD zolo_hi,Vector::SetCoefficientsInternal(RealD zolo_hi,Vector::SetCoefficientsInternal(RealD zolo_hi,Vector::ContractConservedCurrent( PropagatorField &q_in_1, Current curr_type, unsigned int mu) { + + assert(mass_plus == mass_minus); + RealD mass = mass_plus; + #if (!defined(GRID_HIP)) Gamma::Algebra Gmu [] = { Gamma::Algebra::GammaX, @@ -777,6 +781,8 @@ void CayleyFermion5D::SeqConservedCurrent(PropagatorField &q_in, assert(mu>=0); assert(mu::CompactWilsonCloverFermion(Gaug csw_r /= clover_anisotropy.xi_0; ImportGauge(_Umu); - if (open_boundaries) + if (open_boundaries) { + this->BoundaryMaskEven.Checkerboard() = Even; + this->BoundaryMaskOdd.Checkerboard() = Odd; CompactHelpers::SetupMasks(this->BoundaryMask, this->BoundaryMaskEven, this->BoundaryMaskOdd); + } } template diff --git a/benchmarks/Benchmark_mooee.cc b/benchmarks/Benchmark_mooee.cc index 0aaccecc..289af41d 100644 --- a/benchmarks/Benchmark_mooee.cc +++ b/benchmarks/Benchmark_mooee.cc @@ -81,8 +81,8 @@ int main (int argc, char ** argv) Vector diag = Dw.bs; Vector upper= Dw.cs; Vector lower= Dw.cs; - upper[Ls-1]=-Dw.mass*upper[Ls-1]; - lower[0] =-Dw.mass*lower[0]; + upper[Ls-1]=-Dw.mass_minus*upper[Ls-1]; + lower[0] =-Dw.mass_plus*lower[0]; LatticeFermion r_eo(FGrid); LatticeFermion src_e (FrbGrid);