mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-15 14:27:06 +01:00
_grid becomes private ; use Grid()§
This commit is contained in:
@ -238,7 +238,7 @@ void CayleyFermion5D<Impl>::MeooeDag5D (const FermionField &psi, FermionField
|
||||
template<class Impl>
|
||||
RealD CayleyFermion5D<Impl>::M (const FermionField &psi, FermionField &chi)
|
||||
{
|
||||
FermionField Din(psi._grid);
|
||||
FermionField Din(psi.Grid());
|
||||
|
||||
// Assemble Din
|
||||
Meooe5D(psi,Din);
|
||||
@ -258,7 +258,7 @@ RealD CayleyFermion5D<Impl>::Mdag (const FermionField &psi, FermionField &chi)
|
||||
//D1+ D1- P- -> D1+^dag P+ D2-^dag
|
||||
//D2- P+ D2+ P-D1-^dag D2+dag
|
||||
|
||||
FermionField Din(psi._grid);
|
||||
FermionField Din(psi.Grid());
|
||||
// Apply Dw
|
||||
this->DW(psi,Din,DaggerYes);
|
||||
|
||||
@ -305,7 +305,7 @@ void CayleyFermion5D<Impl>::Mdir (const FermionField &psi, FermionField &chi,in
|
||||
template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MDeriv (GaugeField &mat,const FermionField &U,const FermionField &V,int dag)
|
||||
{
|
||||
FermionField Din(V._grid);
|
||||
FermionField Din(V.Grid());
|
||||
|
||||
if ( dag == DaggerNo ) {
|
||||
// U d/du [D_w D5] V = U d/du DW D5 V
|
||||
@ -320,7 +320,7 @@ void CayleyFermion5D<Impl>::MDeriv (GaugeField &mat,const FermionField &U,const
|
||||
template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MoeDeriv(GaugeField &mat,const FermionField &U,const FermionField &V,int dag)
|
||||
{
|
||||
FermionField Din(V._grid);
|
||||
FermionField Din(V.Grid());
|
||||
|
||||
if ( dag == DaggerNo ) {
|
||||
// U d/du [D_w D5] V = U d/du DW D5 V
|
||||
@ -335,7 +335,7 @@ void CayleyFermion5D<Impl>::MoeDeriv(GaugeField &mat,const FermionField &U,const
|
||||
template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MeoDeriv(GaugeField &mat,const FermionField &U,const FermionField &V,int dag)
|
||||
{
|
||||
FermionField Din(V._grid);
|
||||
FermionField Din(V.Grid());
|
||||
|
||||
if ( dag == DaggerNo ) {
|
||||
// U d/du [D_w D5] V = U d/du DW D5 V
|
||||
|
@ -46,7 +46,7 @@ void CayleyFermion5D<Impl>::M5D(const FermionField &psi,
|
||||
std::vector<Coeff_t> &upper)
|
||||
{
|
||||
int Ls =this->Ls;
|
||||
GridBase *grid=psi._grid;
|
||||
GridBase *grid=psi.Grid();
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard()=psi.Checkerboard();
|
||||
// Flops = 6.0*(Nc*Ns) *Ls*vol
|
||||
@ -89,7 +89,7 @@ void CayleyFermion5D<Impl>::M5Ddag(const FermionField &psi,
|
||||
std::vector<Coeff_t> &upper)
|
||||
{
|
||||
int Ls =this->Ls;
|
||||
GridBase *grid=psi._grid;
|
||||
GridBase *grid=psi.Grid();
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard()=psi.Checkerboard();
|
||||
|
||||
@ -127,7 +127,7 @@ void CayleyFermion5D<Impl>::M5Ddag(const FermionField &psi,
|
||||
template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MooeeInv (const FermionField &psi, FermionField &chi)
|
||||
{
|
||||
GridBase *grid=psi._grid;
|
||||
GridBase *grid=psi.Grid();
|
||||
int Ls=this->Ls;
|
||||
|
||||
chi.Checkerboard()=psi.Checkerboard();
|
||||
@ -172,7 +172,7 @@ void CayleyFermion5D<Impl>::MooeeInv (const FermionField &psi, FermionField &
|
||||
template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MooeeInvDag (const FermionField &psi, FermionField &chi)
|
||||
{
|
||||
GridBase *grid=psi._grid;
|
||||
GridBase *grid=psi.Grid();
|
||||
int Ls=this->Ls;
|
||||
|
||||
assert(psi.Checkerboard() == psi.Checkerboard());
|
||||
|
@ -54,8 +54,8 @@ template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MooeeInternal(const FermionField &psi, FermionField &chi,int dag, int inv)
|
||||
{
|
||||
int Ls=this->Ls;
|
||||
int LLs = psi._grid->_rdimensions[0];
|
||||
int vol = psi._grid->oSites()/LLs;
|
||||
int LLs = psi.Grid()->_rdimensions[0];
|
||||
int vol = psi.Grid()->oSites()/LLs;
|
||||
|
||||
chi.Checkerboard()=psi.Checkerboard();
|
||||
|
||||
|
@ -58,7 +58,7 @@ void CayleyFermion5D<Impl>::M5D(const FermionField &psi,
|
||||
std::vector<Coeff_t> &diag,
|
||||
std::vector<Coeff_t> &upper)
|
||||
{
|
||||
GridBase *grid=psi._grid;
|
||||
GridBase *grid=psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
const int nsimd= Simd::Nsimd();
|
||||
@ -202,7 +202,7 @@ void CayleyFermion5D<Impl>::M5Ddag(const FermionField &psi,
|
||||
std::vector<Coeff_t> &diag,
|
||||
std::vector<Coeff_t> &upper)
|
||||
{
|
||||
GridBase *grid=psi._grid;
|
||||
GridBase *grid=psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
int nsimd= Simd::Nsimd();
|
||||
@ -762,8 +762,8 @@ template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MooeeInternal(const FermionField &psi, FermionField &chi,int dag, int inv)
|
||||
{
|
||||
int Ls=this->Ls;
|
||||
int LLs = psi._grid->_rdimensions[0];
|
||||
int vol = psi._grid->oSites()/LLs;
|
||||
int LLs = psi.Grid()->_rdimensions[0];
|
||||
int vol = psi.Grid()->oSites()/LLs;
|
||||
|
||||
chi.Checkerboard()=psi.Checkerboard();
|
||||
|
||||
|
@ -96,7 +96,7 @@ RealD ContinuedFractionFermion5D<Impl>::M (const FermionField &psi, F
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(psi._grid);
|
||||
FermionField D(psi.Grid());
|
||||
|
||||
this->DW(psi,D,DaggerNo);
|
||||
|
||||
@ -226,7 +226,7 @@ void ContinuedFractionFermion5D<Impl>::MDeriv (GaugeField &mat,const FermionFie
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(V._grid);
|
||||
FermionField D(V.Grid());
|
||||
|
||||
int sign=1;
|
||||
for(int s=0;s<Ls;s++){
|
||||
@ -244,7 +244,7 @@ void ContinuedFractionFermion5D<Impl>::MoeDeriv(GaugeField &mat,const FermionFie
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(V._grid);
|
||||
FermionField D(V.Grid());
|
||||
|
||||
int sign=1;
|
||||
for(int s=0;s<Ls;s++){
|
||||
@ -262,7 +262,7 @@ void ContinuedFractionFermion5D<Impl>::MeoDeriv(GaugeField &mat,const FermionFie
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(V._grid);
|
||||
FermionField D(V.Grid());
|
||||
|
||||
int sign=1;
|
||||
for(int s=0;s<Ls;s++){
|
||||
|
@ -89,7 +89,7 @@ void DomainWallEOFAFermion<Impl>::DtildeInv(const FermionField& psi, FermionFiel
|
||||
template<class Impl>
|
||||
RealD DomainWallEOFAFermion<Impl>::M(const FermionField& psi, FermionField& chi)
|
||||
{
|
||||
FermionField Din(psi._grid);
|
||||
FermionField Din(psi.Grid());
|
||||
|
||||
this->Meooe5D(psi, Din);
|
||||
this->DW(Din, chi, DaggerNo);
|
||||
@ -101,7 +101,7 @@ RealD DomainWallEOFAFermion<Impl>::M(const FermionField& psi, FermionField& chi)
|
||||
template<class Impl>
|
||||
RealD DomainWallEOFAFermion<Impl>::Mdag(const FermionField& psi, FermionField& chi)
|
||||
{
|
||||
FermionField Din(psi._grid);
|
||||
FermionField Din(psi.Grid());
|
||||
|
||||
this->DW(psi, Din, DaggerYes);
|
||||
this->MeooeDag5D(Din, chi);
|
||||
|
@ -44,7 +44,7 @@ void DomainWallEOFAFermion<Impl>::M5D(const FermionField& psi, const FermionFiel
|
||||
FermionField& chi, std::vector<Coeff_t>& lower, std::vector<Coeff_t>& diag, std::vector<Coeff_t>& upper)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -82,7 +82,7 @@ void DomainWallEOFAFermion<Impl>::M5Ddag(const FermionField& psi, const FermionF
|
||||
FermionField& chi, std::vector<Coeff_t>& lower, std::vector<Coeff_t>& diag, std::vector<Coeff_t>& upper)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard()=psi.Checkerboard();
|
||||
|
||||
@ -118,7 +118,7 @@ void DomainWallEOFAFermion<Impl>::M5Ddag(const FermionField& psi, const FermionF
|
||||
template<class Impl>
|
||||
void DomainWallEOFAFermion<Impl>::MooeeInv(const FermionField& psi, FermionField& chi)
|
||||
{
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -166,7 +166,7 @@ void DomainWallEOFAFermion<Impl>::MooeeInv(const FermionField& psi, FermionField
|
||||
template<class Impl>
|
||||
void DomainWallEOFAFermion<Impl>::MooeeInvDag(const FermionField& psi, FermionField& chi)
|
||||
{
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
|
||||
assert(psi.Checkerboard() == psi.Checkerboard());
|
||||
|
@ -55,8 +55,8 @@ template<class Impl>
|
||||
void DomainWallEOFAFermion<Impl>::MooeeInternal(const FermionField& psi, FermionField& chi, int dag, int inv)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
int LLs = psi._grid->_rdimensions[0];
|
||||
int vol = psi._grid->oSites()/LLs;
|
||||
int LLs = psi.Grid()->_rdimensions[0];
|
||||
int vol = psi.Grid()->oSites()/LLs;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
|
||||
|
@ -86,7 +86,7 @@ void DomainWallEOFAFermion<Impl>::MooeeInv(const FermionField& psi, FermionField
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField tmp(psi._grid);
|
||||
FermionField tmp(psi.Grid());
|
||||
|
||||
// Apply (L^{\prime})^{-1}
|
||||
axpby_ssp(chi, one, psi, czero, psi, 0, 0); // chi[0]=psi[0]
|
||||
@ -120,7 +120,7 @@ void DomainWallEOFAFermion<Impl>::MooeeInvDag(const FermionField& psi, FermionFi
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField tmp(psi._grid);
|
||||
FermionField tmp(psi.Grid());
|
||||
|
||||
// Apply (U^{\prime})^{-dagger}
|
||||
axpby_ssp(chi, one, psi, czero, psi, 0, 0); // chi[0]=psi[0]
|
||||
|
@ -55,7 +55,7 @@ template<class Impl>
|
||||
void DomainWallEOFAFermion<Impl>::M5D(const FermionField& psi, const FermionField& phi,
|
||||
FermionField& chi, std::vector<Coeff_t>& lower, std::vector<Coeff_t>& diag, std::vector<Coeff_t>& upper)
|
||||
{
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
const int nsimd = Simd::Nsimd();
|
||||
@ -200,7 +200,7 @@ template<class Impl>
|
||||
void DomainWallEOFAFermion<Impl>::M5Ddag(const FermionField& psi, const FermionField& phi,
|
||||
FermionField& chi, std::vector<Coeff_t>& lower, std::vector<Coeff_t>& diag, std::vector<Coeff_t>& upper)
|
||||
{
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
int nsimd = Simd::Nsimd();
|
||||
@ -533,8 +533,8 @@ template<class Impl>
|
||||
void DomainWallEOFAFermion<Impl>::MooeeInternal(const FermionField& psi, FermionField& chi, int dag, int inv)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
int LLs = psi._grid->_rdimensions[0];
|
||||
int vol = psi._grid->oSites()/LLs;
|
||||
int LLs = psi.Grid()->_rdimensions[0];
|
||||
int vol = psi.Grid()->oSites()/LLs;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
|
||||
|
@ -96,10 +96,10 @@ public:
|
||||
virtual void MomentumSpacePropagator(FermionField &out,const FermionField &in,RealD _m) { assert(0);};
|
||||
|
||||
virtual void FreePropagator(const FermionField &in,FermionField &out,RealD mass) {
|
||||
FFT theFFT((GridCartesian *) in._grid);
|
||||
FFT theFFT((GridCartesian *) in.Grid());
|
||||
|
||||
FermionField in_k(in._grid);
|
||||
FermionField prop_k(in._grid);
|
||||
FermionField in_k(in.Grid());
|
||||
FermionField prop_k(in.Grid());
|
||||
|
||||
theFFT.FFT_all_dim(in_k,in,FFT::forward);
|
||||
this->MomentumSpacePropagator(prop_k,in_k,mass);
|
||||
|
@ -230,8 +230,8 @@ public:
|
||||
{
|
||||
typedef typename Simd::scalar_type scalar_type;
|
||||
|
||||
conformable(Uds._grid, GaugeGrid);
|
||||
conformable(Umu._grid, GaugeGrid);
|
||||
conformable(Uds.Grid(), GaugeGrid);
|
||||
conformable(Umu.Grid(), GaugeGrid);
|
||||
|
||||
GaugeLinkField U(GaugeGrid);
|
||||
GaugeLinkField tmp(GaugeGrid);
|
||||
@ -257,18 +257,18 @@ public:
|
||||
}
|
||||
|
||||
inline void InsertForce4D(GaugeField &mat, FermionField &Btilde, FermionField &A,int mu){
|
||||
GaugeLinkField link(mat._grid);
|
||||
GaugeLinkField link(mat.Grid());
|
||||
link = TraceIndex<SpinIndex>(outerProduct(Btilde,A));
|
||||
PokeIndex<LorentzIndex>(mat,link,mu);
|
||||
}
|
||||
|
||||
inline void InsertForce5D(GaugeField &mat, FermionField &Btilde, FermionField Ã,int mu){
|
||||
|
||||
int Ls=Btilde._grid->_fdimensions[0];
|
||||
GaugeLinkField tmp(mat._grid);
|
||||
int Ls=Btilde.Grid()->_fdimensions[0];
|
||||
GaugeLinkField tmp(mat.Grid());
|
||||
tmp = zero;
|
||||
|
||||
parallel_for(int sss=0;sss<tmp._grid->oSites();sss++){
|
||||
parallel_for(int sss=0;sss<tmp.Grid()->oSites();sss++){
|
||||
int sU=sss;
|
||||
for(int s=0;s<Ls;s++){
|
||||
int sF = s+Ls*sU;
|
||||
@ -365,8 +365,8 @@ public:
|
||||
SiteScalarGaugeField ScalarUmu;
|
||||
SiteDoubledGaugeField ScalarUds;
|
||||
|
||||
GaugeLinkField U(Umu._grid);
|
||||
GaugeField Uadj(Umu._grid);
|
||||
GaugeLinkField U(Umu.Grid());
|
||||
GaugeField Uadj(Umu.Grid());
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
U = PeekIndex<LorentzIndex>(Umu, mu);
|
||||
U = adj(Cshift(U, mu, -1));
|
||||
@ -399,10 +399,10 @@ public:
|
||||
// missing put lane...
|
||||
/*
|
||||
typedef decltype(traceIndex<SpinIndex>(outerProduct(Btilde[0], Atilde[0]))) result_type;
|
||||
unsigned int LLs = Btilde._grid->_rdimensions[0];
|
||||
conformable(Atilde._grid,Btilde._grid);
|
||||
GridBase* grid = mat._grid;
|
||||
GridBase* Bgrid = Btilde._grid;
|
||||
unsigned int LLs = Btilde.Grid()->_rdimensions[0];
|
||||
conformable(Atilde.Grid(),Btilde.Grid());
|
||||
GridBase* grid = mat.Grid();
|
||||
GridBase* Bgrid = Btilde.Grid();
|
||||
unsigned int dimU = grid->Nd();
|
||||
unsigned int dimF = Bgrid->Nd();
|
||||
GaugeLinkField tmp(grid);
|
||||
@ -416,7 +416,7 @@ public:
|
||||
for (int so = 0; so < grid->oSites(); so++) {
|
||||
std::vector<typename result_type::scalar_object> vres(Bgrid->Nsimd());
|
||||
std::vector<int> ocoor; grid->oCoorFromOindex(ocoor,so);
|
||||
for (int si = 0; si < tmp._grid->iSites(); si++){
|
||||
for (int si = 0; si < tmp.Grid()->iSites(); si++){
|
||||
typename result_type::scalar_object scalar_object; scalar_object = zero;
|
||||
std::vector<int> local_coor;
|
||||
std::vector<int> icoor; grid->iCoorFromIindex(icoor,si);
|
||||
@ -496,14 +496,14 @@ public:
|
||||
vobj vtmp;
|
||||
sobj stmp;
|
||||
|
||||
GridBase *grid = St._grid;
|
||||
GridBase *grid = St.Grid();
|
||||
|
||||
const int Nsimd = grid->Nsimd();
|
||||
|
||||
int direction = St._directions[mu];
|
||||
int distance = St._distances[mu];
|
||||
int ptype = St._permute_type[mu];
|
||||
int sl = St._grid->_simd_layout[direction];
|
||||
int sl = St.Grid()->_simd_layout[direction];
|
||||
|
||||
// Fixme X.Y.Z.T hardcode in stencil
|
||||
int mmu = mu % Nd;
|
||||
@ -569,8 +569,8 @@ public:
|
||||
|
||||
inline void DoubleStore(GridBase *GaugeGrid,DoubledGaugeField &Uds,const GaugeField &Umu)
|
||||
{
|
||||
conformable(Uds._grid,GaugeGrid);
|
||||
conformable(Umu._grid,GaugeGrid);
|
||||
conformable(Uds.Grid(),GaugeGrid);
|
||||
conformable(Umu.Grid(),GaugeGrid);
|
||||
|
||||
GaugeLinkField Utmp (GaugeGrid);
|
||||
GaugeLinkField U (GaugeGrid);
|
||||
@ -624,7 +624,7 @@ public:
|
||||
inline void InsertForce4D(GaugeField &mat, FermionField &Btilde, FermionField &A, int mu) {
|
||||
|
||||
// DhopDir provides U or Uconj depending on coor/flavour.
|
||||
GaugeLinkField link(mat._grid);
|
||||
GaugeLinkField link(mat.Grid());
|
||||
// use lorentz for flavour as hack.
|
||||
auto tmp = TraceIndex<SpinIndex>(outerProduct(Btilde, A));
|
||||
parallel_for(auto ss = tmp.begin(); ss < tmp.end(); ss++) {
|
||||
@ -636,11 +636,11 @@ public:
|
||||
|
||||
inline void InsertForce5D(GaugeField &mat, FermionField &Btilde, FermionField Ã, int mu) {
|
||||
|
||||
int Ls = Btilde._grid->_fdimensions[0];
|
||||
int Ls = Btilde.Grid()->_fdimensions[0];
|
||||
|
||||
GaugeLinkField tmp(mat._grid);
|
||||
GaugeLinkField tmp(mat.Grid());
|
||||
tmp = zero;
|
||||
parallel_for(int ss = 0; ss < tmp._grid->oSites(); ss++) {
|
||||
parallel_for(int ss = 0; ss < tmp.Grid()->oSites(); ss++) {
|
||||
for (int s = 0; s < Ls; s++) {
|
||||
int sF = s + Ls * ss;
|
||||
auto ttmp = traceIndex<SpinIndex>(outerProduct(Btilde[sF], Atilde[sF]));
|
||||
@ -718,9 +718,9 @@ public:
|
||||
DoubledGaugeField &Uds,
|
||||
const GaugeField &Uthin,
|
||||
const GaugeField &Ufat) {
|
||||
conformable(Uds._grid, GaugeGrid);
|
||||
conformable(Uthin._grid, GaugeGrid);
|
||||
conformable(Ufat._grid, GaugeGrid);
|
||||
conformable(Uds.Grid(), GaugeGrid);
|
||||
conformable(Uthin.Grid(), GaugeGrid);
|
||||
conformable(Ufat.Grid(), GaugeGrid);
|
||||
GaugeLinkField U(GaugeGrid);
|
||||
GaugeLinkField UU(GaugeGrid);
|
||||
GaugeLinkField UUU(GaugeGrid);
|
||||
@ -771,7 +771,7 @@ public:
|
||||
}
|
||||
|
||||
inline void InsertForce4D(GaugeField &mat, FermionField &Btilde, FermionField &A,int mu){
|
||||
GaugeLinkField link(mat._grid);
|
||||
GaugeLinkField link(mat.Grid());
|
||||
link = TraceIndex<SpinIndex>(outerProduct(Btilde,A));
|
||||
PokeIndex<LorentzIndex>(mat,link,mu);
|
||||
}
|
||||
@ -864,8 +864,8 @@ public:
|
||||
const GaugeField &Ufat)
|
||||
{
|
||||
|
||||
GridBase * InputGrid = Uthin._grid;
|
||||
conformable(InputGrid,Ufat._grid);
|
||||
GridBase * InputGrid = Uthin.Grid();
|
||||
conformable(InputGrid,Ufat.Grid());
|
||||
|
||||
GaugeLinkField U(InputGrid);
|
||||
GaugeLinkField UU(InputGrid);
|
||||
|
@ -238,8 +238,8 @@ void ImprovedStaggeredFermion<Impl>::DerivInternal(StencilImpl &st, DoubledGauge
|
||||
|
||||
Compressor compressor;
|
||||
|
||||
FermionField Btilde(B._grid);
|
||||
FermionField Atilde(B._grid);
|
||||
FermionField Btilde(B.Grid());
|
||||
FermionField Atilde(B.Grid());
|
||||
Atilde = A;
|
||||
|
||||
st.HaloExchange(B, compressor);
|
||||
@ -249,7 +249,7 @@ void ImprovedStaggeredFermion<Impl>::DerivInternal(StencilImpl &st, DoubledGauge
|
||||
////////////////////////
|
||||
// Call the single hop
|
||||
////////////////////////
|
||||
thread_loop( (int sss = 0; sss < B._grid->oSites(); sss++), {
|
||||
thread_loop( (int sss = 0; sss < B.Grid()->oSites(); sss++), {
|
||||
Kernels::DhopDirK(st, U, UUU, st.CommBuf(), sss, sss, B, Btilde, mu,1);
|
||||
});
|
||||
|
||||
@ -281,9 +281,9 @@ void ImprovedStaggeredFermion<Impl>::DerivInternal(StencilImpl &st, DoubledGauge
|
||||
template <class Impl>
|
||||
void ImprovedStaggeredFermion<Impl>::DhopDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) {
|
||||
|
||||
conformable(U._grid, _grid);
|
||||
conformable(U._grid, V._grid);
|
||||
conformable(U._grid, mat._grid);
|
||||
conformable(U.Grid(), _grid);
|
||||
conformable(U.Grid(), V.Grid());
|
||||
conformable(U.Grid(), mat.Grid());
|
||||
|
||||
mat.Checkerboard() = U.Checkerboard();
|
||||
|
||||
@ -293,9 +293,9 @@ void ImprovedStaggeredFermion<Impl>::DhopDeriv(GaugeField &mat, const FermionFie
|
||||
template <class Impl>
|
||||
void ImprovedStaggeredFermion<Impl>::DhopDerivOE(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) {
|
||||
|
||||
conformable(U._grid, _cbgrid);
|
||||
conformable(U._grid, V._grid);
|
||||
conformable(U._grid, mat._grid);
|
||||
conformable(U.Grid(), _cbgrid);
|
||||
conformable(U.Grid(), V.Grid());
|
||||
conformable(U.Grid(), mat.Grid());
|
||||
|
||||
assert(V.Checkerboard() == Even);
|
||||
assert(U.Checkerboard() == Odd);
|
||||
@ -307,9 +307,9 @@ void ImprovedStaggeredFermion<Impl>::DhopDerivOE(GaugeField &mat, const FermionF
|
||||
template <class Impl>
|
||||
void ImprovedStaggeredFermion<Impl>::DhopDerivEO(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) {
|
||||
|
||||
conformable(U._grid, _cbgrid);
|
||||
conformable(U._grid, V._grid);
|
||||
conformable(U._grid, mat._grid);
|
||||
conformable(U.Grid(), _cbgrid);
|
||||
conformable(U.Grid(), V.Grid());
|
||||
conformable(U.Grid(), mat.Grid());
|
||||
|
||||
assert(V.Checkerboard() == Odd);
|
||||
assert(U.Checkerboard() == Even);
|
||||
@ -320,8 +320,8 @@ void ImprovedStaggeredFermion<Impl>::DhopDerivEO(GaugeField &mat, const FermionF
|
||||
|
||||
template <class Impl>
|
||||
void ImprovedStaggeredFermion<Impl>::Dhop(const FermionField &in, FermionField &out, int dag) {
|
||||
conformable(in._grid, _grid); // verifies full grid
|
||||
conformable(in._grid, out._grid);
|
||||
conformable(in.Grid(), _grid); // verifies full grid
|
||||
conformable(in.Grid(), out.Grid());
|
||||
|
||||
out.Checkerboard() = in.Checkerboard();
|
||||
|
||||
@ -330,8 +330,8 @@ void ImprovedStaggeredFermion<Impl>::Dhop(const FermionField &in, FermionField &
|
||||
|
||||
template <class Impl>
|
||||
void ImprovedStaggeredFermion<Impl>::DhopOE(const FermionField &in, FermionField &out, int dag) {
|
||||
conformable(in._grid, _cbgrid); // verifies half grid
|
||||
conformable(in._grid, out._grid); // drops the cb check
|
||||
conformable(in.Grid(), _cbgrid); // verifies half grid
|
||||
conformable(in.Grid(), out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard() == Even);
|
||||
out.Checkerboard() = Odd;
|
||||
@ -341,8 +341,8 @@ void ImprovedStaggeredFermion<Impl>::DhopOE(const FermionField &in, FermionField
|
||||
|
||||
template <class Impl>
|
||||
void ImprovedStaggeredFermion<Impl>::DhopEO(const FermionField &in, FermionField &out, int dag) {
|
||||
conformable(in._grid, _cbgrid); // verifies half grid
|
||||
conformable(in._grid, out._grid); // drops the cb check
|
||||
conformable(in.Grid(), _cbgrid); // verifies half grid
|
||||
conformable(in.Grid(), out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard() == Odd);
|
||||
out.Checkerboard() = Even;
|
||||
@ -361,7 +361,7 @@ void ImprovedStaggeredFermion<Impl>::DhopDir(const FermionField &in, FermionFiel
|
||||
Compressor compressor;
|
||||
Stencil.HaloExchange(in, compressor);
|
||||
|
||||
thread_loop( (int sss = 0; sss < in._grid->oSites(); sss++) , {
|
||||
thread_loop( (int sss = 0; sss < in.Grid()->oSites(); sss++) , {
|
||||
Kernels::DhopDirK(Stencil, Umu, UUUmu, Stencil.CommBuf(), sss, sss, in, out, dir, disp);
|
||||
});
|
||||
};
|
||||
@ -378,11 +378,11 @@ void ImprovedStaggeredFermion<Impl>::DhopInternal(StencilImpl &st, LebesgueOrder
|
||||
st.HaloExchange(in, compressor);
|
||||
|
||||
if (dag == DaggerYes) {
|
||||
thread_loop( (int sss = 0; sss < in._grid->oSites(); sss++), {
|
||||
thread_loop( (int sss = 0; sss < in.Grid()->oSites(); sss++), {
|
||||
Kernels::DhopSiteDag(st, lo, U, UUU, st.CommBuf(), 1, sss, in, out);
|
||||
});
|
||||
} else {
|
||||
thread_loop( (int sss = 0; sss < in._grid->oSites(); sss++), {
|
||||
thread_loop( (int sss = 0; sss < in.Grid()->oSites(); sss++), {
|
||||
Kernels::DhopSite(st, lo, U, UUU, st.CommBuf(), 1, sss, in, out);
|
||||
});
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ void ImprovedStaggeredFermion5D<Impl>::DhopDir(const FermionField &in, FermionFi
|
||||
Compressor compressor;
|
||||
Stencil.HaloExchange(in,compressor);
|
||||
|
||||
parallel_for(int ss=0;ss<Umu._grid->oSites();ss++){
|
||||
parallel_for(int ss=0;ss<Umu.Grid()->oSites();ss++){
|
||||
for(int s=0;s<Ls;s++){
|
||||
int sU=ss;
|
||||
int sF = s+Ls*sU;
|
||||
@ -228,7 +228,7 @@ void ImprovedStaggeredFermion5D<Impl>::DhopInternal(StencilImpl & st, LebesgueOr
|
||||
const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
Compressor compressor;
|
||||
int LLs = in._grid->_rdimensions[0];
|
||||
int LLs = in.Grid()->_rdimensions[0];
|
||||
|
||||
|
||||
|
||||
@ -240,12 +240,12 @@ void ImprovedStaggeredFermion5D<Impl>::DhopInternal(StencilImpl & st, LebesgueOr
|
||||
DhopComputeTime -= usecond();
|
||||
// Dhop takes the 4d grid from U, and makes a 5d index for fermion
|
||||
if (dag == DaggerYes) {
|
||||
parallel_for (int ss = 0; ss < U._grid->oSites(); ss++) {
|
||||
parallel_for (int ss = 0; ss < U.Grid()->oSites(); ss++) {
|
||||
int sU=ss;
|
||||
Kernels::DhopSiteDag(st, lo, U, UUU, st.CommBuf(), LLs, sU,in, out);
|
||||
}
|
||||
} else {
|
||||
parallel_for (int ss = 0; ss < U._grid->oSites(); ss++) {
|
||||
parallel_for (int ss = 0; ss < U.Grid()->oSites(); ss++) {
|
||||
int sU=ss;
|
||||
Kernels::DhopSite(st,lo,U,UUU,st.CommBuf(),LLs,sU,in,out);
|
||||
}
|
||||
@ -259,8 +259,8 @@ template<class Impl>
|
||||
void ImprovedStaggeredFermion5D<Impl>::DhopOE(const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
DhopCalls+=1;
|
||||
conformable(in._grid,FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in._grid,out._grid); // drops the cb check
|
||||
conformable(in.Grid(),FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in.Grid(),out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard()==Even);
|
||||
out.Checkerboard() = Odd;
|
||||
@ -271,8 +271,8 @@ template<class Impl>
|
||||
void ImprovedStaggeredFermion5D<Impl>::DhopEO(const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
DhopCalls+=1;
|
||||
conformable(in._grid,FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in._grid,out._grid); // drops the cb check
|
||||
conformable(in.Grid(),FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in.Grid(),out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard()==Odd);
|
||||
out.Checkerboard() = Even;
|
||||
@ -283,8 +283,8 @@ template<class Impl>
|
||||
void ImprovedStaggeredFermion5D<Impl>::Dhop(const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
DhopCalls+=2;
|
||||
conformable(in._grid,FermionGrid()); // verifies full grid
|
||||
conformable(in._grid,out._grid);
|
||||
conformable(in.Grid(),FermionGrid()); // verifies full grid
|
||||
conformable(in.Grid(),out.Grid());
|
||||
|
||||
out.Checkerboard() = in.Checkerboard();
|
||||
|
||||
|
@ -167,7 +167,7 @@ void MobiusEOFAFermion<Impl>::DtildeInv(const FermionField& psi, FermionField& c
|
||||
template<class Impl>
|
||||
RealD MobiusEOFAFermion<Impl>::M(const FermionField& psi, FermionField& chi)
|
||||
{
|
||||
FermionField Din(psi._grid);
|
||||
FermionField Din(psi.Grid());
|
||||
|
||||
this->Meooe5D(psi, Din);
|
||||
this->DW(Din, chi, DaggerNo);
|
||||
@ -179,7 +179,7 @@ RealD MobiusEOFAFermion<Impl>::M(const FermionField& psi, FermionField& chi)
|
||||
template<class Impl>
|
||||
RealD MobiusEOFAFermion<Impl>::Mdag(const FermionField& psi, FermionField& chi)
|
||||
{
|
||||
FermionField Din(psi._grid);
|
||||
FermionField Din(psi.Grid());
|
||||
|
||||
this->DW(psi, Din, DaggerYes);
|
||||
this->MeooeDag5D(Din, chi);
|
||||
|
@ -41,7 +41,7 @@ void MobiusEOFAFermion<Impl>::M5D(const FermionField &psi, const FermionField &p
|
||||
std::vector<Coeff_t> &lower, std::vector<Coeff_t> &diag, std::vector<Coeff_t> &upper)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -82,7 +82,7 @@ void MobiusEOFAFermion<Impl>::M5D_shift(const FermionField &psi, const FermionFi
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
int shift_s = (this->pm == 1) ? (Ls-1) : 0; // s-component modified by shift operator
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -124,7 +124,7 @@ void MobiusEOFAFermion<Impl>::M5Ddag(const FermionField &psi, const FermionField
|
||||
std::vector<Coeff_t> &lower, std::vector<Coeff_t> &diag, std::vector<Coeff_t> &upper)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -165,7 +165,7 @@ void MobiusEOFAFermion<Impl>::M5Ddag_shift(const FermionField &psi, const Fermio
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
int shift_s = (this->pm == 1) ? (Ls-1) : 0; // s-component modified by shift operator
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -208,7 +208,7 @@ void MobiusEOFAFermion<Impl>::MooeeInv(const FermionField &psi, FermionField &ch
|
||||
{
|
||||
if(this->shift != 0.0){ MooeeInv_shift(psi,chi); return; }
|
||||
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -253,7 +253,7 @@ void MobiusEOFAFermion<Impl>::MooeeInv(const FermionField &psi, FermionField &ch
|
||||
template<class Impl>
|
||||
void MobiusEOFAFermion<Impl>::MooeeInv_shift(const FermionField &psi, FermionField &chi)
|
||||
{
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -310,7 +310,7 @@ void MobiusEOFAFermion<Impl>::MooeeInvDag(const FermionField &psi, FermionField
|
||||
{
|
||||
if(this->shift != 0.0){ MooeeInvDag_shift(psi,chi); return; }
|
||||
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -355,7 +355,7 @@ void MobiusEOFAFermion<Impl>::MooeeInvDag(const FermionField &psi, FermionField
|
||||
template<class Impl>
|
||||
void MobiusEOFAFermion<Impl>::MooeeInvDag_shift(const FermionField &psi, FermionField &chi)
|
||||
{
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
|
@ -67,8 +67,8 @@ template<class Impl>
|
||||
void MobiusEOFAFermion<Impl>::MooeeInternal(const FermionField& psi, FermionField& chi, int dag, int inv)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
int LLs = psi._grid->_rdimensions[0];
|
||||
int vol = psi._grid->oSites()/LLs;
|
||||
int LLs = psi.Grid()->_rdimensions[0];
|
||||
int vol = psi.Grid()->oSites()/LLs;
|
||||
|
||||
int pm = this->pm;
|
||||
RealD shift = this->shift;
|
||||
|
@ -165,7 +165,7 @@ void MobiusEOFAFermion<Impl>::MooeeInv_shift(const FermionField& psi, FermionFie
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField tmp(psi._grid);
|
||||
FermionField tmp(psi.Grid());
|
||||
|
||||
// Apply (L^{\prime})^{-1}
|
||||
axpby_ssp(chi, one, psi, czero, psi, 0, 0); // chi[0]=psi[0]
|
||||
@ -237,7 +237,7 @@ void MobiusEOFAFermion<Impl>::MooeeInvDag_shift(const FermionField& psi, Fermion
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField tmp(psi._grid);
|
||||
FermionField tmp(psi.Grid());
|
||||
|
||||
// Apply (U^{\prime})^{-dagger} and accumulate (MooeeInvDag_shift_lc)_{j} \psi_{j} in tmp[0]
|
||||
axpby_ssp(chi, one, psi, czero, psi, 0, 0); // chi[0]=psi[0]
|
||||
|
@ -66,7 +66,7 @@ template<class Impl>
|
||||
void MobiusEOFAFermion<Impl>::M5D(const FermionField& psi, const FermionField& phi,
|
||||
FermionField& chi, std::vector<Coeff_t>& lower, std::vector<Coeff_t>& diag, std::vector<Coeff_t>& upper)
|
||||
{
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
const int nsimd = Simd::Nsimd();
|
||||
@ -226,7 +226,7 @@ void MobiusEOFAFermion<Impl>::M5D_shift(const FermionField& psi, const FermionFi
|
||||
|
||||
#else
|
||||
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
const int nsimd = Simd::Nsimd();
|
||||
@ -392,7 +392,7 @@ template<class Impl>
|
||||
void MobiusEOFAFermion<Impl>::M5Ddag(const FermionField& psi, const FermionField& phi,
|
||||
FermionField& chi, std::vector<Coeff_t>& lower, std::vector<Coeff_t>& diag, std::vector<Coeff_t>& upper)
|
||||
{
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
int nsimd = Simd::Nsimd();
|
||||
@ -549,7 +549,7 @@ void MobiusEOFAFermion<Impl>::M5Ddag_shift(const FermionField& psi, const Fermio
|
||||
|
||||
#else
|
||||
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
int nsimd = Simd::Nsimd();
|
||||
@ -910,8 +910,8 @@ template<class Impl>
|
||||
void MobiusEOFAFermion<Impl>::MooeeInternal(const FermionField& psi, FermionField& chi, int dag, int inv)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
int LLs = psi._grid->_rdimensions[0];
|
||||
int vol = psi._grid->oSites()/LLs;
|
||||
int LLs = psi.Grid()->_rdimensions[0];
|
||||
int vol = psi.Grid()->oSites()/LLs;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
|
||||
|
@ -105,7 +105,7 @@ void PartialFractionFermion5D<Impl>::MooeeInv_internal(const FermionField &psi
|
||||
int sign = dag ? (-1) : 1;
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField tmp(psi._grid);
|
||||
FermionField tmp(psi.Grid());
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
//Linv
|
||||
@ -164,7 +164,7 @@ void PartialFractionFermion5D<Impl>::MooeeInv_internal(const FermionField &psi
|
||||
template<class Impl>
|
||||
void PartialFractionFermion5D<Impl>::M_internal(const FermionField &psi, FermionField &chi,int dag)
|
||||
{
|
||||
FermionField D(psi._grid);
|
||||
FermionField D(psi.Grid());
|
||||
|
||||
int Ls = this->Ls;
|
||||
int sign = dag ? (-1) : 1;
|
||||
@ -303,7 +303,7 @@ void PartialFractionFermion5D<Impl>::MDeriv (GaugeField &mat,const FermionField
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(V._grid);
|
||||
FermionField D(V.Grid());
|
||||
|
||||
int nblock=(Ls-1)/2;
|
||||
for(int b=0;b<nblock;b++){
|
||||
@ -320,7 +320,7 @@ void PartialFractionFermion5D<Impl>::MoeDeriv(GaugeField &mat,const FermionField
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(V._grid);
|
||||
FermionField D(V.Grid());
|
||||
|
||||
int nblock=(Ls-1)/2;
|
||||
for(int b=0;b<nblock;b++){
|
||||
@ -337,7 +337,7 @@ void PartialFractionFermion5D<Impl>::MeoDeriv(GaugeField &mat,const FermionField
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(V._grid);
|
||||
FermionField D(V.Grid());
|
||||
|
||||
int nblock=(Ls-1)/2;
|
||||
for(int b=0;b<nblock;b++){
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
|
||||
template<typename vobj>
|
||||
void sscale(const Lattice<vobj>& in, Lattice<vobj>& out, Coeff_t* s) {
|
||||
GridBase *grid=out._grid;
|
||||
GridBase *grid=out.Grid();
|
||||
out.Checkerboard() = in.Checkerboard();
|
||||
assert(grid->_simd_layout[0] == 1); // should be fine for ZMobius for now
|
||||
int Ls = grid->_rdimensions[0];
|
||||
@ -81,7 +81,7 @@ public:
|
||||
SchurDiagTwoKappaOperator (Matrix &Mat): _S(Mat), _Mat(Mat) {};
|
||||
|
||||
virtual RealD Mpc (const Field &in, Field &out) {
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
|
||||
_S.MInv(in,out);
|
||||
_Mat.Mpc(out,tmp);
|
||||
@ -89,7 +89,7 @@ public:
|
||||
|
||||
}
|
||||
virtual RealD MpcDag (const Field &in, Field &out){
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
|
||||
_S.MDag(in,out);
|
||||
_Mat.MpcDag(out,tmp);
|
||||
|
@ -343,7 +343,7 @@ public:
|
||||
this->_grid->StencilBarrier();
|
||||
this->mpi3synctime_g+=usecond();
|
||||
|
||||
assert(source._grid==this->_grid);
|
||||
assert(source.Grid()==this->_grid);
|
||||
this->halogtime-=usecond();
|
||||
|
||||
this->u_comm_offset=0;
|
||||
|
@ -66,7 +66,7 @@ WilsonFermion<Impl>::WilsonFermion(GaugeField &_Umu, GridCartesian &Fgrid,
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::ImportGauge(const GaugeField &_Umu) {
|
||||
GaugeField HUmu(_Umu._grid);
|
||||
GaugeField HUmu(_Umu.Grid());
|
||||
HUmu = _Umu * (-0.5);
|
||||
Impl::DoubleStore(GaugeGrid(), Umu, HUmu);
|
||||
pickCheckerboard(Even, UmuEven, Umu);
|
||||
@ -141,7 +141,7 @@ void WilsonFermion<Impl>::MomentumSpacePropagator(FermionField &out, const Fermi
|
||||
typedef Lattice<iSinglet<vector_type> > LatComplex;
|
||||
|
||||
// what type LatticeComplex
|
||||
conformable(_grid,out._grid);
|
||||
conformable(_grid,out.Grid());
|
||||
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
@ -200,8 +200,8 @@ void WilsonFermion<Impl>::DerivInternal(StencilImpl &st, DoubledGaugeField &U,
|
||||
|
||||
Compressor compressor(dag);
|
||||
|
||||
FermionField Btilde(B._grid);
|
||||
FermionField Atilde(B._grid);
|
||||
FermionField Btilde(B.Grid());
|
||||
FermionField Atilde(B.Grid());
|
||||
Atilde = A;
|
||||
|
||||
st.HaloExchange(B, compressor);
|
||||
@ -216,7 +216,7 @@ void WilsonFermion<Impl>::DerivInternal(StencilImpl &st, DoubledGaugeField &U,
|
||||
////////////////////////
|
||||
// Call the single hop
|
||||
////////////////////////
|
||||
parallel_for (int sss = 0; sss < B._grid->oSites(); sss++) {
|
||||
parallel_for (int sss = 0; sss < B.Grid()->oSites(); sss++) {
|
||||
Kernels::DhopDirK(st, U, st.CommBuf(), sss, sss, B, Btilde, mu, gamma);
|
||||
}
|
||||
|
||||
@ -229,9 +229,9 @@ void WilsonFermion<Impl>::DerivInternal(StencilImpl &st, DoubledGaugeField &U,
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::DhopDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) {
|
||||
conformable(U._grid, _grid);
|
||||
conformable(U._grid, V._grid);
|
||||
conformable(U._grid, mat._grid);
|
||||
conformable(U.Grid(), _grid);
|
||||
conformable(U.Grid(), V.Grid());
|
||||
conformable(U.Grid(), mat.Grid());
|
||||
|
||||
mat.Checkerboard() = U.Checkerboard();
|
||||
|
||||
@ -240,9 +240,9 @@ void WilsonFermion<Impl>::DhopDeriv(GaugeField &mat, const FermionField &U, cons
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::DhopDerivOE(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) {
|
||||
conformable(U._grid, _cbgrid);
|
||||
conformable(U._grid, V._grid);
|
||||
//conformable(U._grid, mat._grid); not general, leaving as a comment (Guido)
|
||||
conformable(U.Grid(), _cbgrid);
|
||||
conformable(U.Grid(), V.Grid());
|
||||
//conformable(U.Grid(), mat.Grid()); not general, leaving as a comment (Guido)
|
||||
// Motivation: look at the SchurDiff operator
|
||||
|
||||
assert(V.Checkerboard() == Even);
|
||||
@ -254,9 +254,9 @@ void WilsonFermion<Impl>::DhopDerivOE(GaugeField &mat, const FermionField &U, co
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::DhopDerivEO(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) {
|
||||
conformable(U._grid, _cbgrid);
|
||||
conformable(U._grid, V._grid);
|
||||
//conformable(U._grid, mat._grid);
|
||||
conformable(U.Grid(), _cbgrid);
|
||||
conformable(U.Grid(), V.Grid());
|
||||
//conformable(U.Grid(), mat.Grid());
|
||||
|
||||
assert(V.Checkerboard() == Odd);
|
||||
assert(U.Checkerboard() == Even);
|
||||
@ -267,8 +267,8 @@ void WilsonFermion<Impl>::DhopDerivEO(GaugeField &mat, const FermionField &U, co
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::Dhop(const FermionField &in, FermionField &out, int dag) {
|
||||
conformable(in._grid, _grid); // verifies full grid
|
||||
conformable(in._grid, out._grid);
|
||||
conformable(in.Grid(), _grid); // verifies full grid
|
||||
conformable(in.Grid(), out.Grid());
|
||||
|
||||
out.Checkerboard() = in.Checkerboard();
|
||||
|
||||
@ -277,8 +277,8 @@ void WilsonFermion<Impl>::Dhop(const FermionField &in, FermionField &out, int da
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::DhopOE(const FermionField &in, FermionField &out, int dag) {
|
||||
conformable(in._grid, _cbgrid); // verifies half grid
|
||||
conformable(in._grid, out._grid); // drops the cb check
|
||||
conformable(in.Grid(), _cbgrid); // verifies half grid
|
||||
conformable(in.Grid(), out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard() == Even);
|
||||
out.Checkerboard() = Odd;
|
||||
@ -288,8 +288,8 @@ void WilsonFermion<Impl>::DhopOE(const FermionField &in, FermionField &out, int
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::DhopEO(const FermionField &in, FermionField &out,int dag) {
|
||||
conformable(in._grid, _cbgrid); // verifies half grid
|
||||
conformable(in._grid, out._grid); // drops the cb check
|
||||
conformable(in.Grid(), _cbgrid); // verifies half grid
|
||||
conformable(in.Grid(), out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard() == Odd);
|
||||
out.Checkerboard() = Even;
|
||||
@ -317,7 +317,7 @@ void WilsonFermion<Impl>::DhopDirDisp(const FermionField &in, FermionField &out,
|
||||
|
||||
Stencil.HaloExchange(in, compressor);
|
||||
|
||||
parallel_for (int sss = 0; sss < in._grid->oSites(); sss++) {
|
||||
parallel_for (int sss = 0; sss < in.Grid()->oSites(); sss++) {
|
||||
Kernels::DhopDirK(Stencil, Umu, Stencil.CommBuf(), sss, sss, in, out, dirdisp, gamma);
|
||||
}
|
||||
};
|
||||
@ -333,11 +333,11 @@ void WilsonFermion<Impl>::DhopInternal(StencilImpl &st, LebesgueOrder &lo,
|
||||
st.HaloExchange(in, compressor);
|
||||
|
||||
if (dag == DaggerYes) {
|
||||
parallel_for (int sss = 0; sss < in._grid->oSites(); sss++) {
|
||||
parallel_for (int sss = 0; sss < in.Grid()->oSites(); sss++) {
|
||||
Kernels::DhopSiteDag(st, lo, U, st.CommBuf(), sss, sss, 1, 1, in, out);
|
||||
}
|
||||
} else {
|
||||
parallel_for (int sss = 0; sss < in._grid->oSites(); sss++) {
|
||||
parallel_for (int sss = 0; sss < in.Grid()->oSites(); sss++) {
|
||||
Kernels::DhopSite(st, lo, U, st.CommBuf(), sss, sss, 1, 1, in, out);
|
||||
}
|
||||
}
|
||||
@ -356,9 +356,9 @@ void WilsonFermion<Impl>::ContractConservedCurrent(PropagatorField &q_in_1,
|
||||
unsigned int mu)
|
||||
{
|
||||
Gamma g5(Gamma::Algebra::Gamma5);
|
||||
conformable(_grid, q_in_1._grid);
|
||||
conformable(_grid, q_in_2._grid);
|
||||
conformable(_grid, q_out._grid);
|
||||
conformable(_grid, q_in_1.Grid());
|
||||
conformable(_grid, q_in_2.Grid());
|
||||
conformable(_grid, q_out.Grid());
|
||||
PropagatorField tmp1(_grid), tmp2(_grid);
|
||||
q_out = zero;
|
||||
|
||||
@ -366,7 +366,7 @@ void WilsonFermion<Impl>::ContractConservedCurrent(PropagatorField &q_in_1,
|
||||
// Inefficient comms method but not performance critical.
|
||||
tmp1 = Cshift(q_in_1, mu, 1);
|
||||
tmp2 = Cshift(q_in_2, mu, 1);
|
||||
parallel_for (unsigned int sU = 0; sU < Umu._grid->oSites(); ++sU)
|
||||
parallel_for (unsigned int sU = 0; sU < Umu.Grid()->oSites(); ++sU)
|
||||
{
|
||||
Kernels::ContractConservedCurrentSiteFwd(tmp1[sU],
|
||||
q_in_2[sU],
|
||||
@ -388,8 +388,8 @@ void WilsonFermion<Impl>::SeqConservedCurrent(PropagatorField &q_in,
|
||||
unsigned int tmin,
|
||||
unsigned int tmax)
|
||||
{
|
||||
conformable(_grid, q_in._grid);
|
||||
conformable(_grid, q_out._grid);
|
||||
conformable(_grid, q_in.Grid());
|
||||
conformable(_grid, q_out.Grid());
|
||||
Lattice<iSinglet<Simd>> ph(_grid), coor(_grid);
|
||||
Complex i(0.0,1.0);
|
||||
PropagatorField tmpFwd(_grid), tmpBwd(_grid), tmp(_grid);
|
||||
@ -415,7 +415,7 @@ void WilsonFermion<Impl>::SeqConservedCurrent(PropagatorField &q_in,
|
||||
tmp = ph*q_in;
|
||||
tmpBwd = Cshift(tmp, mu, -1);
|
||||
|
||||
parallel_for (unsigned int sU = 0; sU < Umu._grid->oSites(); ++sU)
|
||||
parallel_for (unsigned int sU = 0; sU < Umu.Grid()->oSites(); ++sU)
|
||||
{
|
||||
// Compute the sequential conserved current insertion only if our simd
|
||||
// object contains a timeslice we need.
|
||||
|
@ -219,7 +219,7 @@ void WilsonFermion5D<Impl>::ZeroCounters(void) {
|
||||
template<class Impl>
|
||||
void WilsonFermion5D<Impl>::ImportGauge(const GaugeField &_Umu)
|
||||
{
|
||||
GaugeField HUmu(_Umu._grid);
|
||||
GaugeField HUmu(_Umu.Grid());
|
||||
HUmu = _Umu*(-0.5);
|
||||
Impl::DoubleStore(GaugeGrid(),Umu,HUmu);
|
||||
pickCheckerboard(Even,UmuEven,Umu);
|
||||
@ -244,7 +244,7 @@ void WilsonFermion5D<Impl>::DhopDir(const FermionField &in, FermionField &out,in
|
||||
assert(dirdisp<=7);
|
||||
assert(dirdisp>=0);
|
||||
|
||||
parallel_for(int ss=0;ss<Umu._grid->oSites();ss++){
|
||||
parallel_for(int ss=0;ss<Umu.Grid()->oSites();ss++){
|
||||
for(int s=0;s<Ls;s++){
|
||||
int sU=ss;
|
||||
int sF = s+Ls*sU;
|
||||
@ -264,20 +264,20 @@ void WilsonFermion5D<Impl>::DerivInternal(StencilImpl & st,
|
||||
DerivCalls++;
|
||||
assert((dag==DaggerNo) ||(dag==DaggerYes));
|
||||
|
||||
conformable(st._grid,A._grid);
|
||||
conformable(st._grid,B._grid);
|
||||
conformable(st.Grid(),A.Grid());
|
||||
conformable(st.Grid(),B.Grid());
|
||||
|
||||
Compressor compressor(dag);
|
||||
|
||||
FermionField Btilde(B._grid);
|
||||
FermionField Atilde(B._grid);
|
||||
FermionField Btilde(B.Grid());
|
||||
FermionField Atilde(B.Grid());
|
||||
|
||||
DerivCommTime-=usecond();
|
||||
st.HaloExchange(B,compressor);
|
||||
DerivCommTime+=usecond();
|
||||
|
||||
Atilde=A;
|
||||
int LLs = B._grid->_rdimensions[0];
|
||||
int LLs = B.Grid()->_rdimensions[0];
|
||||
|
||||
|
||||
DerivComputeTime-=usecond();
|
||||
@ -293,13 +293,13 @@ void WilsonFermion5D<Impl>::DerivInternal(StencilImpl & st,
|
||||
////////////////////////
|
||||
|
||||
DerivDhopComputeTime -= usecond();
|
||||
parallel_for (int sss = 0; sss < U._grid->oSites(); sss++) {
|
||||
parallel_for (int sss = 0; sss < U.Grid()->oSites(); sss++) {
|
||||
for (int s = 0; s < Ls; s++) {
|
||||
int sU = sss;
|
||||
int sF = s + Ls * sU;
|
||||
|
||||
assert(sF < B._grid->oSites());
|
||||
assert(sU < U._grid->oSites());
|
||||
assert(sF < B.Grid()->oSites());
|
||||
assert(sU < U.Grid()->oSites());
|
||||
|
||||
Kernels::DhopDirK(st, U, st.CommBuf(), sF, sU, B, Btilde, mu, gamma);
|
||||
|
||||
@ -323,10 +323,10 @@ void WilsonFermion5D<Impl>::DhopDeriv(GaugeField &mat,
|
||||
const FermionField &B,
|
||||
int dag)
|
||||
{
|
||||
conformable(A._grid,FermionGrid());
|
||||
conformable(A._grid,B._grid);
|
||||
conformable(A.Grid(),FermionGrid());
|
||||
conformable(A.Grid(),B.Grid());
|
||||
|
||||
//conformable(GaugeGrid(),mat._grid);// this is not general! leaving as a comment
|
||||
//conformable(GaugeGrid(),mat.Grid());// this is not general! leaving as a comment
|
||||
|
||||
mat.Checkerboard() = A.Checkerboard();
|
||||
|
||||
@ -339,8 +339,8 @@ void WilsonFermion5D<Impl>::DhopDerivEO(GaugeField &mat,
|
||||
const FermionField &B,
|
||||
int dag)
|
||||
{
|
||||
conformable(A._grid,FermionRedBlackGrid());
|
||||
conformable(A._grid,B._grid);
|
||||
conformable(A.Grid(),FermionRedBlackGrid());
|
||||
conformable(A.Grid(),B.Grid());
|
||||
|
||||
assert(B.Checkerboard()==Odd);
|
||||
assert(A.Checkerboard()==Even);
|
||||
@ -356,8 +356,8 @@ void WilsonFermion5D<Impl>::DhopDerivOE(GaugeField &mat,
|
||||
const FermionField &B,
|
||||
int dag)
|
||||
{
|
||||
conformable(A._grid,FermionRedBlackGrid());
|
||||
conformable(A._grid,B._grid);
|
||||
conformable(A.Grid(),FermionRedBlackGrid());
|
||||
conformable(A.Grid(),B.Grid());
|
||||
|
||||
assert(B.Checkerboard()==Even);
|
||||
assert(A.Checkerboard()==Odd);
|
||||
@ -392,8 +392,8 @@ void WilsonFermion5D<Impl>::DhopInternalOverlappedComms(StencilImpl & st, Lebesg
|
||||
|
||||
Compressor compressor(dag);
|
||||
|
||||
int LLs = in._grid->_rdimensions[0];
|
||||
int len = U._grid->oSites();
|
||||
int LLs = in.Grid()->_rdimensions[0];
|
||||
int len = U.Grid()->oSites();
|
||||
|
||||
DhopFaceTime-=usecond();
|
||||
st.HaloExchangeOptGather(in,compressor);
|
||||
@ -417,7 +417,7 @@ void WilsonFermion5D<Impl>::DhopInternalOverlappedComms(StencilImpl & st, Lebesg
|
||||
double start = usecond();
|
||||
nthreads -= ncomms;
|
||||
int ttid = tid - ncomms;
|
||||
int n = U._grid->oSites();
|
||||
int n = U.Grid()->oSites();
|
||||
int chunk = n / nthreads;
|
||||
int rem = n % nthreads;
|
||||
int myblock, myn;
|
||||
@ -492,7 +492,7 @@ void WilsonFermion5D<Impl>::DhopInternalSerialComms(StencilImpl & st, LebesgueOr
|
||||
// assert((dag==DaggerNo) ||(dag==DaggerYes));
|
||||
Compressor compressor(dag);
|
||||
|
||||
int LLs = in._grid->_rdimensions[0];
|
||||
int LLs = in.Grid()->_rdimensions[0];
|
||||
|
||||
DhopCommTime-=usecond();
|
||||
st.HaloExchangeOpt(in,compressor);
|
||||
@ -502,13 +502,13 @@ void WilsonFermion5D<Impl>::DhopInternalSerialComms(StencilImpl & st, LebesgueOr
|
||||
// Dhop takes the 4d grid from U, and makes a 5d index for fermion
|
||||
|
||||
if (dag == DaggerYes) {
|
||||
parallel_for (int ss = 0; ss < U._grid->oSites(); ss++) {
|
||||
parallel_for (int ss = 0; ss < U.Grid()->oSites(); ss++) {
|
||||
int sU = ss;
|
||||
int sF = LLs * sU;
|
||||
Kernels::DhopSiteDag(st,lo,U,st.CommBuf(),sF,sU,LLs,1,in,out);
|
||||
}
|
||||
} else {
|
||||
parallel_for (int ss = 0; ss < U._grid->oSites(); ss++) {
|
||||
parallel_for (int ss = 0; ss < U.Grid()->oSites(); ss++) {
|
||||
int sU = ss;
|
||||
int sF = LLs * sU;
|
||||
Kernels::DhopSite(st,lo,U,st.CommBuf(),sF,sU,LLs,1,in,out);
|
||||
@ -522,8 +522,8 @@ template<class Impl>
|
||||
void WilsonFermion5D<Impl>::DhopOE(const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
DhopCalls++;
|
||||
conformable(in._grid,FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in._grid,out._grid); // drops the cb check
|
||||
conformable(in.Grid(),FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in.Grid(),out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard()==Even);
|
||||
out.Checkerboard() = Odd;
|
||||
@ -534,8 +534,8 @@ template<class Impl>
|
||||
void WilsonFermion5D<Impl>::DhopEO(const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
DhopCalls++;
|
||||
conformable(in._grid,FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in._grid,out._grid); // drops the cb check
|
||||
conformable(in.Grid(),FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in.Grid(),out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard()==Odd);
|
||||
out.Checkerboard() = Even;
|
||||
@ -546,8 +546,8 @@ template<class Impl>
|
||||
void WilsonFermion5D<Impl>::Dhop(const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
DhopCalls+=2;
|
||||
conformable(in._grid,FermionGrid()); // verifies full grid
|
||||
conformable(in._grid,out._grid);
|
||||
conformable(in.Grid(),FermionGrid()); // verifies full grid
|
||||
conformable(in.Grid(),out.Grid());
|
||||
|
||||
out.Checkerboard() = in.Checkerboard();
|
||||
|
||||
@ -566,7 +566,7 @@ void WilsonFermion5D<Impl>::MomentumSpacePropagatorHt(FermionField &out,const Fe
|
||||
{
|
||||
// what type LatticeComplex
|
||||
GridBase *_grid = _FourDimGrid;
|
||||
conformable(_grid,out._grid);
|
||||
conformable(_grid,out.Grid());
|
||||
|
||||
typedef typename FermionField::vector_type vector_type;
|
||||
typedef typename FermionField::scalar_type ScalComplex;
|
||||
@ -651,7 +651,7 @@ void WilsonFermion5D<Impl>::MomentumSpacePropagatorHw(FermionField &out,const Fe
|
||||
};
|
||||
|
||||
GridBase *_grid = _FourDimGrid;
|
||||
conformable(_grid,out._grid);
|
||||
conformable(_grid,out.Grid());
|
||||
|
||||
typedef typename FermionField::vector_type vector_type;
|
||||
typedef typename FermionField::scalar_type ScalComplex;
|
||||
@ -728,18 +728,18 @@ void WilsonFermion5D<Impl>::ContractConservedCurrent(PropagatorField &q_in_1,
|
||||
Current curr_type,
|
||||
unsigned int mu)
|
||||
{
|
||||
conformable(q_in_1._grid, FermionGrid());
|
||||
conformable(q_in_1._grid, q_in_2._grid);
|
||||
conformable(_FourDimGrid, q_out._grid);
|
||||
conformable(q_in_1.Grid(), FermionGrid());
|
||||
conformable(q_in_1.Grid(), q_in_2.Grid());
|
||||
conformable(_FourDimGrid, q_out.Grid());
|
||||
PropagatorField tmp1(FermionGrid()), tmp2(FermionGrid());
|
||||
unsigned int LLs = q_in_1._grid->_rdimensions[0];
|
||||
unsigned int LLs = q_in_1.Grid()->_rdimensions[0];
|
||||
q_out = zero;
|
||||
|
||||
// Forward, need q1(x + mu, s), q2(x, Ls - 1 - s). Backward, need q1(x, s),
|
||||
// q2(x + mu, Ls - 1 - s). 5D lattice so shift 4D coordinate mu by one.
|
||||
tmp1 = Cshift(q_in_1, mu + 1, 1);
|
||||
tmp2 = Cshift(q_in_2, mu + 1, 1);
|
||||
parallel_for (unsigned int sU = 0; sU < Umu._grid->oSites(); ++sU)
|
||||
parallel_for (unsigned int sU = 0; sU < Umu.Grid()->oSites(); ++sU)
|
||||
{
|
||||
unsigned int sF1 = sU * LLs;
|
||||
unsigned int sF2 = (sU + 1) * LLs - 1;
|
||||
@ -786,14 +786,14 @@ void WilsonFermion5D<Impl>::SeqConservedCurrent(PropagatorField &q_in,
|
||||
unsigned int tmin,
|
||||
unsigned int tmax)
|
||||
{
|
||||
conformable(q_in._grid, FermionGrid());
|
||||
conformable(q_in._grid, q_out._grid);
|
||||
conformable(q_in.Grid(), FermionGrid());
|
||||
conformable(q_in.Grid(), q_out.Grid());
|
||||
Lattice<iSinglet<Simd>> ph(FermionGrid()), coor(FermionGrid());
|
||||
PropagatorField tmpFwd(FermionGrid()), tmpBwd(FermionGrid()),
|
||||
tmp(FermionGrid());
|
||||
Complex i(0.0, 1.0);
|
||||
unsigned int tshift = (mu == Tp) ? 1 : 0;
|
||||
unsigned int LLs = q_in._grid->_rdimensions[0];
|
||||
unsigned int LLs = q_in.Grid()->_rdimensions[0];
|
||||
unsigned int LLt = GridDefaultLatt()[Tp];
|
||||
|
||||
// Momentum projection.
|
||||
@ -817,7 +817,7 @@ void WilsonFermion5D<Impl>::SeqConservedCurrent(PropagatorField &q_in,
|
||||
tmp = ph*q_in;
|
||||
tmpBwd = Cshift(tmp, mu + 1, -1);
|
||||
|
||||
parallel_for (unsigned int sU = 0; sU < Umu._grid->oSites(); ++sU)
|
||||
parallel_for (unsigned int sU = 0; sU < Umu.Grid()->oSites(); ++sU)
|
||||
{
|
||||
// Compute the sequential conserved current insertion only if our simd
|
||||
// object contains a timeslice we need.
|
||||
|
@ -134,7 +134,7 @@
|
||||
|
||||
COMPLEX_SIGNS(isigns);
|
||||
MASK_REGS;
|
||||
int nmax=U._grid->oSites();
|
||||
int nmax=U.Grid()->oSites();
|
||||
for(int site=0;site<Ns;site++) {
|
||||
#ifndef EXTERIOR
|
||||
int sU =lo.Reorder(ssU);
|
||||
|
@ -92,7 +92,7 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
||||
g = F; \
|
||||
direction = st._directions[DIR]; \
|
||||
distance = st._distances[DIR]; \
|
||||
sl = st._grid->_simd_layout[direction]; \
|
||||
sl = st.Grid()->_simd_layout[direction]; \
|
||||
inplace_twist = 0; \
|
||||
if(SE->_around_the_world && this->Params.twists[DIR % 4]){ \
|
||||
if(sl == 1){ \
|
||||
|
@ -45,12 +45,12 @@ public:
|
||||
HermOp(in,out);
|
||||
}
|
||||
void OpDiag (const Field &in, Field &out) {
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
_Mat.Mdiag(in,tmp);
|
||||
G5R5(out,tmp);
|
||||
}
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) {
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
_Mat.Mdir(in,tmp,dir,disp);
|
||||
G5R5(out,tmp);
|
||||
}
|
||||
@ -67,7 +67,7 @@ public:
|
||||
n2=real(dot);
|
||||
}
|
||||
void HermOp(const Field &in, Field &out){
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
_Mat.M(in,tmp);
|
||||
G5R5(out,tmp);
|
||||
}
|
||||
@ -87,12 +87,12 @@ public:
|
||||
HermOp(in,out);
|
||||
}
|
||||
void OpDiag (const Field &in, Field &out) {
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
_Mat.Mdiag(in,tmp);
|
||||
out=g5*tmp;
|
||||
}
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) {
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
_Mat.Mdir(in,tmp,dir,disp);
|
||||
out=g5*tmp;
|
||||
}
|
||||
@ -109,7 +109,7 @@ public:
|
||||
n2=real(dot);
|
||||
}
|
||||
void HermOp(const Field &in, Field &out){
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
_Mat.M(in,tmp);
|
||||
out=g5*tmp;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public:
|
||||
// Move this elsewhere? FIXME
|
||||
static inline void AddLink(Field &U, LinkField &W,
|
||||
int mu) { // U[mu] += W
|
||||
thread_loop ( (auto ss = 0; ss < U._grid->oSites(); ss++),{
|
||||
thread_loop ( (auto ss = 0; ss < U.Grid()->oSites(); ss++),{
|
||||
U[ss]._internal[mu] =
|
||||
U[ss]._internal[mu] + W[ss]._internal;
|
||||
});
|
||||
@ -87,7 +87,7 @@ public:
|
||||
// HMC auxiliary functions
|
||||
static inline void generate_momenta(Field &P, GridParallelRNG &pRNG) {
|
||||
// specific for SU gauge fields
|
||||
LinkField Pmu(P._grid);
|
||||
LinkField Pmu(P.Grid());
|
||||
Pmu = zero;
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
SU<Nrepresentation>::GaussianFundamentalLieAlgebraMatrix(pRNG, Pmu);
|
||||
@ -101,7 +101,7 @@ public:
|
||||
//static std::chrono::duration<double> diff;
|
||||
|
||||
//auto start = std::chrono::high_resolution_clock::now();
|
||||
parallel_for(int ss=0;ss<P._grid->oSites();ss++){
|
||||
parallel_for(int ss=0;ss<P.Grid()->oSites();ss++){
|
||||
for (int mu = 0; mu < Nd; mu++)
|
||||
U[ss]._internal[mu] = ProjectOnGroup(Exponentiate(P[ss]._internal[mu], ep, Nexp) * U[ss]._internal[mu]);
|
||||
}
|
||||
@ -112,7 +112,7 @@ public:
|
||||
}
|
||||
|
||||
static inline RealD FieldSquareNorm(Field& U){
|
||||
LatticeComplex Hloc(U._grid);
|
||||
LatticeComplex Hloc(U.Grid());
|
||||
Hloc = zero;
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
auto Umu = PeekIndex<LorentzIndex>(U, mu);
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
|
||||
static inline GaugeLinkField
|
||||
CovShiftIdentityBackward(const GaugeLinkField &Link, int mu) {
|
||||
GridBase *grid = Link._grid;
|
||||
GridBase *grid = Link.Grid();
|
||||
int Lmu = grid->GlobalDimensions()[mu] - 1;
|
||||
|
||||
Lattice<iScalar<vInteger>> coor(grid);
|
||||
@ -113,7 +113,7 @@ public:
|
||||
}
|
||||
|
||||
static inline GaugeLinkField ShiftStaple(const GaugeLinkField &Link, int mu) {
|
||||
GridBase *grid = Link._grid;
|
||||
GridBase *grid = Link.Grid();
|
||||
int Lmu = grid->GlobalDimensions()[mu] - 1;
|
||||
|
||||
Lattice<iScalar<vInteger>> coor(grid);
|
||||
|
@ -86,10 +86,10 @@ Photon<Gimpl>::Photon(Gauge gauge, ZmScheme zmScheme)
|
||||
template<class Gimpl>
|
||||
void Photon<Gimpl>::FreePropagator (const GaugeField &in,GaugeField &out)
|
||||
{
|
||||
FFT theFFT(in._grid);
|
||||
FFT theFFT(in.Grid());
|
||||
|
||||
GaugeField in_k(in._grid);
|
||||
GaugeField prop_k(in._grid);
|
||||
GaugeField in_k(in.Grid());
|
||||
GaugeField prop_k(in.Grid());
|
||||
|
||||
theFFT.FFT_all_dim(in_k,in,FFT::forward);
|
||||
MomentumSpacePropagator(prop_k,in_k);
|
||||
@ -99,7 +99,7 @@ void Photon<Gimpl>::FreePropagator (const GaugeField &in,GaugeField &out)
|
||||
template<class Gimpl>
|
||||
void Photon<Gimpl>::invKHatSquared(GaugeLinkField &out)
|
||||
{
|
||||
GridBase *grid = out._grid;
|
||||
GridBase *grid = out.Grid();
|
||||
GaugeLinkField kmu(grid), one(grid);
|
||||
const unsigned int nd = grid->_ndimension;
|
||||
std::vector<int> &l = grid->_fdimensions;
|
||||
@ -125,7 +125,7 @@ void Photon<Gimpl>::invKHatSquared(GaugeLinkField &out)
|
||||
template<class Gimpl>
|
||||
void Photon<Gimpl>::zmSub(GaugeLinkField &out)
|
||||
{
|
||||
GridBase *grid = out._grid;
|
||||
GridBase *grid = out.Grid();
|
||||
const unsigned int nd = grid->_ndimension;
|
||||
|
||||
switch (zmScheme_)
|
||||
@ -163,7 +163,7 @@ template<class Gimpl>
|
||||
void Photon<Gimpl>::MomentumSpacePropagator(const GaugeField &in,
|
||||
GaugeField &out)
|
||||
{
|
||||
GridBase *grid = out._grid;
|
||||
GridBase *grid = out.Grid();
|
||||
LatticeComplex k2Inv(grid);
|
||||
|
||||
invKHatSquared(k2Inv);
|
||||
@ -175,7 +175,7 @@ void Photon<Gimpl>::MomentumSpacePropagator(const GaugeField &in,
|
||||
template<class Gimpl>
|
||||
void Photon<Gimpl>::StochasticWeight(GaugeLinkField &weight)
|
||||
{
|
||||
auto *grid = dynamic_cast<GridCartesian *>(weight._grid);
|
||||
auto *grid = dynamic_cast<GridCartesian *>(weight.Grid());
|
||||
const unsigned int nd = grid->_ndimension;
|
||||
std::vector<int> latt_size = grid->_fdimensions;
|
||||
|
||||
@ -192,7 +192,7 @@ void Photon<Gimpl>::StochasticWeight(GaugeLinkField &weight)
|
||||
template<class Gimpl>
|
||||
void Photon<Gimpl>::StochasticField(GaugeField &out, GridParallelRNG &rng)
|
||||
{
|
||||
auto *grid = dynamic_cast<GridCartesian *>(out._grid);
|
||||
auto *grid = dynamic_cast<GridCartesian *>(out.Grid());
|
||||
GaugeLinkField weight(grid);
|
||||
|
||||
StochasticWeight(weight);
|
||||
@ -203,7 +203,7 @@ template<class Gimpl>
|
||||
void Photon<Gimpl>::StochasticField(GaugeField &out, GridParallelRNG &rng,
|
||||
const GaugeLinkField &weight)
|
||||
{
|
||||
auto *grid = dynamic_cast<GridCartesian *>(out._grid);
|
||||
auto *grid = dynamic_cast<GridCartesian *>(out.Grid());
|
||||
const unsigned int nd = grid->_ndimension;
|
||||
GaugeLinkField r(grid);
|
||||
GaugeField aTilde(grid);
|
||||
@ -226,7 +226,7 @@ void Photon<Gimpl>::StochasticField(GaugeField &out, GridParallelRNG &rng,
|
||||
//
|
||||
// FeynmanGaugeMomentumSpacePropagator_TL(out,in);
|
||||
//
|
||||
// GridBase *grid = out._grid;
|
||||
// GridBase *grid = out.Grid();
|
||||
// LatticeInteger coor(grid);
|
||||
// GaugeField zz(grid); zz=zero;
|
||||
//
|
||||
@ -243,7 +243,7 @@ void Photon<Gimpl>::StochasticField(GaugeField &out, GridParallelRNG &rng,
|
||||
// {
|
||||
//
|
||||
// // what type LatticeComplex
|
||||
// GridBase *grid = out._grid;
|
||||
// GridBase *grid = out.Grid();
|
||||
// int nd = grid->_ndimension;
|
||||
//
|
||||
// typedef typename GaugeField::vector_type vector_type;
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
|
||||
|
||||
virtual RealD S(const GaugeField &U) {
|
||||
RealD vol = U._grid->gSites();
|
||||
RealD vol = U.Grid()->gSites();
|
||||
|
||||
RealD plaq = WilsonLoops<Gimpl>::avgPlaquette(U);
|
||||
RealD rect = WilsonLoops<Gimpl>::avgRectangle(U);
|
||||
@ -76,7 +76,7 @@ public:
|
||||
RealD factor_p = c_plaq/RealD(Nc)*0.5;
|
||||
RealD factor_r = c_rect/RealD(Nc)*0.5;
|
||||
|
||||
GridBase *grid = Umu._grid;
|
||||
GridBase *grid = Umu.Grid();
|
||||
|
||||
std::vector<GaugeLinkField> U (Nd,grid);
|
||||
std::vector<GaugeLinkField> U2(Nd,grid);
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
|
||||
virtual RealD S(const GaugeField &U) {
|
||||
RealD plaq = WilsonLoops<Gimpl>::avgPlaquette(U);
|
||||
RealD vol = U._grid->gSites();
|
||||
RealD vol = U.Grid()->gSites();
|
||||
RealD action = beta * (1.0 - plaq) * (Nd * (Nd - 1.0)) * vol * 0.5;
|
||||
return action;
|
||||
};
|
||||
@ -70,8 +70,8 @@ public:
|
||||
|
||||
RealD factor = 0.5 * beta / RealD(Nc);
|
||||
|
||||
//GaugeLinkField Umu(U._grid);
|
||||
GaugeLinkField dSdU_mu(U._grid);
|
||||
//GaugeLinkField Umu(U.Grid());
|
||||
GaugeLinkField dSdU_mu(U.Grid());
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
//Umu = PeekIndex<LorentzIndex>(U, mu);
|
||||
|
||||
|
@ -57,8 +57,8 @@ public:
|
||||
FermionField tmp1(fcbgrid);
|
||||
FermionField tmp2(fcbgrid);
|
||||
|
||||
conformable(fcbgrid,U._grid);
|
||||
conformable(fcbgrid,V._grid);
|
||||
conformable(fcbgrid,U.Grid());
|
||||
conformable(fcbgrid,V.Grid());
|
||||
|
||||
// Assert the checkerboard?? or code for either
|
||||
assert(U.Checkerboard()==Odd);
|
||||
@ -68,7 +68,7 @@ public:
|
||||
// it is not conformable with the HMC force field
|
||||
// Case: Ls vectorised fields
|
||||
// INHERIT FROM THE Force field instead
|
||||
GridRedBlackCartesian* forcecb = new GridRedBlackCartesian(Force._grid);
|
||||
GridRedBlackCartesian* forcecb = new GridRedBlackCartesian(Force.Grid());
|
||||
GaugeField ForceO(forcecb);
|
||||
GaugeField ForceE(forcecb);
|
||||
|
||||
@ -102,8 +102,8 @@ public:
|
||||
FermionField tmp1(fcbgrid);
|
||||
FermionField tmp2(fcbgrid);
|
||||
|
||||
conformable(fcbgrid,U._grid);
|
||||
conformable(fcbgrid,V._grid);
|
||||
conformable(fcbgrid,U.Grid());
|
||||
conformable(fcbgrid,V.Grid());
|
||||
|
||||
// Assert the checkerboard?? or code for either
|
||||
assert(V.Checkerboard()==Odd);
|
||||
@ -112,7 +112,7 @@ public:
|
||||
// NOTE Guido: WE DO NOT WANT TO USE THE ucbgrid GRID FOR THE FORCE
|
||||
// it is not conformable with the HMC force field
|
||||
// INHERIT FROM THE Force field instead
|
||||
GridRedBlackCartesian* forcecb = new GridRedBlackCartesian(Force._grid);
|
||||
GridRedBlackCartesian* forcecb = new GridRedBlackCartesian(Force.Grid());
|
||||
GaugeField ForceO(forcecb);
|
||||
GaugeField ForceE(forcecb);
|
||||
|
||||
|
@ -173,7 +173,7 @@ public:
|
||||
FermionField Y(NumOp.FermionRedBlackGrid());
|
||||
|
||||
// This assignment is necessary to be compliant with the HMC grids
|
||||
GaugeField force(dSdU._grid);
|
||||
GaugeField force(dSdU.Grid());
|
||||
|
||||
//Y=Vdag phi
|
||||
//X = (Mdag M)^-1 V^dag phi
|
||||
|
@ -65,8 +65,8 @@ public:
|
||||
|
||||
virtual void deriv(const Field &p,
|
||||
Field &force) {
|
||||
Field tmp(p._grid);
|
||||
Field p2(p._grid);
|
||||
Field tmp(p.Grid());
|
||||
Field p2(p.Grid());
|
||||
ScalarObs<Impl>::phisquared(p2, p);
|
||||
tmp = -(Cshift(p, 0, -1) + Cshift(p, 0, 1));
|
||||
for (int mu = 1; mu < Nd; mu++) tmp -= Cshift(p, mu, -1) + Cshift(p, mu, 1);
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
|
||||
static void MomentumSpacePropagator(Field &out, RealD m)
|
||||
{
|
||||
GridBase *grid = out._grid;
|
||||
GridBase *grid = out.Grid();
|
||||
Field kmu(grid), one(grid);
|
||||
const unsigned int nd = grid->_ndimension;
|
||||
std::vector<int> &l = grid->_fdimensions;
|
||||
@ -69,8 +69,8 @@ public:
|
||||
static void FreePropagator(const Field &in, Field &out,
|
||||
const Field &momKernel)
|
||||
{
|
||||
FFT fft((GridCartesian *)in._grid);
|
||||
Field inFT(in._grid);
|
||||
FFT fft((GridCartesian *)in.Grid());
|
||||
Field inFT(in.Grid());
|
||||
|
||||
fft.FFT_all_dim(inFT, in, FFT::forward);
|
||||
inFT = inFT*momKernel;
|
||||
@ -79,7 +79,7 @@ public:
|
||||
|
||||
static void FreePropagator(const Field &in, Field &out, RealD m)
|
||||
{
|
||||
Field momKernel(in._grid);
|
||||
Field momKernel(in.Grid());
|
||||
|
||||
MomentumSpacePropagator(momKernel, m);
|
||||
FreePropagator(in, out, momKernel);
|
||||
|
@ -74,15 +74,15 @@ public:
|
||||
virtual void refresh(const Field &U, GridParallelRNG &pRNG) {}
|
||||
|
||||
virtual RealD S(const Field &p) {
|
||||
assert(p._grid->Nd() == Ndim);
|
||||
static Stencil phiStencil(p._grid, npoint, 0, directions, displacements);
|
||||
assert(p.Grid()->Nd() == Ndim);
|
||||
static Stencil phiStencil(p.Grid(), npoint, 0, directions, displacements);
|
||||
phiStencil.HaloExchange(p, compressor);
|
||||
Field action(p._grid), pshift(p._grid), phisquared(p._grid);
|
||||
Field action(p.Grid()), pshift(p.Grid()), phisquared(p.Grid());
|
||||
phisquared = p*p;
|
||||
action = (2.0*Ndim + mass_square)*phisquared - lambda/24.*phisquared*phisquared;
|
||||
for (int mu = 0; mu < Ndim; mu++) {
|
||||
// pshift = Cshift(p, mu, +1); // not efficient, implement with stencils
|
||||
parallel_for (int i = 0; i < p._grid->oSites(); i++) {
|
||||
parallel_for (int i = 0; i < p.Grid()->oSites(); i++) {
|
||||
int permute_type;
|
||||
StencilEntry *SE;
|
||||
vobj temp2;
|
||||
@ -110,15 +110,15 @@ public:
|
||||
};
|
||||
|
||||
virtual void deriv(const Field &p, Field &force) {
|
||||
assert(p._grid->Nd() == Ndim);
|
||||
assert(p.Grid()->Nd() == Ndim);
|
||||
force = (2.0*Ndim + mass_square)*p - lambda/12.*p*p*p;
|
||||
// move this outside
|
||||
static Stencil phiStencil(p._grid, npoint, 0, directions, displacements);
|
||||
static Stencil phiStencil(p.Grid(), npoint, 0, directions, displacements);
|
||||
phiStencil.HaloExchange(p, compressor);
|
||||
|
||||
//for (int mu = 0; mu < Nd; mu++) force -= Cshift(p, mu, -1) + Cshift(p, mu, 1);
|
||||
for (int point = 0; point < npoint; point++) {
|
||||
parallel_for (int i = 0; i < p._grid->oSites(); i++) {
|
||||
parallel_for (int i = 0; i < p.Grid()->oSites(); i++) {
|
||||
const vobj *temp;
|
||||
vobj temp2;
|
||||
int permute_type;
|
||||
|
Reference in New Issue
Block a user