mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-03 21:44:33 +00:00 
			
		
		
		
	_grid becomes private ; use Grid()§
This commit is contained in:
		@@ -538,7 +538,7 @@ public:
 | 
			
		||||
    {
 | 
			
		||||
      LatticeGaugeField Umu5d(FGrid); 
 | 
			
		||||
      std::vector<LatticeColourMatrix> U(4,FGrid);
 | 
			
		||||
      for(int ss=0;ss<Umu._grid->oSites();ss++){
 | 
			
		||||
      for(int ss=0;ss<Umu.Grid()->oSites();ss++){
 | 
			
		||||
	for(int s=0;s<Ls;s++){
 | 
			
		||||
	  Umu5d[Ls*ss+s] = Umu[ss];
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -122,7 +122,7 @@ int main (int argc, char ** argv)
 | 
			
		||||
  // replicate across fifth dimension
 | 
			
		||||
  LatticeGaugeField Umu5d(FGrid); 
 | 
			
		||||
  std::vector<LatticeColourMatrix> U(4,FGrid);
 | 
			
		||||
  for(int ss=0;ss<Umu._grid->oSites();ss++){
 | 
			
		||||
  for(int ss=0;ss<Umu.Grid()->oSites();ss++){
 | 
			
		||||
    for(int s=0;s<Ls;s++){
 | 
			
		||||
      Umu5d[Ls*ss+s] = Umu[ss];
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -132,7 +132,7 @@ void benchDw(std::vector<int> & latt4, int Ls, int threads,int report )
 | 
			
		||||
  LatticeGaugeField Umu5d(FGrid); 
 | 
			
		||||
 | 
			
		||||
  // replicate across fifth dimension
 | 
			
		||||
  for(int ss=0;ss<Umu._grid->oSites();ss++){
 | 
			
		||||
  for(int ss=0;ss<Umu.Grid()->oSites();ss++){
 | 
			
		||||
    for(int s=0;s<Ls;s++){
 | 
			
		||||
      Umu5d[Ls*ss+s] = Umu[ss];
 | 
			
		||||
    }
 | 
			
		||||
@@ -272,7 +272,7 @@ void benchsDw(std::vector<int> & latt4, int Ls, int threads, int report )
 | 
			
		||||
  LatticeGaugeField Umu5d(FGrid); 
 | 
			
		||||
 | 
			
		||||
  // replicate across fifth dimension
 | 
			
		||||
  for(int ss=0;ss<Umu._grid->oSites();ss++){
 | 
			
		||||
  for(int ss=0;ss<Umu.Grid()->oSites();ss++){
 | 
			
		||||
    for(int s=0;s<Ls;s++){
 | 
			
		||||
      Umu5d[Ls*ss+s] = Umu[ss];
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ if test "${OPENMP_CXXFLAGS}X" != "X"; then
 | 
			
		||||
  AM_CXXFLAGS="$OPENMP_CXXFLAGS $AM_CXXFLAGS"
 | 
			
		||||
  AM_LDFLAGS="$OPENMP_CXXFLAGS $AM_LDFLAGS"
 | 
			
		||||
fi
 | 
			
		||||
ac_openmp=yes
 | 
			
		||||
ac_openmp=no
 | 
			
		||||
 | 
			
		||||
############### Checks for header files
 | 
			
		||||
AC_CHECK_HEADERS(stdint.h)
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@ public:
 | 
			
		||||
  static void traceDirPlaquette(LatticeComplex &plaq,
 | 
			
		||||
                                const std::vector<GaugeMat> &U, const int mu,
 | 
			
		||||
                                const int nu) {
 | 
			
		||||
    GaugeMat sp(U[0]._grid);
 | 
			
		||||
    GaugeMat sp(U[0].Grid());
 | 
			
		||||
    dirPlaquette(sp, U, mu, nu);
 | 
			
		||||
    plaq = trace(sp);
 | 
			
		||||
  }
 | 
			
		||||
@@ -43,9 +43,9 @@ public:
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static void sitePlaquette(LatticeComplex &Plaq,
 | 
			
		||||
                            const std::vector<GaugeMat> &U) {
 | 
			
		||||
    LatticeComplex sitePlaq(U[0]._grid);
 | 
			
		||||
    LatticeComplex sitePlaq(U[0].Grid());
 | 
			
		||||
    Plaq = zero;
 | 
			
		||||
    for (int mu = 1; mu < U[0]._grid->_ndimension; mu++) {
 | 
			
		||||
    for (int mu = 1; mu < U[0].Grid()->_ndimension; mu++) {
 | 
			
		||||
      for (int nu = 0; nu < mu; nu++) {
 | 
			
		||||
        traceDirPlaquette(sitePlaq, U, mu, nu);
 | 
			
		||||
        Plaq = Plaq + sitePlaq;
 | 
			
		||||
@@ -56,13 +56,13 @@ public:
 | 
			
		||||
  // sum over all x,y,z,t and over all planes of plaquette
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static Real sumPlaquette(const GaugeLorentz &Umu) {
 | 
			
		||||
    std::vector<GaugeMat> U(4, Umu._grid);
 | 
			
		||||
    std::vector<GaugeMat> U(4, Umu.Grid());
 | 
			
		||||
 | 
			
		||||
    for (int mu = 0; mu < Umu._grid->_ndimension; mu++) {
 | 
			
		||||
    for (int mu = 0; mu < Umu.Grid()->_ndimension; mu++) {
 | 
			
		||||
      U[mu] = PeekIndex<LorentzIndex>(Umu, mu);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    LatticeComplex Plaq(Umu._grid);
 | 
			
		||||
    LatticeComplex Plaq(Umu.Grid());
 | 
			
		||||
 | 
			
		||||
    sitePlaquette(Plaq, U);
 | 
			
		||||
 | 
			
		||||
@@ -74,9 +74,9 @@ public:
 | 
			
		||||
  // average over all x,y,z,t and over all planes of plaquette
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static Real avgPlaquette(const GaugeLorentz &Umu) {
 | 
			
		||||
    int ndim = Umu._grid->_ndimension;
 | 
			
		||||
    int ndim = Umu.Grid()->_ndimension;
 | 
			
		||||
    Real sumplaq = sumPlaquette(Umu);
 | 
			
		||||
    Real vol = Umu._grid->gSites();
 | 
			
		||||
    Real vol = Umu.Grid()->gSites();
 | 
			
		||||
    Real faces = (1.0 * ndim * (ndim - 1)) / 2.0;
 | 
			
		||||
    return sumplaq / vol / faces / Nc; // Nc dependent... FIXME
 | 
			
		||||
  }
 | 
			
		||||
@@ -112,7 +112,7 @@ public:
 | 
			
		||||
                                const std::vector<GaugeMat> &U,
 | 
			
		||||
                                const int Rmu, const int Rnu,
 | 
			
		||||
                                const int mu, const int nu) {
 | 
			
		||||
    GaugeMat sp(U[0]._grid);
 | 
			
		||||
    GaugeMat sp(U[0].Grid());
 | 
			
		||||
    wilsonLoop(sp, U, Rmu, Rnu, mu, nu);
 | 
			
		||||
    wl = trace(sp);
 | 
			
		||||
  }
 | 
			
		||||
@@ -122,9 +122,9 @@ public:
 | 
			
		||||
  static void siteWilsonLoop(LatticeComplex &Wl,
 | 
			
		||||
                            const std::vector<GaugeMat> &U,
 | 
			
		||||
                            const int R1, const int R2) {
 | 
			
		||||
    LatticeComplex siteWl(U[0]._grid);
 | 
			
		||||
    LatticeComplex siteWl(U[0].Grid());
 | 
			
		||||
    Wl = zero;
 | 
			
		||||
    for (int mu = 1; mu < U[0]._grid->_ndimension; mu++) {
 | 
			
		||||
    for (int mu = 1; mu < U[0].Grid()->_ndimension; mu++) {
 | 
			
		||||
      for (int nu = 0; nu < mu; nu++) {
 | 
			
		||||
        traceWilsonLoop(siteWl, U, R1, R2, mu, nu);
 | 
			
		||||
        Wl = Wl + siteWl;
 | 
			
		||||
@@ -140,9 +140,9 @@ public:
 | 
			
		||||
  static void siteTimelikeWilsonLoop(LatticeComplex &Wl,
 | 
			
		||||
                            const std::vector<GaugeMat> &U,
 | 
			
		||||
                            const int R1, const int R2) {
 | 
			
		||||
    LatticeComplex siteWl(U[0]._grid);
 | 
			
		||||
    LatticeComplex siteWl(U[0].Grid());
 | 
			
		||||
 | 
			
		||||
    int ndim = U[0]._grid->_ndimension;
 | 
			
		||||
    int ndim = U[0].Grid()->_ndimension;
 | 
			
		||||
 | 
			
		||||
    Wl = zero;
 | 
			
		||||
    for (int nu = 0; nu < ndim - 1; nu++) {
 | 
			
		||||
@@ -156,10 +156,10 @@ public:
 | 
			
		||||
  static void siteSpatialWilsonLoop(LatticeComplex &Wl,
 | 
			
		||||
                            const std::vector<GaugeMat> &U,
 | 
			
		||||
                            const int R1, const int R2) {
 | 
			
		||||
    LatticeComplex siteWl(U[0]._grid);
 | 
			
		||||
    LatticeComplex siteWl(U[0].Grid());
 | 
			
		||||
 | 
			
		||||
    Wl = zero;
 | 
			
		||||
    for (int mu = 1; mu < U[0]._grid->_ndimension - 1; mu++) {
 | 
			
		||||
    for (int mu = 1; mu < U[0].Grid()->_ndimension - 1; mu++) {
 | 
			
		||||
      for (int nu = 0; nu < mu; nu++) {
 | 
			
		||||
        traceWilsonLoop(siteWl, U, R1, R2, mu, nu);
 | 
			
		||||
        Wl = Wl + siteWl;
 | 
			
		||||
@@ -173,13 +173,13 @@ public:
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static Real sumWilsonLoop(const GaugeLorentz &Umu,
 | 
			
		||||
                            const int R1, const int R2) {
 | 
			
		||||
    std::vector<GaugeMat> U(4, Umu._grid);
 | 
			
		||||
    std::vector<GaugeMat> U(4, Umu.Grid());
 | 
			
		||||
 | 
			
		||||
    for (int mu = 0; mu < Umu._grid->_ndimension; mu++) {
 | 
			
		||||
    for (int mu = 0; mu < Umu.Grid()->_ndimension; mu++) {
 | 
			
		||||
      U[mu] = PeekIndex<LorentzIndex>(Umu, mu);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    LatticeComplex Wl(Umu._grid);
 | 
			
		||||
    LatticeComplex Wl(Umu.Grid());
 | 
			
		||||
 | 
			
		||||
    siteWilsonLoop(Wl, U, R1, R2);
 | 
			
		||||
 | 
			
		||||
@@ -192,13 +192,13 @@ public:
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static Real sumTimelikeWilsonLoop(const GaugeLorentz &Umu,
 | 
			
		||||
                            const int R1, const int R2) {
 | 
			
		||||
    std::vector<GaugeMat> U(4, Umu._grid);
 | 
			
		||||
    std::vector<GaugeMat> U(4, Umu.Grid());
 | 
			
		||||
 | 
			
		||||
    for (int mu = 0; mu < Umu._grid->_ndimension; mu++) {
 | 
			
		||||
    for (int mu = 0; mu < Umu.Grid()->_ndimension; mu++) {
 | 
			
		||||
      U[mu] = PeekIndex<LorentzIndex>(Umu, mu);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    LatticeComplex Wl(Umu._grid);
 | 
			
		||||
    LatticeComplex Wl(Umu.Grid());
 | 
			
		||||
 | 
			
		||||
    siteTimelikeWilsonLoop(Wl, U, R1, R2);
 | 
			
		||||
 | 
			
		||||
@@ -211,13 +211,13 @@ public:
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static Real sumSpatialWilsonLoop(const GaugeLorentz &Umu,
 | 
			
		||||
                            const int R1, const int R2) {
 | 
			
		||||
    std::vector<GaugeMat> U(4, Umu._grid);
 | 
			
		||||
    std::vector<GaugeMat> U(4, Umu.Grid());
 | 
			
		||||
 | 
			
		||||
    for (int mu = 0; mu < Umu._grid->_ndimension; mu++) {
 | 
			
		||||
    for (int mu = 0; mu < Umu.Grid()->_ndimension; mu++) {
 | 
			
		||||
      U[mu] = PeekIndex<LorentzIndex>(Umu, mu);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    LatticeComplex Wl(Umu._grid);
 | 
			
		||||
    LatticeComplex Wl(Umu.Grid());
 | 
			
		||||
 | 
			
		||||
    siteSpatialWilsonLoop(Wl, U, R1, R2);
 | 
			
		||||
 | 
			
		||||
@@ -230,9 +230,9 @@ public:
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static Real avgWilsonLoop(const GaugeLorentz &Umu,
 | 
			
		||||
                            const int R1, const int R2) {
 | 
			
		||||
    int ndim = Umu._grid->_ndimension;
 | 
			
		||||
    int ndim = Umu.Grid()->_ndimension;
 | 
			
		||||
    Real sumWl = sumWilsonLoop(Umu, R1, R2);
 | 
			
		||||
    Real vol = Umu._grid->gSites();
 | 
			
		||||
    Real vol = Umu.Grid()->gSites();
 | 
			
		||||
    Real faces = 1.0 * ndim * (ndim - 1);
 | 
			
		||||
    return sumWl / vol / faces / Nc; // Nc dependent... FIXME
 | 
			
		||||
  }
 | 
			
		||||
@@ -241,9 +241,9 @@ public:
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static Real avgTimelikeWilsonLoop(const GaugeLorentz &Umu,
 | 
			
		||||
                            const int R1, const int R2) {
 | 
			
		||||
    int ndim = Umu._grid->_ndimension;
 | 
			
		||||
    int ndim = Umu.Grid()->_ndimension;
 | 
			
		||||
    Real sumWl = sumTimelikeWilsonLoop(Umu, R1, R2);
 | 
			
		||||
    Real vol = Umu._grid->gSites();
 | 
			
		||||
    Real vol = Umu.Grid()->gSites();
 | 
			
		||||
    Real faces = 1.0 * (ndim - 1);
 | 
			
		||||
    return sumWl / vol / faces / Nc; // Nc dependent... FIXME
 | 
			
		||||
  }
 | 
			
		||||
@@ -252,9 +252,9 @@ public:
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static Real avgSpatialWilsonLoop(const GaugeLorentz &Umu,
 | 
			
		||||
                            const int R1, const int R2) {
 | 
			
		||||
    int ndim = Umu._grid->_ndimension;
 | 
			
		||||
    int ndim = Umu.Grid()->_ndimension;
 | 
			
		||||
    Real sumWl = sumSpatialWilsonLoop(Umu, R1, R2);
 | 
			
		||||
    Real vol = Umu._grid->gSites();
 | 
			
		||||
    Real vol = Umu.Grid()->gSites();
 | 
			
		||||
    Real faces = 1.0 * (ndim - 1) * (ndim - 2);
 | 
			
		||||
    return sumWl / vol / faces / Nc; // Nc dependent... FIXME
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -266,8 +266,8 @@ public:
 | 
			
		||||
 | 
			
		||||
  RealD M (const CoarseVector &in, CoarseVector &out){
 | 
			
		||||
 | 
			
		||||
    conformable(_grid,in._grid);
 | 
			
		||||
    conformable(in._grid,out._grid);
 | 
			
		||||
    conformable(_grid,in.Grid());
 | 
			
		||||
    conformable(in.Grid(),out.Grid());
 | 
			
		||||
 | 
			
		||||
    SimpleCompressor<siteVector> compressor;
 | 
			
		||||
    Stencil.HaloExchange(in,compressor);
 | 
			
		||||
 
 | 
			
		||||
@@ -148,8 +148,8 @@ public:
 | 
			
		||||
  template<class vobj>
 | 
			
		||||
  void FFT_dim_mask(Lattice<vobj> &result,const Lattice<vobj> &source,std::vector<int> mask,int sign){
 | 
			
		||||
 | 
			
		||||
    conformable(result._grid,vgrid);
 | 
			
		||||
    conformable(source._grid,vgrid);
 | 
			
		||||
    conformable(result.Grid(),vgrid);
 | 
			
		||||
    conformable(source.Grid(),vgrid);
 | 
			
		||||
    Lattice<vobj> tmp(vgrid);
 | 
			
		||||
    tmp = source;
 | 
			
		||||
    for(int d=0;d<Nd;d++){
 | 
			
		||||
@@ -172,8 +172,8 @@ public:
 | 
			
		||||
#ifndef HAVE_FFTW
 | 
			
		||||
    assert(0);
 | 
			
		||||
#else
 | 
			
		||||
    conformable(result._grid,vgrid);
 | 
			
		||||
    conformable(source._grid,vgrid);
 | 
			
		||||
    conformable(result.Grid(),vgrid);
 | 
			
		||||
    conformable(source.Grid(),vgrid);
 | 
			
		||||
 | 
			
		||||
    int L = vgrid->_ldimensions[dim];
 | 
			
		||||
    int G = vgrid->_fdimensions[dim];
 | 
			
		||||
 
 | 
			
		||||
@@ -183,7 +183,7 @@ public:
 | 
			
		||||
  virtual  RealD Mpc      (const Field &in, Field &out) =0;
 | 
			
		||||
  virtual  RealD MpcDag   (const Field &in, Field &out) =0;
 | 
			
		||||
  virtual void MpcDagMpc(const Field &in, Field &out,RealD &ni,RealD &no) {
 | 
			
		||||
    Field tmp(in._grid);
 | 
			
		||||
    Field tmp(in.Grid());
 | 
			
		||||
    ni=Mpc(in,tmp);
 | 
			
		||||
    no=MpcDag(tmp,out);
 | 
			
		||||
  }
 | 
			
		||||
@@ -215,8 +215,8 @@ protected:
 | 
			
		||||
public:
 | 
			
		||||
  SchurDiagMooeeOperator (Matrix &Mat): _Mat(Mat){};
 | 
			
		||||
  virtual  RealD Mpc      (const Field &in, Field &out) {
 | 
			
		||||
    Field tmp(in._grid);
 | 
			
		||||
    //	std::cout <<"grid pointers: in._grid="<< in._grid << " out._grid=" << out._grid << "  _Mat.Grid=" << _Mat.Grid() << " _Mat.RedBlackGrid=" << _Mat.RedBlackGrid() << std::endl;
 | 
			
		||||
    Field tmp(in.Grid());
 | 
			
		||||
    //	std::cout <<"grid pointers: in.Grid()="<< in.Grid() << " out.Grid()=" << out.Grid() << "  _Mat.Grid=" << _Mat.Grid() << " _Mat.RedBlackGrid=" << _Mat.RedBlackGrid() << std::endl;
 | 
			
		||||
 | 
			
		||||
    _Mat.Meooe(in,tmp);
 | 
			
		||||
    _Mat.MooeeInv(tmp,out);
 | 
			
		||||
@@ -226,7 +226,7 @@ public:
 | 
			
		||||
    return axpy_norm(out,-1.0,tmp,out);
 | 
			
		||||
  }
 | 
			
		||||
  virtual  RealD MpcDag   (const Field &in, Field &out){
 | 
			
		||||
    Field tmp(in._grid);
 | 
			
		||||
    Field tmp(in.Grid());
 | 
			
		||||
 | 
			
		||||
    _Mat.MeooeDag(in,tmp);
 | 
			
		||||
    _Mat.MooeeInvDag(tmp,out);
 | 
			
		||||
@@ -244,7 +244,7 @@ public:
 | 
			
		||||
  SchurDiagOneOperator (Matrix &Mat): _Mat(Mat){};
 | 
			
		||||
 | 
			
		||||
  virtual  RealD Mpc      (const Field &in, Field &out) {
 | 
			
		||||
    Field tmp(in._grid);
 | 
			
		||||
    Field tmp(in.Grid());
 | 
			
		||||
 | 
			
		||||
    _Mat.Meooe(in,out);
 | 
			
		||||
    _Mat.MooeeInv(out,tmp);
 | 
			
		||||
@@ -254,7 +254,7 @@ public:
 | 
			
		||||
    return axpy_norm(out,-1.0,tmp,in);
 | 
			
		||||
  }
 | 
			
		||||
  virtual  RealD MpcDag   (const Field &in, Field &out){
 | 
			
		||||
    Field tmp(in._grid);
 | 
			
		||||
    Field tmp(in.Grid());
 | 
			
		||||
 | 
			
		||||
    _Mat.MooeeInvDag(in,out);
 | 
			
		||||
    _Mat.MeooeDag(out,tmp);
 | 
			
		||||
@@ -272,7 +272,7 @@ public:
 | 
			
		||||
  SchurDiagTwoOperator (Matrix &Mat): _Mat(Mat){};
 | 
			
		||||
 | 
			
		||||
  virtual  RealD Mpc      (const Field &in, Field &out) {
 | 
			
		||||
    Field tmp(in._grid);
 | 
			
		||||
    Field tmp(in.Grid());
 | 
			
		||||
 | 
			
		||||
    _Mat.MooeeInv(in,out);
 | 
			
		||||
    _Mat.Meooe(out,tmp);
 | 
			
		||||
@@ -282,7 +282,7 @@ public:
 | 
			
		||||
    return axpy_norm(out,-1.0,tmp,in);
 | 
			
		||||
  }
 | 
			
		||||
  virtual  RealD MpcDag   (const Field &in, Field &out){
 | 
			
		||||
    Field tmp(in._grid);
 | 
			
		||||
    Field tmp(in.Grid());
 | 
			
		||||
 | 
			
		||||
    _Mat.MeooeDag(in,out);
 | 
			
		||||
    _Mat.MooeeInvDag(out,tmp);
 | 
			
		||||
@@ -321,8 +321,8 @@ public:
 | 
			
		||||
    Mpc(in,out);
 | 
			
		||||
  }
 | 
			
		||||
  virtual  RealD Mpc      (const Field &in, Field &out) {
 | 
			
		||||
    Field tmp(in._grid);
 | 
			
		||||
    Field tmp2(in._grid);
 | 
			
		||||
    Field tmp(in.Grid());
 | 
			
		||||
    Field tmp2(in.Grid());
 | 
			
		||||
 | 
			
		||||
    std::cout << GridLogIterative << " HermOp.Mpc "<<std::endl;
 | 
			
		||||
    _Mat.Mooee(in,out);
 | 
			
		||||
@@ -437,8 +437,8 @@ public:
 | 
			
		||||
  // Implement the required interface
 | 
			
		||||
  void operator() (LinearOperatorBase<Field> &Linop, const Field &in, Field &out) {
 | 
			
		||||
 | 
			
		||||
    Field AtoN(in._grid);
 | 
			
		||||
    Field Mtmp(in._grid);
 | 
			
		||||
    Field AtoN(in.Grid());
 | 
			
		||||
    Field Mtmp(in.Grid());
 | 
			
		||||
    AtoN = in;
 | 
			
		||||
    out = AtoN*Coeffs[0];
 | 
			
		||||
    for(int n=1;n<Coeffs.size();n++){
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,7 @@ public:
 | 
			
		||||
  virtual RealD M    (const Field &in, Field &out)=0;
 | 
			
		||||
  virtual RealD Mdag (const Field &in, Field &out)=0;
 | 
			
		||||
  virtual void  MdagM(const Field &in, Field &out,RealD &ni,RealD &no) {
 | 
			
		||||
    Field tmp (in._grid);
 | 
			
		||||
    Field tmp (in.Grid());
 | 
			
		||||
    ni=M(in,tmp);
 | 
			
		||||
    no=Mdag(tmp,out);
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -212,9 +212,9 @@ public:
 | 
			
		||||
  // Implement the required interface
 | 
			
		||||
  void operator() (LinearOperatorBase<Field> &Linop, const Field &in, Field &out) {
 | 
			
		||||
 | 
			
		||||
    GridBase *grid=in._grid;
 | 
			
		||||
    GridBase *grid=in.Grid();
 | 
			
		||||
 | 
			
		||||
    // std::cout << "Chevyshef(): in._grid="<<in._grid<<std::endl;
 | 
			
		||||
    // std::cout << "Chevyshef(): in.Grid()="<<in.Grid()<<std::endl;
 | 
			
		||||
    //std::cout <<" Linop.Grid()="<<Linop.Grid()<<"Linop.RedBlackGrid()="<<Linop.RedBlackGrid()<<std::endl;
 | 
			
		||||
 | 
			
		||||
    int vol=grid->gSites();
 | 
			
		||||
@@ -321,7 +321,7 @@ public:
 | 
			
		||||
  // shift_Multiply in Rudy's code
 | 
			
		||||
  void AminusMuSq(LinearOperatorBase<Field> &Linop, const Field &in, Field &out) 
 | 
			
		||||
  {
 | 
			
		||||
    GridBase *grid=in._grid;
 | 
			
		||||
    GridBase *grid=in.Grid();
 | 
			
		||||
    Field tmp(grid);
 | 
			
		||||
 | 
			
		||||
    RealD aa= alpha*alpha;
 | 
			
		||||
@@ -338,7 +338,7 @@ public:
 | 
			
		||||
  // Implement the required interface
 | 
			
		||||
  void operator() (LinearOperatorBase<Field> &Linop, const Field &in, Field &out) {
 | 
			
		||||
 | 
			
		||||
    GridBase *grid=in._grid;
 | 
			
		||||
    GridBase *grid=in.Grid();
 | 
			
		||||
 | 
			
		||||
    int vol=grid->gSites();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -91,7 +91,7 @@ class TwoLevelFlexiblePcg : public LinearFunction<Field>
 | 
			
		||||
  void operator() (const Field &src, Field &psi){
 | 
			
		||||
 | 
			
		||||
    psi.Checkerboard() = src.Checkerboard();
 | 
			
		||||
    grid             = src._grid;
 | 
			
		||||
    grid             = src.Grid();
 | 
			
		||||
 | 
			
		||||
    RealD f;
 | 
			
		||||
    RealD rtzp,rtz,a,d,b;
 | 
			
		||||
 
 | 
			
		||||
@@ -139,7 +139,7 @@ public:
 | 
			
		||||
  void BlockCGrQsolve(LinearOperatorBase<Field> &Linop, const Field &B, Field &X) 
 | 
			
		||||
  {
 | 
			
		||||
    int Orthog = blockDim; // First dimension is block dim; this is an assumption
 | 
			
		||||
    Nblock = B._grid->_fdimensions[Orthog];
 | 
			
		||||
    Nblock = B.Grid()->_fdimensions[Orthog];
 | 
			
		||||
 | 
			
		||||
    std::cout<<GridLogMessage<<" Block Conjugate Gradient : Orthog "<<Orthog<<" Nblock "<<Nblock<<std::endl;
 | 
			
		||||
 | 
			
		||||
@@ -323,7 +323,7 @@ public:
 | 
			
		||||
  void BlockCGsolve(LinearOperatorBase<Field> &Linop, const Field &Src, Field &Psi) 
 | 
			
		||||
  {
 | 
			
		||||
    int Orthog = blockDim; // First dimension is block dim; this is an assumption
 | 
			
		||||
    Nblock = Src._grid->_fdimensions[Orthog];
 | 
			
		||||
    Nblock = Src.Grid()->_fdimensions[Orthog];
 | 
			
		||||
 | 
			
		||||
    std::cout<<GridLogMessage<<" Block Conjugate Gradient : Orthog "<<Orthog<<" Nblock "<<Nblock<<std::endl;
 | 
			
		||||
 | 
			
		||||
@@ -470,7 +470,7 @@ public:
 | 
			
		||||
  void CGmultiRHSsolve(LinearOperatorBase<Field> &Linop, const Field &Src, Field &Psi) 
 | 
			
		||||
  {
 | 
			
		||||
    int Orthog = blockDim; // First dimension is block dim
 | 
			
		||||
    Nblock = Src._grid->_fdimensions[Orthog];
 | 
			
		||||
    Nblock = Src.Grid()->_fdimensions[Orthog];
 | 
			
		||||
 | 
			
		||||
    std::cout<<GridLogMessage<<"MultiRHS Conjugate Gradient : Orthog "<<Orthog<<" Nblock "<<Nblock<<std::endl;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -73,7 +73,7 @@ public:
 | 
			
		||||
    RealD src_norm = norm2(src_d_in);
 | 
			
		||||
    RealD stop = src_norm * Tolerance*Tolerance;
 | 
			
		||||
 | 
			
		||||
    GridBase* DoublePrecGrid = src_d_in._grid;
 | 
			
		||||
    GridBase* DoublePrecGrid = src_d_in.Grid();
 | 
			
		||||
    FieldD tmp_d(DoublePrecGrid);
 | 
			
		||||
    tmp_d.Checkerboard() = cb;
 | 
			
		||||
    
 | 
			
		||||
 
 | 
			
		||||
@@ -55,7 +55,7 @@ public:
 | 
			
		||||
 | 
			
		||||
  void operator() (LinearOperatorBase<Field> &Linop, const Field &src, Field &psi)
 | 
			
		||||
  {
 | 
			
		||||
    GridBase *grid = src._grid;
 | 
			
		||||
    GridBase *grid = src.Grid();
 | 
			
		||||
    int nshift = shifts.order;
 | 
			
		||||
    std::vector<Field> results(nshift,grid);
 | 
			
		||||
    (*this)(Linop,src,results,psi);
 | 
			
		||||
@@ -77,7 +77,7 @@ public:
 | 
			
		||||
  void operator() (LinearOperatorBase<Field> &Linop, const Field &src, std::vector<Field> &psi)
 | 
			
		||||
  {
 | 
			
		||||
  
 | 
			
		||||
    GridBase *grid = src._grid;
 | 
			
		||||
    GridBase *grid = src.Grid();
 | 
			
		||||
  
 | 
			
		||||
    ////////////////////////////////////////////////////////////////////////
 | 
			
		||||
    // Convenience references to the info stored in "MultiShiftFunction"
 | 
			
		||||
 
 | 
			
		||||
@@ -55,7 +55,7 @@ public:
 | 
			
		||||
    RealD rAr, rAAr, rArp;
 | 
			
		||||
    RealD pAp, pAAp;
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = src._grid;
 | 
			
		||||
    GridBase *grid = src.Grid();
 | 
			
		||||
    psi=zero;
 | 
			
		||||
    Field r(grid),  p(grid), Ap(grid), Ar(grid);
 | 
			
		||||
      
 | 
			
		||||
 
 | 
			
		||||
@@ -53,7 +53,7 @@ template<class Field>
 | 
			
		||||
void basisRotate(std::vector<Field> &basis,Eigen::MatrixXd& Qt,int j0, int j1, int k0,int k1,int Nm) 
 | 
			
		||||
{
 | 
			
		||||
  typedef typename Field::vector_object vobj;
 | 
			
		||||
  GridBase* grid = basis[0]._grid;
 | 
			
		||||
  GridBase* grid = basis[0].Grid();
 | 
			
		||||
      
 | 
			
		||||
  parallel_region
 | 
			
		||||
  {
 | 
			
		||||
@@ -79,7 +79,7 @@ template<class Field>
 | 
			
		||||
void basisRotateJ(Field &result,std::vector<Field> &basis,Eigen::MatrixXd& Qt,int j, int k0,int k1,int Nm) 
 | 
			
		||||
{
 | 
			
		||||
  typedef typename Field::vector_object vobj;
 | 
			
		||||
  GridBase* grid = basis[0]._grid;
 | 
			
		||||
  GridBase* grid = basis[0].Grid();
 | 
			
		||||
 | 
			
		||||
  result.Checkerboard() = basis[0].Checkerboard();
 | 
			
		||||
  parallel_for(int ss=0;ss < grid->oSites();ss++){
 | 
			
		||||
@@ -331,8 +331,8 @@ until convergence
 | 
			
		||||
*/
 | 
			
		||||
  void calc(std::vector<RealD>& eval, std::vector<Field>& evec,  const Field& src, int& Nconv, bool reverse=false)
 | 
			
		||||
  {
 | 
			
		||||
    GridBase *grid = src._grid;
 | 
			
		||||
    assert(grid == evec[0]._grid);
 | 
			
		||||
    GridBase *grid = src.Grid();
 | 
			
		||||
    assert(grid == evec[0].Grid());
 | 
			
		||||
    
 | 
			
		||||
    GridLogIRL.TimingMode(1);
 | 
			
		||||
    std::cout << GridLogIRL <<"**************************************************************************"<< std::endl;
 | 
			
		||||
 
 | 
			
		||||
@@ -48,7 +48,7 @@ public:
 | 
			
		||||
 | 
			
		||||
  void operator() (const Field &in, Field &out){
 | 
			
		||||
 
 | 
			
		||||
    Field src(in._grid);
 | 
			
		||||
    Field src(in.Grid());
 | 
			
		||||
 | 
			
		||||
    _Matrix.Mdag(in,src);
 | 
			
		||||
    _HermitianSolver(src,out);  // Mdag M out = Mdag in
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@ public:
 | 
			
		||||
    RealD rAr, rAAr, rArp;
 | 
			
		||||
    RealD pAp, pAAp;
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = src._grid;
 | 
			
		||||
    GridBase *grid = src.Grid();
 | 
			
		||||
    Field r(grid),  p(grid), Ap(grid), Ar(grid), z(grid);
 | 
			
		||||
      
 | 
			
		||||
    psi=zero;
 | 
			
		||||
 
 | 
			
		||||
@@ -70,7 +70,7 @@ public:
 | 
			
		||||
    ssq=norm2(src);
 | 
			
		||||
    rsq=Tolerance*Tolerance*ssq;
 | 
			
		||||
      
 | 
			
		||||
    Field r(src._grid);
 | 
			
		||||
    Field r(src.Grid());
 | 
			
		||||
 | 
			
		||||
    PrecTimer.Reset();
 | 
			
		||||
    MatTimer.Reset();
 | 
			
		||||
@@ -117,7 +117,7 @@ public:
 | 
			
		||||
    RealD zAz, zAAz;
 | 
			
		||||
    RealD rAq, rq;
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = src._grid;
 | 
			
		||||
    GridBase *grid = src.Grid();
 | 
			
		||||
 | 
			
		||||
    Field r(grid);
 | 
			
		||||
    Field z(grid);
 | 
			
		||||
 
 | 
			
		||||
@@ -36,17 +36,17 @@ NAMESPACE_BEGIN(Grid);
 | 
			
		||||
template<class vobj> void 
 | 
			
		||||
Gather_plane_simple (const Lattice<vobj> &rhs,commVector<vobj> &buffer,int dimension,int plane,int cbmask, int off=0)
 | 
			
		||||
{
 | 
			
		||||
  int rd = rhs._grid->_rdimensions[dimension];
 | 
			
		||||
  int rd = rhs.Grid()->_rdimensions[dimension];
 | 
			
		||||
 | 
			
		||||
  if ( !rhs._grid->CheckerBoarded(dimension) ) {
 | 
			
		||||
  if ( !rhs.Grid()->CheckerBoarded(dimension) ) {
 | 
			
		||||
    cbmask = 0x3;
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  int so=plane*rhs._grid->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
  int e1=rhs._grid->_slice_nblock[dimension];
 | 
			
		||||
  int e2=rhs._grid->_slice_block[dimension];
 | 
			
		||||
  int so=plane*rhs.Grid()->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
  int e1=rhs.Grid()->_slice_nblock[dimension];
 | 
			
		||||
  int e2=rhs.Grid()->_slice_block[dimension];
 | 
			
		||||
 | 
			
		||||
  int stride=rhs._grid->_slice_stride[dimension];
 | 
			
		||||
  int stride=rhs.Grid()->_slice_stride[dimension];
 | 
			
		||||
  if ( cbmask == 0x3 ) { 
 | 
			
		||||
    thread_loop_collapse( (int n=0;n<e1;n++) , 
 | 
			
		||||
      for(int b=0;b<e2;b++){
 | 
			
		||||
@@ -61,7 +61,7 @@ Gather_plane_simple (const Lattice<vobj> &rhs,commVector<vobj> &buffer,int dimen
 | 
			
		||||
    for(int n=0;n<e1;n++){
 | 
			
		||||
      for(int b=0;b<e2;b++){
 | 
			
		||||
	int o  = n*stride;
 | 
			
		||||
	int ocb=1<<rhs._grid->CheckerBoardFromOindex(o+b);
 | 
			
		||||
	int ocb=1<<rhs.Grid()->CheckerBoardFromOindex(o+b);
 | 
			
		||||
	if ( ocb &cbmask ) {
 | 
			
		||||
	  table.push_back(std::pair<int,int> (bo++,o+b));
 | 
			
		||||
	}
 | 
			
		||||
@@ -79,17 +79,17 @@ Gather_plane_simple (const Lattice<vobj> &rhs,commVector<vobj> &buffer,int dimen
 | 
			
		||||
template<class vobj> void 
 | 
			
		||||
Gather_plane_extract(const Lattice<vobj> &rhs,std::vector<typename vobj::scalar_object *> pointers,int dimension,int plane,int cbmask)
 | 
			
		||||
{
 | 
			
		||||
  int rd = rhs._grid->_rdimensions[dimension];
 | 
			
		||||
  int rd = rhs.Grid()->_rdimensions[dimension];
 | 
			
		||||
 | 
			
		||||
  if ( !rhs._grid->CheckerBoarded(dimension) ) {
 | 
			
		||||
  if ( !rhs.Grid()->CheckerBoarded(dimension) ) {
 | 
			
		||||
    cbmask = 0x3;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  int so  = plane*rhs._grid->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
  int so  = plane*rhs.Grid()->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
 | 
			
		||||
  int e1=rhs._grid->_slice_nblock[dimension];
 | 
			
		||||
  int e2=rhs._grid->_slice_block[dimension];
 | 
			
		||||
  int n1=rhs._grid->_slice_stride[dimension];
 | 
			
		||||
  int e1=rhs.Grid()->_slice_nblock[dimension];
 | 
			
		||||
  int e2=rhs.Grid()->_slice_block[dimension];
 | 
			
		||||
  int n1=rhs.Grid()->_slice_stride[dimension];
 | 
			
		||||
 | 
			
		||||
  if ( cbmask ==0x3){
 | 
			
		||||
    thread_loop_collapse( (int n=0;n<e1;n++), {
 | 
			
		||||
@@ -112,7 +112,7 @@ Gather_plane_extract(const Lattice<vobj> &rhs,std::vector<typename vobj::scalar_
 | 
			
		||||
      for(int b=0;b<e2;b++){
 | 
			
		||||
 | 
			
		||||
	int o=n*n1;
 | 
			
		||||
	int ocb=1<<rhs._grid->CheckerBoardFromOindex(o+b);
 | 
			
		||||
	int ocb=1<<rhs.Grid()->CheckerBoardFromOindex(o+b);
 | 
			
		||||
	int offset = b+n*e2;
 | 
			
		||||
 | 
			
		||||
	if ( ocb & cbmask ) {
 | 
			
		||||
@@ -129,23 +129,23 @@ Gather_plane_extract(const Lattice<vobj> &rhs,std::vector<typename vobj::scalar_
 | 
			
		||||
//////////////////////////////////////////////////////
 | 
			
		||||
template<class vobj> void Scatter_plane_simple (Lattice<vobj> &rhs,commVector<vobj> &buffer, int dimension,int plane,int cbmask)
 | 
			
		||||
{
 | 
			
		||||
  int rd = rhs._grid->_rdimensions[dimension];
 | 
			
		||||
  int rd = rhs.Grid()->_rdimensions[dimension];
 | 
			
		||||
 | 
			
		||||
  if ( !rhs._grid->CheckerBoarded(dimension) ) {
 | 
			
		||||
  if ( !rhs.Grid()->CheckerBoarded(dimension) ) {
 | 
			
		||||
    cbmask=0x3;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  int so  = plane*rhs._grid->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
  int so  = plane*rhs.Grid()->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
    
 | 
			
		||||
  int e1=rhs._grid->_slice_nblock[dimension];
 | 
			
		||||
  int e2=rhs._grid->_slice_block[dimension];
 | 
			
		||||
  int stride=rhs._grid->_slice_stride[dimension];
 | 
			
		||||
  int e1=rhs.Grid()->_slice_nblock[dimension];
 | 
			
		||||
  int e2=rhs.Grid()->_slice_block[dimension];
 | 
			
		||||
  int stride=rhs.Grid()->_slice_stride[dimension];
 | 
			
		||||
  
 | 
			
		||||
  if ( cbmask ==0x3 ) {
 | 
			
		||||
    thread_loop_collapse( (int n=0;n<e1;n++),{
 | 
			
		||||
      for(int b=0;b<e2;b++){
 | 
			
		||||
	int o   =n*rhs._grid->_slice_stride[dimension];
 | 
			
		||||
	int bo  =n*rhs._grid->_slice_block[dimension];
 | 
			
		||||
	int o   =n*rhs.Grid()->_slice_stride[dimension];
 | 
			
		||||
	int bo  =n*rhs.Grid()->_slice_block[dimension];
 | 
			
		||||
	rhs[so+o+b]=buffer[bo+b];
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
@@ -154,8 +154,8 @@ template<class vobj> void Scatter_plane_simple (Lattice<vobj> &rhs,commVector<vo
 | 
			
		||||
    int bo=0;
 | 
			
		||||
    for(int n=0;n<e1;n++){
 | 
			
		||||
      for(int b=0;b<e2;b++){
 | 
			
		||||
	int o   =n*rhs._grid->_slice_stride[dimension];
 | 
			
		||||
	int ocb=1<<rhs._grid->CheckerBoardFromOindex(o+b);// Could easily be a table lookup
 | 
			
		||||
	int o   =n*rhs.Grid()->_slice_stride[dimension];
 | 
			
		||||
	int ocb=1<<rhs.Grid()->CheckerBoardFromOindex(o+b);// Could easily be a table lookup
 | 
			
		||||
	if ( ocb & cbmask ) {
 | 
			
		||||
	  table.push_back(std::pair<int,int> (so+o+b,bo++));
 | 
			
		||||
	}
 | 
			
		||||
@@ -172,22 +172,22 @@ template<class vobj> void Scatter_plane_simple (Lattice<vobj> &rhs,commVector<vo
 | 
			
		||||
//////////////////////////////////////////////////////
 | 
			
		||||
template<class vobj> void Scatter_plane_merge(Lattice<vobj> &rhs,std::vector<typename vobj::scalar_object *> pointers,int dimension,int plane,int cbmask)
 | 
			
		||||
{
 | 
			
		||||
  int rd = rhs._grid->_rdimensions[dimension];
 | 
			
		||||
  int rd = rhs.Grid()->_rdimensions[dimension];
 | 
			
		||||
 | 
			
		||||
  if ( !rhs._grid->CheckerBoarded(dimension) ) {
 | 
			
		||||
  if ( !rhs.Grid()->CheckerBoarded(dimension) ) {
 | 
			
		||||
    cbmask=0x3;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  int so  = plane*rhs._grid->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
  int so  = plane*rhs.Grid()->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
    
 | 
			
		||||
  int e1=rhs._grid->_slice_nblock[dimension];
 | 
			
		||||
  int e2=rhs._grid->_slice_block[dimension];
 | 
			
		||||
  int e1=rhs.Grid()->_slice_nblock[dimension];
 | 
			
		||||
  int e2=rhs.Grid()->_slice_block[dimension];
 | 
			
		||||
 | 
			
		||||
  if(cbmask ==0x3 ) {
 | 
			
		||||
    thread_loop_collapse( (int n=0;n<e1;n++),{
 | 
			
		||||
      for(int b=0;b<e2;b++){
 | 
			
		||||
	int o      = n*rhs._grid->_slice_stride[dimension];
 | 
			
		||||
	int offset = b+n*rhs._grid->_slice_block[dimension];
 | 
			
		||||
	int o      = n*rhs.Grid()->_slice_stride[dimension];
 | 
			
		||||
	int offset = b+n*rhs.Grid()->_slice_block[dimension];
 | 
			
		||||
	merge(rhs[so+o+b],pointers,offset);
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
@@ -199,9 +199,9 @@ template<class vobj> void Scatter_plane_merge(Lattice<vobj> &rhs,std::vector<typ
 | 
			
		||||
    std::cout<<" Unthreaded warning -- buffer is not densely packed ??"<<std::endl;
 | 
			
		||||
    for(int n=0;n<e1;n++){
 | 
			
		||||
      for(int b=0;b<e2;b++){
 | 
			
		||||
	int o      = n*rhs._grid->_slice_stride[dimension];
 | 
			
		||||
	int offset = b+n*rhs._grid->_slice_block[dimension];
 | 
			
		||||
	int ocb=1<<rhs._grid->CheckerBoardFromOindex(o+b);
 | 
			
		||||
	int o      = n*rhs.Grid()->_slice_stride[dimension];
 | 
			
		||||
	int offset = b+n*rhs.Grid()->_slice_block[dimension];
 | 
			
		||||
	int ocb=1<<rhs.Grid()->CheckerBoardFromOindex(o+b);
 | 
			
		||||
	if ( ocb&cbmask ) {
 | 
			
		||||
	  merge(rhs[so+o+b],pointers,offset);
 | 
			
		||||
	}
 | 
			
		||||
@@ -215,18 +215,18 @@ template<class vobj> void Scatter_plane_merge(Lattice<vobj> &rhs,std::vector<typ
 | 
			
		||||
//////////////////////////////////////////////////////
 | 
			
		||||
template<class vobj> void Copy_plane(Lattice<vobj>& lhs,const Lattice<vobj> &rhs, int dimension,int lplane,int rplane,int cbmask)
 | 
			
		||||
{
 | 
			
		||||
  int rd = rhs._grid->_rdimensions[dimension];
 | 
			
		||||
  int rd = rhs.Grid()->_rdimensions[dimension];
 | 
			
		||||
 | 
			
		||||
  if ( !rhs._grid->CheckerBoarded(dimension) ) {
 | 
			
		||||
  if ( !rhs.Grid()->CheckerBoarded(dimension) ) {
 | 
			
		||||
    cbmask=0x3;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  int ro  = rplane*rhs._grid->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
  int lo  = lplane*lhs._grid->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
  int ro  = rplane*rhs.Grid()->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
  int lo  = lplane*lhs.Grid()->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
 | 
			
		||||
  int e1=rhs._grid->_slice_nblock[dimension]; // clearly loop invariant for icpc
 | 
			
		||||
  int e2=rhs._grid->_slice_block[dimension];
 | 
			
		||||
  int stride = rhs._grid->_slice_stride[dimension];
 | 
			
		||||
  int e1=rhs.Grid()->_slice_nblock[dimension]; // clearly loop invariant for icpc
 | 
			
		||||
  int e2=rhs.Grid()->_slice_block[dimension];
 | 
			
		||||
  int stride = rhs.Grid()->_slice_stride[dimension];
 | 
			
		||||
  if(cbmask == 0x3 ){
 | 
			
		||||
    thread_loop_collapse( (int n=0;n<e1;n++),{
 | 
			
		||||
      for(int b=0;b<e2;b++){
 | 
			
		||||
@@ -239,7 +239,7 @@ template<class vobj> void Copy_plane(Lattice<vobj>& lhs,const Lattice<vobj> &rhs
 | 
			
		||||
    thread_loop_collapse( (int n=0;n<e1;n++),{
 | 
			
		||||
      for(int b=0;b<e2;b++){
 | 
			
		||||
        int o =n*stride+b;
 | 
			
		||||
        int ocb=1<<lhs._grid->CheckerBoardFromOindex(o);
 | 
			
		||||
        int ocb=1<<lhs.Grid()->CheckerBoardFromOindex(o);
 | 
			
		||||
        if ( ocb&cbmask ) {
 | 
			
		||||
	  //lhs[lo+o]=rhs[ro+o];
 | 
			
		||||
	  vstream(lhs[lo+o],rhs[ro+o]);
 | 
			
		||||
@@ -253,24 +253,24 @@ template<class vobj> void Copy_plane(Lattice<vobj>& lhs,const Lattice<vobj> &rhs
 | 
			
		||||
template<class vobj> void Copy_plane_permute(Lattice<vobj>& lhs,const Lattice<vobj> &rhs, int dimension,int lplane,int rplane,int cbmask,int permute_type)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
  int rd = rhs._grid->_rdimensions[dimension];
 | 
			
		||||
  int rd = rhs.Grid()->_rdimensions[dimension];
 | 
			
		||||
 | 
			
		||||
  if ( !rhs._grid->CheckerBoarded(dimension) ) {
 | 
			
		||||
  if ( !rhs.Grid()->CheckerBoarded(dimension) ) {
 | 
			
		||||
    cbmask=0x3;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  int ro  = rplane*rhs._grid->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
  int lo  = lplane*lhs._grid->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
  int ro  = rplane*rhs.Grid()->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
  int lo  = lplane*lhs.Grid()->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
 | 
			
		||||
  int e1=rhs._grid->_slice_nblock[dimension];
 | 
			
		||||
  int e2=rhs._grid->_slice_block [dimension];
 | 
			
		||||
  int stride = rhs._grid->_slice_stride[dimension];
 | 
			
		||||
  int e1=rhs.Grid()->_slice_nblock[dimension];
 | 
			
		||||
  int e2=rhs.Grid()->_slice_block [dimension];
 | 
			
		||||
  int stride = rhs.Grid()->_slice_stride[dimension];
 | 
			
		||||
 | 
			
		||||
  thread_loop_collapse( (int n=0;n<e1;n++),{
 | 
			
		||||
    for(int b=0;b<e2;b++){
 | 
			
		||||
 | 
			
		||||
      int o  =n*stride;
 | 
			
		||||
      int ocb=1<<lhs._grid->CheckerBoardFromOindex(o+b);
 | 
			
		||||
      int ocb=1<<lhs.Grid()->CheckerBoardFromOindex(o+b);
 | 
			
		||||
      if ( ocb&cbmask ) {
 | 
			
		||||
	permute(lhs[lo+o+b],rhs[ro+o+b],permute_type);
 | 
			
		||||
      }
 | 
			
		||||
@@ -285,8 +285,8 @@ template<class vobj> void Cshift_local(Lattice<vobj>& ret,const Lattice<vobj> &r
 | 
			
		||||
{
 | 
			
		||||
  int sshift[2];
 | 
			
		||||
 | 
			
		||||
  sshift[0] = rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Even);
 | 
			
		||||
  sshift[1] = rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Odd);
 | 
			
		||||
  sshift[0] = rhs.Grid()->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Even);
 | 
			
		||||
  sshift[1] = rhs.Grid()->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Odd);
 | 
			
		||||
 | 
			
		||||
  if ( sshift[0] == sshift[1] ) {
 | 
			
		||||
    Cshift_local(ret,rhs,dimension,shift,0x3);
 | 
			
		||||
@@ -298,7 +298,7 @@ template<class vobj> void Cshift_local(Lattice<vobj>& ret,const Lattice<vobj> &r
 | 
			
		||||
 | 
			
		||||
template<class vobj> Lattice<vobj> Cshift_local(Lattice<vobj> &ret,const Lattice<vobj> &rhs,int dimension,int shift,int cbmask)
 | 
			
		||||
{
 | 
			
		||||
  GridBase *grid = rhs._grid;
 | 
			
		||||
  GridBase *grid = rhs.Grid();
 | 
			
		||||
  int fd = grid->_fdimensions[dimension];
 | 
			
		||||
  int rd = grid->_rdimensions[dimension];
 | 
			
		||||
  int ld = grid->_ldimensions[dimension];
 | 
			
		||||
 
 | 
			
		||||
@@ -37,20 +37,20 @@ template<class vobj> Lattice<vobj> Cshift(const Lattice<vobj> &rhs,int dimension
 | 
			
		||||
  typedef typename vobj::vector_type vector_type;
 | 
			
		||||
  typedef typename vobj::scalar_type scalar_type;
 | 
			
		||||
 | 
			
		||||
  Lattice<vobj> ret(rhs._grid); 
 | 
			
		||||
  Lattice<vobj> ret(rhs.Grid()); 
 | 
			
		||||
  
 | 
			
		||||
  int fd = rhs._grid->_fdimensions[dimension];
 | 
			
		||||
  int rd = rhs._grid->_rdimensions[dimension];
 | 
			
		||||
  int fd = rhs.Grid()->_fdimensions[dimension];
 | 
			
		||||
  int rd = rhs.Grid()->_rdimensions[dimension];
 | 
			
		||||
 | 
			
		||||
  // Map to always positive shift modulo global full dimension.
 | 
			
		||||
  shift = (shift+fd)%fd;
 | 
			
		||||
 | 
			
		||||
  ret.Checkerboard() = rhs._grid->CheckerBoardDestination(rhs.Checkerboard(),shift,dimension);
 | 
			
		||||
  ret.Checkerboard() = rhs.Grid()->CheckerBoardDestination(rhs.Checkerboard(),shift,dimension);
 | 
			
		||||
        
 | 
			
		||||
  // the permute type
 | 
			
		||||
  int simd_layout     = rhs._grid->_simd_layout[dimension];
 | 
			
		||||
  int comm_dim        = rhs._grid->_processors[dimension] >1 ;
 | 
			
		||||
  int splice_dim      = rhs._grid->_simd_layout[dimension]>1 && (comm_dim);
 | 
			
		||||
  int simd_layout     = rhs.Grid()->_simd_layout[dimension];
 | 
			
		||||
  int comm_dim        = rhs.Grid()->_processors[dimension] >1 ;
 | 
			
		||||
  int splice_dim      = rhs.Grid()->_simd_layout[dimension]>1 && (comm_dim);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  if ( !comm_dim ) {
 | 
			
		||||
@@ -70,8 +70,8 @@ template<class vobj> void Cshift_comms(Lattice<vobj>& ret,const Lattice<vobj> &r
 | 
			
		||||
{
 | 
			
		||||
  int sshift[2];
 | 
			
		||||
 | 
			
		||||
  sshift[0] = rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Even);
 | 
			
		||||
  sshift[1] = rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Odd);
 | 
			
		||||
  sshift[0] = rhs.Grid()->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Even);
 | 
			
		||||
  sshift[1] = rhs.Grid()->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Odd);
 | 
			
		||||
 | 
			
		||||
  //  std::cout << "Cshift_comms dim "<<dimension<<"cb "<<rhs.Checkerboard()<<"shift "<<shift<<" sshift " << sshift[0]<<" "<<sshift[1]<<std::endl;
 | 
			
		||||
  if ( sshift[0] == sshift[1] ) {
 | 
			
		||||
@@ -88,8 +88,8 @@ template<class vobj> void Cshift_comms_simd(Lattice<vobj>& ret,const Lattice<vob
 | 
			
		||||
{
 | 
			
		||||
  int sshift[2];
 | 
			
		||||
 | 
			
		||||
  sshift[0] = rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Even);
 | 
			
		||||
  sshift[1] = rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Odd);
 | 
			
		||||
  sshift[0] = rhs.Grid()->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Even);
 | 
			
		||||
  sshift[1] = rhs.Grid()->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Odd);
 | 
			
		||||
 | 
			
		||||
  if ( sshift[0] == sshift[1] ) {
 | 
			
		||||
    Cshift_comms_simd(ret,rhs,dimension,shift,0x3);
 | 
			
		||||
@@ -104,25 +104,25 @@ template<class vobj> void Cshift_comms(Lattice<vobj> &ret,const Lattice<vobj> &r
 | 
			
		||||
  typedef typename vobj::vector_type vector_type;
 | 
			
		||||
  typedef typename vobj::scalar_type scalar_type;
 | 
			
		||||
 | 
			
		||||
  GridBase *grid=rhs._grid;
 | 
			
		||||
  Lattice<vobj> temp(rhs._grid);
 | 
			
		||||
  GridBase *grid=rhs.Grid();
 | 
			
		||||
  Lattice<vobj> temp(rhs.Grid());
 | 
			
		||||
 | 
			
		||||
  int fd              = rhs._grid->_fdimensions[dimension];
 | 
			
		||||
  int rd              = rhs._grid->_rdimensions[dimension];
 | 
			
		||||
  int pd              = rhs._grid->_processors[dimension];
 | 
			
		||||
  int simd_layout     = rhs._grid->_simd_layout[dimension];
 | 
			
		||||
  int comm_dim        = rhs._grid->_processors[dimension] >1 ;
 | 
			
		||||
  int fd              = rhs.Grid()->_fdimensions[dimension];
 | 
			
		||||
  int rd              = rhs.Grid()->_rdimensions[dimension];
 | 
			
		||||
  int pd              = rhs.Grid()->_processors[dimension];
 | 
			
		||||
  int simd_layout     = rhs.Grid()->_simd_layout[dimension];
 | 
			
		||||
  int comm_dim        = rhs.Grid()->_processors[dimension] >1 ;
 | 
			
		||||
  assert(simd_layout==1);
 | 
			
		||||
  assert(comm_dim==1);
 | 
			
		||||
  assert(shift>=0);
 | 
			
		||||
  assert(shift<fd);
 | 
			
		||||
  
 | 
			
		||||
  int buffer_size = rhs._grid->_slice_nblock[dimension]*rhs._grid->_slice_block[dimension];
 | 
			
		||||
  int buffer_size = rhs.Grid()->_slice_nblock[dimension]*rhs.Grid()->_slice_block[dimension];
 | 
			
		||||
  commVector<vobj> send_buf(buffer_size);
 | 
			
		||||
  commVector<vobj> recv_buf(buffer_size);
 | 
			
		||||
 | 
			
		||||
  int cb= (cbmask==0x2)? Odd : Even;
 | 
			
		||||
  int sshift= rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,cb);
 | 
			
		||||
  int sshift= rhs.Grid()->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,cb);
 | 
			
		||||
 | 
			
		||||
  for(int x=0;x<rd;x++){       
 | 
			
		||||
 | 
			
		||||
@@ -162,7 +162,7 @@ template<class vobj> void Cshift_comms(Lattice<vobj> &ret,const Lattice<vobj> &r
 | 
			
		||||
 | 
			
		||||
template<class vobj> void  Cshift_comms_simd(Lattice<vobj> &ret,const Lattice<vobj> &rhs,int dimension,int shift,int cbmask)
 | 
			
		||||
{
 | 
			
		||||
  GridBase *grid=rhs._grid;
 | 
			
		||||
  GridBase *grid=rhs.Grid();
 | 
			
		||||
  const int Nsimd = grid->Nsimd();
 | 
			
		||||
  typedef typename vobj::vector_type vector_type;
 | 
			
		||||
  typedef typename vobj::scalar_object scalar_object;
 | 
			
		||||
 
 | 
			
		||||
@@ -30,8 +30,8 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
 | 
			
		||||
NAMESPACE_BEGIN(Grid);
 | 
			
		||||
template<class vobj> Lattice<vobj> Cshift(const Lattice<vobj> &rhs,int dimension,int shift)
 | 
			
		||||
{
 | 
			
		||||
  Lattice<vobj> ret(rhs._grid);
 | 
			
		||||
  ret.Checkerboard() = rhs._grid->CheckerBoardDestination(rhs.Checkerboard(),shift,dimension);
 | 
			
		||||
  Lattice<vobj> ret(rhs.Grid());
 | 
			
		||||
  ret.Checkerboard() = rhs.Grid()->CheckerBoardDestination(rhs.Checkerboard(),shift,dimension);
 | 
			
		||||
  Cshift_local(ret,rhs,dimension,shift);
 | 
			
		||||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -141,9 +141,9 @@ template <class T1,
 | 
			
		||||
inline void GridFromExpression(GridBase *&grid, const T1 &lat)  // Lattice leaf
 | 
			
		||||
{
 | 
			
		||||
  if (grid) {
 | 
			
		||||
    conformable(grid, lat._grid);
 | 
			
		||||
    conformable(grid, lat.Grid());
 | 
			
		||||
  }
 | 
			
		||||
  grid = lat._grid;
 | 
			
		||||
  grid = lat.Grid();
 | 
			
		||||
}
 | 
			
		||||
template <class T1,
 | 
			
		||||
          typename std::enable_if<!is_lattice<T1>::value, T1>::type * = nullptr>
 | 
			
		||||
 
 | 
			
		||||
@@ -106,9 +106,10 @@ void inline conformable(GridBase *lhs,GridBase *rhs)
 | 
			
		||||
template<class vobj>
 | 
			
		||||
class Lattice : public LatticeAccelerator<vobj>
 | 
			
		||||
{
 | 
			
		||||
public: // Move to private and fix
 | 
			
		||||
protected: // Move to private and fix
 | 
			
		||||
  GridBase *_grid;
 | 
			
		||||
public:
 | 
			
		||||
  GridBase *Grid(void) const { return _grid; }
 | 
			
		||||
  ///////////////////////////////////////////////////
 | 
			
		||||
  // Member types
 | 
			
		||||
  ///////////////////////////////////////////////////
 | 
			
		||||
@@ -328,7 +329,7 @@ public:
 | 
			
		||||
  }
 | 
			
		||||
  Lattice(const Lattice& r){ // copy constructor
 | 
			
		||||
    //    std::cout << "Lattice constructor(const Lattice &) "<<this<<std::endl; 
 | 
			
		||||
    _grid = r._grid;
 | 
			
		||||
    _grid = r.Grid();
 | 
			
		||||
    resize(r._odata_size);
 | 
			
		||||
    this->checkerboard = r.Checkerboard();
 | 
			
		||||
    accelerator_loop(ss,(*this),{
 | 
			
		||||
@@ -337,7 +338,7 @@ public:
 | 
			
		||||
  }
 | 
			
		||||
  Lattice(Lattice && r){ // move constructor
 | 
			
		||||
    //    std::cout << "Lattice move constructor(Lattice &) "<<this<<std::endl; 
 | 
			
		||||
    _grid = r._grid;
 | 
			
		||||
    _grid = r.Grid();
 | 
			
		||||
    this->_odata      = r._odata;
 | 
			
		||||
    this->_odata_size = r._odata_size;
 | 
			
		||||
    this->checkerboard= r.Checkerboard();
 | 
			
		||||
@@ -370,7 +371,7 @@ public:
 | 
			
		||||
    //    std::cout << "Lattice = (Lattice &&)"<<std::endl; 
 | 
			
		||||
    resize(0); // delete if appropriate
 | 
			
		||||
 | 
			
		||||
    this->_grid        = r._grid;
 | 
			
		||||
    this->_grid        = r.Grid();
 | 
			
		||||
    this->checkerboard = r.Checkerboard();
 | 
			
		||||
 | 
			
		||||
    this->_odata      = r._odata;
 | 
			
		||||
@@ -403,8 +404,8 @@ template<class vobj> std::ostream& operator<< (std::ostream& stream, const Latti
 | 
			
		||||
  std::vector<int> gcoor;
 | 
			
		||||
  typedef typename vobj::scalar_object sobj;
 | 
			
		||||
  sobj ss;
 | 
			
		||||
  for(int g=0;g<o._grid->_gsites;g++){
 | 
			
		||||
    o._grid->GlobalIndexToGlobalCoor(g,gcoor);
 | 
			
		||||
  for(int g=0;g<o.Grid()->_gsites;g++){
 | 
			
		||||
    o.Grid()->GlobalIndexToGlobalCoor(g,gcoor);
 | 
			
		||||
    peekSite(ss,o,gcoor);
 | 
			
		||||
    stream<<"[";
 | 
			
		||||
    for(int d=0;d<gcoor.size();d++){
 | 
			
		||||
 
 | 
			
		||||
@@ -46,7 +46,7 @@ NAMESPACE_BEGIN(Grid);
 | 
			
		||||
template<class vfunctor,class lobj,class robj>  
 | 
			
		||||
inline Lattice<vInteger> LLComparison(vfunctor op,const Lattice<lobj> &lhs,const Lattice<robj> &rhs)
 | 
			
		||||
{
 | 
			
		||||
  Lattice<vInteger> ret(rhs._grid);
 | 
			
		||||
  Lattice<vInteger> ret(rhs.Grid());
 | 
			
		||||
  accelerator_loop( ss, rhs, {
 | 
			
		||||
    ret[ss]=op(lhs[ss],rhs[ss]);
 | 
			
		||||
  });
 | 
			
		||||
@@ -58,7 +58,7 @@ inline Lattice<vInteger> LLComparison(vfunctor op,const Lattice<lobj> &lhs,const
 | 
			
		||||
template<class vfunctor,class lobj,class robj> 
 | 
			
		||||
inline Lattice<vInteger> LSComparison(vfunctor op,const Lattice<lobj> &lhs,const robj &rhs)
 | 
			
		||||
{
 | 
			
		||||
  Lattice<vInteger> ret(lhs._grid);
 | 
			
		||||
  Lattice<vInteger> ret(lhs.Grid());
 | 
			
		||||
  accelerator_loop( ss, lhs, {
 | 
			
		||||
    ret[ss]=op(lhs[ss],rhs);
 | 
			
		||||
  });
 | 
			
		||||
@@ -70,7 +70,7 @@ inline Lattice<vInteger> LSComparison(vfunctor op,const Lattice<lobj> &lhs,const
 | 
			
		||||
template<class vfunctor,class lobj,class robj> 
 | 
			
		||||
inline Lattice<vInteger> SLComparison(vfunctor op,const lobj &lhs,const Lattice<robj> &rhs)
 | 
			
		||||
{
 | 
			
		||||
  Lattice<vInteger> ret(rhs._grid);
 | 
			
		||||
  Lattice<vInteger> ret(rhs.Grid());
 | 
			
		||||
  accelerator_loop( ss, rhs, {
 | 
			
		||||
    ret[ss]=op(lhs[ss],rhs);
 | 
			
		||||
  });
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@ NAMESPACE_BEGIN(Grid);
 | 
			
		||||
 | 
			
		||||
template<class obj1,class obj2> void conformable(const Lattice<obj1> &lhs,const Lattice<obj2> &rhs)
 | 
			
		||||
{
 | 
			
		||||
  assert(lhs._grid == rhs._grid);
 | 
			
		||||
  assert(lhs.Grid() == rhs.Grid());
 | 
			
		||||
  assert(lhs.Checkerboard() == rhs.Checkerboard());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -35,7 +35,7 @@ template<class iobj> inline void LatticeCoordinate(Lattice<iobj> &l,int mu)
 | 
			
		||||
  typedef typename iobj::scalar_type scalar_type;
 | 
			
		||||
  typedef typename iobj::vector_type vector_type;
 | 
			
		||||
 | 
			
		||||
  GridBase *grid = l._grid;
 | 
			
		||||
  GridBase *grid = l.Grid();
 | 
			
		||||
  int Nsimd = grid->iSites();
 | 
			
		||||
 | 
			
		||||
  std::vector<int> gcoor;
 | 
			
		||||
@@ -56,7 +56,7 @@ template<class iobj> inline void LatticeCoordinate(Lattice<iobj> &l,int mu)
 | 
			
		||||
// FIXME for debug; deprecate this; made obscelete by 
 | 
			
		||||
template<class vobj> void lex_sites(Lattice<vobj> &l){
 | 
			
		||||
  Real *v_ptr = (Real *)&l[0];
 | 
			
		||||
  size_t o_len = l._grid->oSites();
 | 
			
		||||
  size_t o_len = l.Grid()->oSites();
 | 
			
		||||
  size_t v_len = sizeof(vobj)/sizeof(vRealF);
 | 
			
		||||
  size_t vec_len = vRealF::Nsimd();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,7 @@ NAMESPACE_BEGIN(Grid);
 | 
			
		||||
template<class vobj>
 | 
			
		||||
inline auto localNorm2 (const Lattice<vobj> &rhs)-> Lattice<typename vobj::tensor_reduced>
 | 
			
		||||
{
 | 
			
		||||
  Lattice<typename vobj::tensor_reduced> ret(rhs._grid);
 | 
			
		||||
  Lattice<typename vobj::tensor_reduced> ret(rhs.Grid());
 | 
			
		||||
  accelerator_loop(ss,rhs,{
 | 
			
		||||
    ret[ss]=innerProduct(rhs[ss],rhs[ss]);
 | 
			
		||||
  });
 | 
			
		||||
@@ -53,7 +53,7 @@ inline auto localNorm2 (const Lattice<vobj> &rhs)-> Lattice<typename vobj::tenso
 | 
			
		||||
template<class vobj>
 | 
			
		||||
inline auto localInnerProduct (const Lattice<vobj> &lhs,const Lattice<vobj> &rhs) -> Lattice<typename vobj::tensor_reduced>
 | 
			
		||||
{
 | 
			
		||||
  Lattice<typename vobj::tensor_reduced> ret(rhs._grid);
 | 
			
		||||
  Lattice<typename vobj::tensor_reduced> ret(rhs.Grid());
 | 
			
		||||
  accelerator_loop(ss,rhs,{
 | 
			
		||||
    ret[ss]=innerProduct(lhs[ss],rhs[ss]);
 | 
			
		||||
  });
 | 
			
		||||
@@ -65,7 +65,7 @@ inline auto localInnerProduct (const Lattice<vobj> &lhs,const Lattice<vobj> &rhs
 | 
			
		||||
template<class ll,class rr>
 | 
			
		||||
inline auto outerProduct (const Lattice<ll> &lhs,const Lattice<rr> &rhs) -> Lattice<decltype(outerProduct(lhs[0],rhs[0]))>
 | 
			
		||||
{
 | 
			
		||||
  Lattice<decltype(outerProduct(lhs[0],rhs[0]))> ret(rhs._grid);
 | 
			
		||||
  Lattice<decltype(outerProduct(lhs[0],rhs[0]))> ret(rhs.Grid());
 | 
			
		||||
  accelerator_loop(ss,rhs,{
 | 
			
		||||
    ret[ss]=outerProduct(lhs[ss],rhs[ss]);
 | 
			
		||||
  });
 | 
			
		||||
 
 | 
			
		||||
@@ -35,9 +35,9 @@ static void sliceMaddMatrix (Lattice<vobj> &R,Eigen::MatrixXcd &aa,const Lattice
 | 
			
		||||
  typedef typename vobj::scalar_type scalar_type;
 | 
			
		||||
  typedef typename vobj::vector_type vector_type;
 | 
			
		||||
 | 
			
		||||
  int Nblock = X._grid->GlobalDimensions()[Orthog];
 | 
			
		||||
  int Nblock = X.Grid()->GlobalDimensions()[Orthog];
 | 
			
		||||
 | 
			
		||||
  GridBase *FullGrid  = X._grid;
 | 
			
		||||
  GridBase *FullGrid  = X.Grid();
 | 
			
		||||
  //  GridBase *SliceGrid = makeSubSliceGrid(FullGrid,Orthog);
 | 
			
		||||
 | 
			
		||||
  //  Lattice<vobj> Xslice(SliceGrid);
 | 
			
		||||
@@ -83,9 +83,9 @@ static void sliceMulMatrix (Lattice<vobj> &R,Eigen::MatrixXcd &aa,const Lattice<
 | 
			
		||||
  typedef typename vobj::scalar_type scalar_type;
 | 
			
		||||
  typedef typename vobj::vector_type vector_type;
 | 
			
		||||
 | 
			
		||||
  int Nblock = X._grid->GlobalDimensions()[Orthog];
 | 
			
		||||
  int Nblock = X.Grid()->GlobalDimensions()[Orthog];
 | 
			
		||||
 | 
			
		||||
  GridBase *FullGrid  = X._grid;
 | 
			
		||||
  GridBase *FullGrid  = X.Grid();
 | 
			
		||||
  //  GridBase *SliceGrid = makeSubSliceGrid(FullGrid,Orthog);
 | 
			
		||||
  //  Lattice<vobj> Xslice(SliceGrid);
 | 
			
		||||
  //  Lattice<vobj> Rslice(SliceGrid);
 | 
			
		||||
@@ -135,7 +135,7 @@ static void sliceInnerProductMatrix(  Eigen::MatrixXcd &mat, const Lattice<vobj>
 | 
			
		||||
  typedef typename vobj::scalar_type scalar_type;
 | 
			
		||||
  typedef typename vobj::vector_type vector_type;
 | 
			
		||||
  
 | 
			
		||||
  GridBase *FullGrid  = lhs._grid;
 | 
			
		||||
  GridBase *FullGrid  = lhs.Grid();
 | 
			
		||||
  //  GridBase *SliceGrid = makeSubSliceGrid(FullGrid,Orthog);
 | 
			
		||||
  
 | 
			
		||||
  int Nblock = FullGrid->GlobalDimensions()[Orthog];
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ NAMESPACE_BEGIN(Grid);
 | 
			
		||||
template<int Index,class vobj> 
 | 
			
		||||
auto PeekIndex(const Lattice<vobj> &lhs,int i) -> Lattice<decltype(peekIndex<Index>(lhs[0],i))>
 | 
			
		||||
{
 | 
			
		||||
  Lattice<decltype(peekIndex<Index>(lhs[0],i))> ret(lhs._grid);
 | 
			
		||||
  Lattice<decltype(peekIndex<Index>(lhs[0],i))> ret(lhs.Grid());
 | 
			
		||||
  ret.Checkerboard()=lhs.Checkerboard();
 | 
			
		||||
  cpu_loop( ss, lhs, {
 | 
			
		||||
    ret[ss] = peekIndex<Index>(lhs[ss],i);
 | 
			
		||||
@@ -54,7 +54,7 @@ auto PeekIndex(const Lattice<vobj> &lhs,int i) -> Lattice<decltype(peekIndex<Ind
 | 
			
		||||
template<int Index,class vobj> 
 | 
			
		||||
auto PeekIndex(const Lattice<vobj> &lhs,int i,int j) -> Lattice<decltype(peekIndex<Index>(lhs[0],i,j))>
 | 
			
		||||
{
 | 
			
		||||
  Lattice<decltype(peekIndex<Index>(lhs[0],i,j))> ret(lhs._grid);
 | 
			
		||||
  Lattice<decltype(peekIndex<Index>(lhs[0],i,j))> ret(lhs.Grid());
 | 
			
		||||
  ret.Checkerboard()=lhs.Checkerboard();
 | 
			
		||||
  cpu_loop( ss, lhs, {
 | 
			
		||||
    ret[ss] = peekIndex<Index>(lhs[ss],i,j);
 | 
			
		||||
@@ -86,14 +86,14 @@ void PokeIndex(Lattice<vobj> &lhs,const Lattice<decltype(peekIndex<Index>(lhs[0]
 | 
			
		||||
template<class vobj,class sobj> 
 | 
			
		||||
void pokeSite(const sobj &s,Lattice<vobj> &l,const std::vector<int> &site){
 | 
			
		||||
 | 
			
		||||
  GridBase *grid=l._grid;
 | 
			
		||||
  GridBase *grid=l.Grid();
 | 
			
		||||
 | 
			
		||||
  typedef typename vobj::scalar_type scalar_type;
 | 
			
		||||
  typedef typename vobj::vector_type vector_type;
 | 
			
		||||
 | 
			
		||||
  int Nsimd = grid->Nsimd();
 | 
			
		||||
 | 
			
		||||
  assert( l.Checkerboard()== l._grid->CheckerBoard(site));
 | 
			
		||||
  assert( l.Checkerboard()== l.Grid()->CheckerBoard(site));
 | 
			
		||||
  assert( sizeof(sobj)*Nsimd == sizeof(vobj));
 | 
			
		||||
 | 
			
		||||
  int rank,odx,idx;
 | 
			
		||||
@@ -120,14 +120,14 @@ void pokeSite(const sobj &s,Lattice<vobj> &l,const std::vector<int> &site){
 | 
			
		||||
template<class vobj,class sobj>
 | 
			
		||||
void peekSite(sobj &s,const Lattice<vobj> &l,const std::vector<int> &site){
 | 
			
		||||
        
 | 
			
		||||
  GridBase *grid=l._grid;
 | 
			
		||||
  GridBase *grid=l.Grid();
 | 
			
		||||
 | 
			
		||||
  typedef typename vobj::scalar_type scalar_type;
 | 
			
		||||
  typedef typename vobj::vector_type vector_type;
 | 
			
		||||
 | 
			
		||||
  int Nsimd = grid->Nsimd();
 | 
			
		||||
 | 
			
		||||
  assert( l.Checkerboard() == l._grid->CheckerBoard(site));
 | 
			
		||||
  assert( l.Checkerboard() == l.Grid()->CheckerBoard(site));
 | 
			
		||||
 | 
			
		||||
  int rank,odx,idx;
 | 
			
		||||
  grid->GlobalCoorToRankIndex(rank,odx,idx,site);
 | 
			
		||||
@@ -149,14 +149,14 @@ void peekSite(sobj &s,const Lattice<vobj> &l,const std::vector<int> &site){
 | 
			
		||||
template<class vobj,class sobj>
 | 
			
		||||
void peekLocalSite(sobj &s,const Lattice<vobj> &l,std::vector<int> &site){
 | 
			
		||||
        
 | 
			
		||||
  GridBase *grid = l._grid;
 | 
			
		||||
  GridBase *grid = l.Grid();
 | 
			
		||||
 | 
			
		||||
  typedef typename vobj::scalar_type scalar_type;
 | 
			
		||||
  typedef typename vobj::vector_type vector_type;
 | 
			
		||||
 | 
			
		||||
  int Nsimd = grid->Nsimd();
 | 
			
		||||
 | 
			
		||||
  assert( l.Checkerboard()== l._grid->CheckerBoard(site));
 | 
			
		||||
  assert( l.Checkerboard()== l.Grid()->CheckerBoard(site));
 | 
			
		||||
  assert( sizeof(sobj)*Nsimd == sizeof(vobj));
 | 
			
		||||
 | 
			
		||||
  static const int words=sizeof(vobj)/sizeof(vector_type);
 | 
			
		||||
@@ -177,14 +177,14 @@ void peekLocalSite(sobj &s,const Lattice<vobj> &l,std::vector<int> &site){
 | 
			
		||||
template<class vobj,class sobj>
 | 
			
		||||
void pokeLocalSite(const sobj &s,Lattice<vobj> &l,std::vector<int> &site){
 | 
			
		||||
 | 
			
		||||
  GridBase *grid=l._grid;
 | 
			
		||||
  GridBase *grid=l.Grid();
 | 
			
		||||
 | 
			
		||||
  typedef typename vobj::scalar_type scalar_type;
 | 
			
		||||
  typedef typename vobj::vector_type vector_type;
 | 
			
		||||
 | 
			
		||||
  int Nsimd = grid->Nsimd();
 | 
			
		||||
 | 
			
		||||
  assert( l.Checkerboard()== l._grid->CheckerBoard(site));
 | 
			
		||||
  assert( l.Checkerboard()== l.Grid()->CheckerBoard(site));
 | 
			
		||||
  assert( sizeof(sobj)*Nsimd == sizeof(vobj));
 | 
			
		||||
 | 
			
		||||
  static const int words=sizeof(vobj)/sizeof(vector_type);
 | 
			
		||||
 
 | 
			
		||||
@@ -39,7 +39,7 @@ Author: neo <cossu@post.kek.jp>
 | 
			
		||||
NAMESPACE_BEGIN(Grid);
 | 
			
		||||
 | 
			
		||||
template<class vobj> inline Lattice<vobj> adj(const Lattice<vobj> &lhs){
 | 
			
		||||
  Lattice<vobj> ret(lhs._grid);
 | 
			
		||||
  Lattice<vobj> ret(lhs.Grid());
 | 
			
		||||
  accelerator_loop( ss, lhs, {
 | 
			
		||||
    ret[ss] = adj(lhs[ss]);
 | 
			
		||||
  });
 | 
			
		||||
@@ -47,7 +47,7 @@ template<class vobj> inline Lattice<vobj> adj(const Lattice<vobj> &lhs){
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
template<class vobj> inline Lattice<vobj> conjugate(const Lattice<vobj> &lhs){
 | 
			
		||||
  Lattice<vobj> ret(lhs._grid);
 | 
			
		||||
  Lattice<vobj> ret(lhs.Grid());
 | 
			
		||||
  accelerator_loop( ss, lhs, {
 | 
			
		||||
    ret[ss] = conjugate(lhs[ss]);
 | 
			
		||||
  });
 | 
			
		||||
 
 | 
			
		||||
@@ -44,13 +44,13 @@ inline ComplexD innerProduct(const Lattice<vobj> &left,const Lattice<vobj> &righ
 | 
			
		||||
  typedef typename vobj::vector_typeD vector_type;
 | 
			
		||||
  scalar_type  nrm;
 | 
			
		||||
  
 | 
			
		||||
  GridBase *grid = left._grid;
 | 
			
		||||
  GridBase *grid = left.Grid();
 | 
			
		||||
  
 | 
			
		||||
  std::vector<vector_type,alignedAllocator<vector_type> > sumarray(grid->SumArraySize());
 | 
			
		||||
  
 | 
			
		||||
  parallel_for(int thr=0;thr<grid->SumArraySize();thr++){
 | 
			
		||||
    int mywork, myoff;
 | 
			
		||||
    GridThread::GetWork(left._grid->oSites(),thr,mywork,myoff);
 | 
			
		||||
    GridThread::GetWork(left.Grid()->oSites(),thr,mywork,myoff);
 | 
			
		||||
    
 | 
			
		||||
    decltype(innerProductD(left[0],right[0])) vnrm=zero; // private to thread; sub summation
 | 
			
		||||
    for(int ss=myoff;ss<mywork+myoff; ss++){
 | 
			
		||||
@@ -64,7 +64,7 @@ inline ComplexD innerProduct(const Lattice<vobj> &left,const Lattice<vobj> &righ
 | 
			
		||||
    vvnrm = vvnrm+sumarray[i];
 | 
			
		||||
  } 
 | 
			
		||||
  nrm = Reduce(vvnrm);// sum across simd
 | 
			
		||||
  right._grid->GlobalSum(nrm);
 | 
			
		||||
  right.Grid()->GlobalSum(nrm);
 | 
			
		||||
  return nrm;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -96,7 +96,7 @@ inline auto sum(const LatticeTrinaryExpression<Op,T1,T2,T3> & expr)
 | 
			
		||||
template<class vobj>
 | 
			
		||||
inline typename vobj::scalar_object sum(const Lattice<vobj> &arg)
 | 
			
		||||
{
 | 
			
		||||
  GridBase *grid=arg._grid;
 | 
			
		||||
  GridBase *grid=arg.Grid();
 | 
			
		||||
  int Nsimd = grid->Nsimd();
 | 
			
		||||
  
 | 
			
		||||
  std::vector<vobj,alignedAllocator<vobj> > sumarray(grid->SumArraySize());
 | 
			
		||||
@@ -127,7 +127,7 @@ inline typename vobj::scalar_object sum(const Lattice<vobj> &arg)
 | 
			
		||||
  extract(vsum,buf);
 | 
			
		||||
  
 | 
			
		||||
  for(int i=0;i<Nsimd;i++) ssum = ssum + buf[i];
 | 
			
		||||
  arg._grid->GlobalSum(ssum);
 | 
			
		||||
  arg.Grid()->GlobalSum(ssum);
 | 
			
		||||
  
 | 
			
		||||
  return ssum;
 | 
			
		||||
}
 | 
			
		||||
@@ -145,7 +145,7 @@ template<class vobj> inline void sliceSum(const Lattice<vobj> &Data,std::vector<
 | 
			
		||||
  // But easily avoided by using double precision fields
 | 
			
		||||
  ///////////////////////////////////////////////////////
 | 
			
		||||
  typedef typename vobj::scalar_object sobj;
 | 
			
		||||
  GridBase  *grid = Data._grid;
 | 
			
		||||
  GridBase  *grid = Data.Grid();
 | 
			
		||||
  assert(grid!=NULL);
 | 
			
		||||
 | 
			
		||||
  const int    Nd = grid->_ndimension;
 | 
			
		||||
@@ -225,9 +225,9 @@ static void sliceInnerProductVector( std::vector<ComplexD> & result, const Latti
 | 
			
		||||
{
 | 
			
		||||
  typedef typename vobj::vector_type   vector_type;
 | 
			
		||||
  typedef typename vobj::scalar_type   scalar_type;
 | 
			
		||||
  GridBase  *grid = lhs._grid;
 | 
			
		||||
  GridBase  *grid = lhs.Grid();
 | 
			
		||||
  assert(grid!=NULL);
 | 
			
		||||
  conformable(grid,rhs._grid);
 | 
			
		||||
  conformable(grid,rhs.Grid());
 | 
			
		||||
 | 
			
		||||
  const int    Nd = grid->_ndimension;
 | 
			
		||||
  const int Nsimd = grid->Nsimd();
 | 
			
		||||
@@ -307,7 +307,7 @@ static void sliceNorm (std::vector<RealD> &sn,const Lattice<vobj> &rhs,int Ortho
 | 
			
		||||
  typedef typename vobj::scalar_type scalar_type;
 | 
			
		||||
  typedef typename vobj::vector_type vector_type;
 | 
			
		||||
  
 | 
			
		||||
  int Nblock = rhs._grid->GlobalDimensions()[Orthog];
 | 
			
		||||
  int Nblock = rhs.Grid()->GlobalDimensions()[Orthog];
 | 
			
		||||
  std::vector<ComplexD> ip(Nblock);
 | 
			
		||||
  sn.resize(Nblock);
 | 
			
		||||
  
 | 
			
		||||
@@ -329,7 +329,7 @@ static void sliceMaddVector(Lattice<vobj> &R,std::vector<RealD> &a,const Lattice
 | 
			
		||||
  
 | 
			
		||||
  scalar_type zscale(scale);
 | 
			
		||||
 | 
			
		||||
  GridBase *grid  = X._grid;
 | 
			
		||||
  GridBase *grid  = X.Grid();
 | 
			
		||||
 | 
			
		||||
  int Nsimd  =grid->Nsimd();
 | 
			
		||||
  int Nblock =grid->GlobalDimensions()[orthogdim];
 | 
			
		||||
 
 | 
			
		||||
@@ -311,13 +311,13 @@ public:
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class GridParallelRNG : public GridRNGbase {
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  double _time_counter;
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
  GridBase *_grid;
 | 
			
		||||
  unsigned int _vol;
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
  GridBase *Grid(void) const { return _grid; }
 | 
			
		||||
  int generator_idx(int os,int is) {
 | 
			
		||||
    return is*_grid->oSites()+os;
 | 
			
		||||
  }
 | 
			
		||||
@@ -341,9 +341,9 @@ public:
 | 
			
		||||
 | 
			
		||||
    double inner_time_counter = usecond();
 | 
			
		||||
 | 
			
		||||
    int multiplicity = RNGfillable_general(_grid, l._grid); // l has finer or same grid
 | 
			
		||||
    int Nsimd  = _grid->Nsimd();  // guaranteed to be the same for l._grid too
 | 
			
		||||
    int osites = _grid->oSites();  // guaranteed to be <= l._grid->oSites() by a factor multiplicity
 | 
			
		||||
    int multiplicity = RNGfillable_general(_grid, l.Grid()); // l has finer or same grid
 | 
			
		||||
    int Nsimd  = _grid->Nsimd();  // guaranteed to be the same for l.Grid() too
 | 
			
		||||
    int osites = _grid->oSites();  // guaranteed to be <= l.Grid()->oSites() by a factor multiplicity
 | 
			
		||||
    int words  = sizeof(scalar_object) / sizeof(scalar_type);
 | 
			
		||||
 | 
			
		||||
    thread_loop( (int ss=0;ss<osites;ss++), {
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,7 @@ template<class vobj>
 | 
			
		||||
inline auto trace(const Lattice<vobj> &lhs)
 | 
			
		||||
  -> Lattice<decltype(trace(lhs[0]))>
 | 
			
		||||
{
 | 
			
		||||
  Lattice<decltype(trace(lhs[0]))> ret(lhs._grid);
 | 
			
		||||
  Lattice<decltype(trace(lhs[0]))> ret(lhs.Grid());
 | 
			
		||||
  accelerator_loop( ss, lhs, {
 | 
			
		||||
    ret[ss] = trace(lhs[ss]);
 | 
			
		||||
  });
 | 
			
		||||
@@ -54,7 +54,7 @@ inline auto trace(const Lattice<vobj> &lhs)
 | 
			
		||||
template<int Index,class vobj>
 | 
			
		||||
inline auto TraceIndex(const Lattice<vobj> &lhs) -> Lattice<decltype(traceIndex<Index>(lhs[0]))>
 | 
			
		||||
{
 | 
			
		||||
  Lattice<decltype(traceIndex<Index>(lhs[0]))> ret(lhs._grid);
 | 
			
		||||
  Lattice<decltype(traceIndex<Index>(lhs[0]))> ret(lhs.Grid());
 | 
			
		||||
  accelerator_loop( ss, lhs, {
 | 
			
		||||
    ret[ss] = traceIndex<Index>(lhs[ss]);
 | 
			
		||||
  });
 | 
			
		||||
 
 | 
			
		||||
@@ -51,29 +51,29 @@ inline void subdivides(GridBase *coarse,GridBase *fine)
 | 
			
		||||
template<class vobj> inline void pickCheckerboard(int cb,Lattice<vobj> &half,const Lattice<vobj> &full){
 | 
			
		||||
  half.Checkerboard() = cb;
 | 
			
		||||
 | 
			
		||||
  thread_loop( (int ss=0;ss<full._grid->oSites();ss++),{
 | 
			
		||||
  thread_loop( (int ss=0;ss<full.Grid()->oSites();ss++),{
 | 
			
		||||
    int cbos;
 | 
			
		||||
    std::vector<int> coor;
 | 
			
		||||
    full._grid->oCoorFromOindex(coor,ss);
 | 
			
		||||
    cbos=half._grid->CheckerBoard(coor);
 | 
			
		||||
    full.Grid()->oCoorFromOindex(coor,ss);
 | 
			
		||||
    cbos=half.Grid()->CheckerBoard(coor);
 | 
			
		||||
      
 | 
			
		||||
    if (cbos==cb) {
 | 
			
		||||
      int ssh=half._grid->oIndex(coor);
 | 
			
		||||
      int ssh=half.Grid()->oIndex(coor);
 | 
			
		||||
      half[ssh] = full[ss];
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
template<class vobj> inline void setCheckerboard(Lattice<vobj> &full,const Lattice<vobj> &half){
 | 
			
		||||
  int cb = half.Checkerboard();
 | 
			
		||||
  thread_loop( (int ss=0;ss<full._grid->oSites();ss++), {
 | 
			
		||||
  thread_loop( (int ss=0;ss<full.Grid()->oSites();ss++), {
 | 
			
		||||
    std::vector<int> coor;
 | 
			
		||||
    int cbos;
 | 
			
		||||
 | 
			
		||||
    full._grid->oCoorFromOindex(coor,ss);
 | 
			
		||||
    cbos=half._grid->CheckerBoard(coor);
 | 
			
		||||
    full.Grid()->oCoorFromOindex(coor,ss);
 | 
			
		||||
    cbos=half.Grid()->CheckerBoard(coor);
 | 
			
		||||
      
 | 
			
		||||
    if (cbos==cb) {
 | 
			
		||||
      int ssh=half._grid->oIndex(coor);
 | 
			
		||||
      int ssh=half.Grid()->oIndex(coor);
 | 
			
		||||
      full[ss]=half[ssh];
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
@@ -85,8 +85,8 @@ inline void blockProject(Lattice<iVector<CComplex,nbasis > > &coarseData,
 | 
			
		||||
			 const             Lattice<vobj>   &fineData,
 | 
			
		||||
			 const std::vector<Lattice<vobj> > &Basis)
 | 
			
		||||
{
 | 
			
		||||
  GridBase * fine  = fineData._grid;
 | 
			
		||||
  GridBase * coarse= coarseData._grid;
 | 
			
		||||
  GridBase * fine  = fineData.Grid();
 | 
			
		||||
  GridBase * coarse= coarseData.Grid();
 | 
			
		||||
  int  _ndimension = coarse->_ndimension;
 | 
			
		||||
 | 
			
		||||
  // checks
 | 
			
		||||
@@ -132,8 +132,8 @@ inline void blockZAXPY(Lattice<vobj> &fineZ,
 | 
			
		||||
		       const Lattice<vobj> &fineX,
 | 
			
		||||
		       const Lattice<vobj> &fineY)
 | 
			
		||||
{
 | 
			
		||||
  GridBase * fine  = fineZ._grid;
 | 
			
		||||
  GridBase * coarse= coarseA._grid;
 | 
			
		||||
  GridBase * fine  = fineZ.Grid();
 | 
			
		||||
  GridBase * coarse= coarseA.Grid();
 | 
			
		||||
 | 
			
		||||
  fineZ.Checkerboard()=fineX.Checkerboard();
 | 
			
		||||
  assert(fineX.Checkerboard()==fineY.Checkerboard());
 | 
			
		||||
@@ -175,8 +175,8 @@ inline void blockInnerProduct(Lattice<CComplex> &CoarseInner,
 | 
			
		||||
{
 | 
			
		||||
  typedef decltype(innerProduct(fineX[0],fineY[0])) dotp;
 | 
			
		||||
 | 
			
		||||
  GridBase *coarse(CoarseInner._grid);
 | 
			
		||||
  GridBase *fine  (fineX._grid);
 | 
			
		||||
  GridBase *coarse(CoarseInner.Grid());
 | 
			
		||||
  GridBase *fine  (fineX.Grid());
 | 
			
		||||
 | 
			
		||||
  Lattice<dotp> fine_inner(fine); fine_inner.Checkerboard() = fineX.Checkerboard();
 | 
			
		||||
  Lattice<dotp> coarse_inner(coarse);
 | 
			
		||||
@@ -191,8 +191,8 @@ inline void blockInnerProduct(Lattice<CComplex> &CoarseInner,
 | 
			
		||||
template<class vobj,class CComplex>
 | 
			
		||||
inline void blockNormalise(Lattice<CComplex> &ip,Lattice<vobj> &fineX)
 | 
			
		||||
{
 | 
			
		||||
  GridBase *coarse = ip._grid;
 | 
			
		||||
  Lattice<vobj> zz(fineX._grid); zz=zero; zz.Checkerboard()=fineX.Checkerboard();
 | 
			
		||||
  GridBase *coarse = ip.Grid();
 | 
			
		||||
  Lattice<vobj> zz(fineX.Grid()); zz=zero; zz.Checkerboard()=fineX.Checkerboard();
 | 
			
		||||
  blockInnerProduct(ip,fineX,fineX);
 | 
			
		||||
  ip = pow(ip,-0.5);
 | 
			
		||||
  blockZAXPY(fineX,ip,fineX,zz);
 | 
			
		||||
@@ -202,8 +202,8 @@ inline void blockNormalise(Lattice<CComplex> &ip,Lattice<vobj> &fineX)
 | 
			
		||||
template<class vobj>
 | 
			
		||||
inline void blockSum(Lattice<vobj> &coarseData,const Lattice<vobj> &fineData)
 | 
			
		||||
{
 | 
			
		||||
  GridBase * fine  = fineData._grid;
 | 
			
		||||
  GridBase * coarse= coarseData._grid;
 | 
			
		||||
  GridBase * fine  = fineData.Grid();
 | 
			
		||||
  GridBase * coarse= coarseData.Grid();
 | 
			
		||||
 | 
			
		||||
  subdivides(coarse,fine); // require they map
 | 
			
		||||
 | 
			
		||||
@@ -242,7 +242,7 @@ inline void blockSum(Lattice<vobj> &coarseData,const Lattice<vobj> &fineData)
 | 
			
		||||
template<class vobj>
 | 
			
		||||
inline void blockPick(GridBase *coarse,const Lattice<vobj> &unpicked,Lattice<vobj> &picked,std::vector<int> coor)
 | 
			
		||||
{
 | 
			
		||||
  GridBase * fine = unpicked._grid;
 | 
			
		||||
  GridBase * fine = unpicked.Grid();
 | 
			
		||||
 | 
			
		||||
  Lattice<vobj> zz(fine); zz.Checkerboard() = unpicked.Checkerboard();
 | 
			
		||||
  Lattice<iScalar<vInteger> > fcoor(fine);
 | 
			
		||||
@@ -263,15 +263,15 @@ inline void blockPick(GridBase *coarse,const Lattice<vobj> &unpicked,Lattice<vob
 | 
			
		||||
template<class vobj,class CComplex>
 | 
			
		||||
inline void blockOrthogonalise(Lattice<CComplex> &ip,std::vector<Lattice<vobj> > &Basis)
 | 
			
		||||
{
 | 
			
		||||
  GridBase *coarse = ip._grid;
 | 
			
		||||
  GridBase *fine   = Basis[0]._grid;
 | 
			
		||||
  GridBase *coarse = ip.Grid();
 | 
			
		||||
  GridBase *fine   = Basis[0].Grid();
 | 
			
		||||
 | 
			
		||||
  int       nbasis = Basis.size() ;
 | 
			
		||||
 | 
			
		||||
  // checks
 | 
			
		||||
  subdivides(coarse,fine); 
 | 
			
		||||
  for(int i=0;i<nbasis;i++){
 | 
			
		||||
    conformable(Basis[i]._grid,fine);
 | 
			
		||||
    conformable(Basis[i].Grid(),fine);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  for(int v=0;v<nbasis;v++) {
 | 
			
		||||
@@ -290,15 +290,15 @@ inline void blockPromote(const Lattice<iVector<CComplex,nbasis > > &coarseData,
 | 
			
		||||
			 Lattice<vobj>   &fineData,
 | 
			
		||||
			 const std::vector<Lattice<vobj> > &Basis)
 | 
			
		||||
{
 | 
			
		||||
  GridBase * fine  = fineData._grid;
 | 
			
		||||
  GridBase * coarse= coarseData._grid;
 | 
			
		||||
  GridBase * fine  = fineData.Grid();
 | 
			
		||||
  GridBase * coarse= coarseData.Grid();
 | 
			
		||||
  int  _ndimension = coarse->_ndimension;
 | 
			
		||||
 | 
			
		||||
  // checks
 | 
			
		||||
  assert( nbasis == Basis.size() );
 | 
			
		||||
  subdivides(coarse,fine); 
 | 
			
		||||
  for(int i=0;i<nbasis;i++){
 | 
			
		||||
    conformable(Basis[i]._grid,fine);
 | 
			
		||||
    conformable(Basis[i].Grid(),fine);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  std::vector<int>  block_r      (_ndimension);
 | 
			
		||||
@@ -337,8 +337,8 @@ void localConvert(const Lattice<vobj> &in,Lattice<vvobj> &out)
 | 
			
		||||
  typedef typename vobj::scalar_object sobj;
 | 
			
		||||
  typedef typename vvobj::scalar_object ssobj;
 | 
			
		||||
 | 
			
		||||
  GridBase *ig = in._grid;
 | 
			
		||||
  GridBase *og = out._grid;
 | 
			
		||||
  GridBase *ig = in.Grid();
 | 
			
		||||
  GridBase *og = out.Grid();
 | 
			
		||||
 | 
			
		||||
  int ni = ig->_ndimension;
 | 
			
		||||
  int no = og->_ndimension;
 | 
			
		||||
@@ -369,8 +369,8 @@ void InsertSlice(const Lattice<vobj> &lowDim,Lattice<vobj> & higherDim,int slice
 | 
			
		||||
{
 | 
			
		||||
  typedef typename vobj::scalar_object sobj;
 | 
			
		||||
 | 
			
		||||
  GridBase *lg = lowDim._grid;
 | 
			
		||||
  GridBase *hg = higherDim._grid;
 | 
			
		||||
  GridBase *lg = lowDim.Grid();
 | 
			
		||||
  GridBase *hg = higherDim.Grid();
 | 
			
		||||
  int nl = lg->_ndimension;
 | 
			
		||||
  int nh = hg->_ndimension;
 | 
			
		||||
 | 
			
		||||
@@ -411,8 +411,8 @@ void ExtractSlice(Lattice<vobj> &lowDim,const Lattice<vobj> & higherDim,int slic
 | 
			
		||||
{
 | 
			
		||||
  typedef typename vobj::scalar_object sobj;
 | 
			
		||||
 | 
			
		||||
  GridBase *lg = lowDim._grid;
 | 
			
		||||
  GridBase *hg = higherDim._grid;
 | 
			
		||||
  GridBase *lg = lowDim.Grid();
 | 
			
		||||
  GridBase *hg = higherDim.Grid();
 | 
			
		||||
  int nl = lg->_ndimension;
 | 
			
		||||
  int nh = hg->_ndimension;
 | 
			
		||||
 | 
			
		||||
@@ -454,8 +454,8 @@ void InsertSliceLocal(const Lattice<vobj> &lowDim, Lattice<vobj> & higherDim,int
 | 
			
		||||
{
 | 
			
		||||
  typedef typename vobj::scalar_object sobj;
 | 
			
		||||
 | 
			
		||||
  GridBase *lg = lowDim._grid;
 | 
			
		||||
  GridBase *hg = higherDim._grid;
 | 
			
		||||
  GridBase *lg = lowDim.Grid();
 | 
			
		||||
  GridBase *hg = higherDim.Grid();
 | 
			
		||||
  int nl = lg->_ndimension;
 | 
			
		||||
  int nh = hg->_ndimension;
 | 
			
		||||
 | 
			
		||||
@@ -489,8 +489,8 @@ void ExtractSliceLocal(Lattice<vobj> &lowDim, Lattice<vobj> & higherDim,int slic
 | 
			
		||||
{
 | 
			
		||||
  typedef typename vobj::scalar_object sobj;
 | 
			
		||||
 | 
			
		||||
  GridBase *lg = lowDim._grid;
 | 
			
		||||
  GridBase *hg = higherDim._grid;
 | 
			
		||||
  GridBase *lg = lowDim.Grid();
 | 
			
		||||
  GridBase *hg = higherDim.Grid();
 | 
			
		||||
  int nl = lg->_ndimension;
 | 
			
		||||
  int nh = hg->_ndimension;
 | 
			
		||||
 | 
			
		||||
@@ -524,8 +524,8 @@ void Replicate(Lattice<vobj> &coarse,Lattice<vobj> & fine)
 | 
			
		||||
{
 | 
			
		||||
  typedef typename vobj::scalar_object sobj;
 | 
			
		||||
 | 
			
		||||
  GridBase *cg = coarse._grid;
 | 
			
		||||
  GridBase *fg =   fine._grid;
 | 
			
		||||
  GridBase *cg = coarse.Grid();
 | 
			
		||||
  GridBase *fg =   fine.Grid();
 | 
			
		||||
 | 
			
		||||
  int nd = cg->_ndimension;
 | 
			
		||||
 | 
			
		||||
@@ -563,7 +563,7 @@ unvectorizeToLexOrdArray(std::vector<sobj> &out, const Lattice<vobj> &in)
 | 
			
		||||
 | 
			
		||||
  typedef typename vobj::vector_type vtype;
 | 
			
		||||
  
 | 
			
		||||
  GridBase* in_grid = in._grid;
 | 
			
		||||
  GridBase* in_grid = in.Grid();
 | 
			
		||||
  out.resize(in_grid->lSites());
 | 
			
		||||
  
 | 
			
		||||
  int ndim = in_grid->Nd();
 | 
			
		||||
@@ -609,7 +609,7 @@ vectorizeFromLexOrdArray( std::vector<sobj> &in, Lattice<vobj> &out)
 | 
			
		||||
 | 
			
		||||
  typedef typename vobj::vector_type vtype;
 | 
			
		||||
  
 | 
			
		||||
  GridBase* grid = out._grid;
 | 
			
		||||
  GridBase* grid = out.Grid();
 | 
			
		||||
  assert(in.size()==grid->lSites());
 | 
			
		||||
  
 | 
			
		||||
  int ndim     = grid->Nd();
 | 
			
		||||
@@ -653,15 +653,15 @@ vectorizeFromLexOrdArray( std::vector<sobj> &in, Lattice<vobj> &out)
 | 
			
		||||
template<class VobjOut, class VobjIn>
 | 
			
		||||
void precisionChange(Lattice<VobjOut> &out, const Lattice<VobjIn> &in){
 | 
			
		||||
 | 
			
		||||
  assert(out._grid->Nd() == in._grid->Nd());
 | 
			
		||||
  assert(out.Grid()->Nd() == in.Grid()->Nd());
 | 
			
		||||
  out.Checkerboard() = in.Checkerboard();
 | 
			
		||||
  GridBase *in_grid=in._grid;
 | 
			
		||||
  GridBase *out_grid = out._grid;
 | 
			
		||||
  GridBase *in_grid=in.Grid();
 | 
			
		||||
  GridBase *out_grid = out.Grid();
 | 
			
		||||
 | 
			
		||||
  typedef typename VobjOut::scalar_object SobjOut;
 | 
			
		||||
  typedef typename VobjIn::scalar_object SobjIn;
 | 
			
		||||
 | 
			
		||||
  int ndim = out._grid->Nd();
 | 
			
		||||
  int ndim = out.Grid()->Nd();
 | 
			
		||||
  int out_nsimd = out_grid->Nsimd();
 | 
			
		||||
    
 | 
			
		||||
  std::vector<std::vector<int> > out_icoor(out_nsimd);
 | 
			
		||||
@@ -749,8 +749,8 @@ void Grid_split(std::vector<Lattice<Vobj> > & full,Lattice<Vobj>   & split)
 | 
			
		||||
 | 
			
		||||
  assert(full_vecs>=1);
 | 
			
		||||
 | 
			
		||||
  GridBase * full_grid = full[0]._grid;
 | 
			
		||||
  GridBase *split_grid = split._grid;
 | 
			
		||||
  GridBase * full_grid = full[0].Grid();
 | 
			
		||||
  GridBase *split_grid = split.Grid();
 | 
			
		||||
 | 
			
		||||
  int       ndim  = full_grid->_ndimension;
 | 
			
		||||
  int  full_nproc = full_grid->_Nprocessors;
 | 
			
		||||
@@ -769,8 +769,8 @@ void Grid_split(std::vector<Lattice<Vobj> > & full,Lattice<Vobj>   & split)
 | 
			
		||||
  for(int n=0;n<full_vecs;n++){
 | 
			
		||||
    assert(full[n].Checkerboard() == cb);
 | 
			
		||||
    for(int d=0;d<ndim;d++){
 | 
			
		||||
      assert(full[n]._grid->_gdimensions[d]==split._grid->_gdimensions[d]);
 | 
			
		||||
      assert(full[n]._grid->_fdimensions[d]==split._grid->_fdimensions[d]);
 | 
			
		||||
      assert(full[n].Grid()->_gdimensions[d]==split.Grid()->_gdimensions[d]);
 | 
			
		||||
      assert(full[n].Grid()->_fdimensions[d]==split.Grid()->_fdimensions[d]);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -858,8 +858,8 @@ void Grid_split(std::vector<Lattice<Vobj> > & full,Lattice<Vobj>   & split)
 | 
			
		||||
template<class Vobj>
 | 
			
		||||
void Grid_split(Lattice<Vobj> &full,Lattice<Vobj>   & split)
 | 
			
		||||
{
 | 
			
		||||
  int nvector = full._grid->_Nprocessors / split._grid->_Nprocessors;
 | 
			
		||||
  std::vector<Lattice<Vobj> > full_v(nvector,full._grid);
 | 
			
		||||
  int nvector = full.Grid()->_Nprocessors / split.Grid()->_Nprocessors;
 | 
			
		||||
  std::vector<Lattice<Vobj> > full_v(nvector,full.Grid());
 | 
			
		||||
  for(int n=0;n<nvector;n++){
 | 
			
		||||
    full_v[n] = full;
 | 
			
		||||
  }
 | 
			
		||||
@@ -875,8 +875,8 @@ void Grid_unsplit(std::vector<Lattice<Vobj> > & full,Lattice<Vobj>   & split)
 | 
			
		||||
 | 
			
		||||
  assert(full_vecs>=1);
 | 
			
		||||
 | 
			
		||||
  GridBase * full_grid = full[0]._grid;
 | 
			
		||||
  GridBase *split_grid = split._grid;
 | 
			
		||||
  GridBase * full_grid = full[0].Grid();
 | 
			
		||||
  GridBase *split_grid = split.Grid();
 | 
			
		||||
 | 
			
		||||
  int       ndim  = full_grid->_ndimension;
 | 
			
		||||
  int  full_nproc = full_grid->_Nprocessors;
 | 
			
		||||
@@ -895,8 +895,8 @@ void Grid_unsplit(std::vector<Lattice<Vobj> > & full,Lattice<Vobj>   & split)
 | 
			
		||||
  for(int n=0;n<full_vecs;n++){
 | 
			
		||||
    assert(full[n].Checkerboard() == cb);
 | 
			
		||||
    for(int d=0;d<ndim;d++){
 | 
			
		||||
      assert(full[n]._grid->_gdimensions[d]==split._grid->_gdimensions[d]);
 | 
			
		||||
      assert(full[n]._grid->_fdimensions[d]==split._grid->_fdimensions[d]);
 | 
			
		||||
      assert(full[n].Grid()->_gdimensions[d]==split.Grid()->_gdimensions[d]);
 | 
			
		||||
      assert(full[n].Grid()->_fdimensions[d]==split.Grid()->_fdimensions[d]);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ NAMESPACE_BEGIN(Grid);
 | 
			
		||||
////////////////////////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
template<class vobj>
 | 
			
		||||
inline Lattice<vobj> transpose(const Lattice<vobj> &lhs){
 | 
			
		||||
  Lattice<vobj> ret(lhs._grid);
 | 
			
		||||
  Lattice<vobj> ret(lhs.Grid());
 | 
			
		||||
  accelerator_loop(ss,lhs,{
 | 
			
		||||
    ret[ss] = transpose(lhs[ss]);
 | 
			
		||||
  });
 | 
			
		||||
@@ -53,7 +53,7 @@ inline Lattice<vobj> transpose(const Lattice<vobj> &lhs){
 | 
			
		||||
template<int Index,class vobj>
 | 
			
		||||
inline auto TransposeIndex(const Lattice<vobj> &lhs) -> Lattice<decltype(transposeIndex<Index>(lhs[0]))>
 | 
			
		||||
{
 | 
			
		||||
  Lattice<decltype(transposeIndex<Index>(lhs[0]))> ret(lhs._grid);
 | 
			
		||||
  Lattice<decltype(transposeIndex<Index>(lhs[0]))> ret(lhs.Grid());
 | 
			
		||||
  accelerator_loop(ss,lhs,{
 | 
			
		||||
    ret[ss] = transposeIndex<Index>(lhs[ss]);
 | 
			
		||||
  });
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
 | 
			
		||||
NAMESPACE_BEGIN(Grid);
 | 
			
		||||
 | 
			
		||||
template<class obj> Lattice<obj> pow(const Lattice<obj> &rhs,RealD y){
 | 
			
		||||
  Lattice<obj> ret(rhs._grid);
 | 
			
		||||
  Lattice<obj> ret(rhs.Grid());
 | 
			
		||||
  ret.Checkerboard() = rhs.Checkerboard();
 | 
			
		||||
  conformable(ret,rhs);
 | 
			
		||||
  accelerator_loop(ss,rhs,{
 | 
			
		||||
@@ -43,7 +43,7 @@ template<class obj> Lattice<obj> pow(const Lattice<obj> &rhs,RealD y){
 | 
			
		||||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
template<class obj> Lattice<obj> mod(const Lattice<obj> &rhs,Integer y){
 | 
			
		||||
  Lattice<obj> ret(rhs._grid);
 | 
			
		||||
  Lattice<obj> ret(rhs.Grid());
 | 
			
		||||
  ret.Checkerboard() = rhs.Checkerboard();
 | 
			
		||||
  conformable(ret,rhs);
 | 
			
		||||
  accelerator_loop(ss,rhs,{
 | 
			
		||||
@@ -53,7 +53,7 @@ template<class obj> Lattice<obj> mod(const Lattice<obj> &rhs,Integer y){
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template<class obj> Lattice<obj> div(const Lattice<obj> &rhs,Integer y){
 | 
			
		||||
  Lattice<obj> ret(rhs._grid);
 | 
			
		||||
  Lattice<obj> ret(rhs.Grid());
 | 
			
		||||
  ret.Checkerboard() = rhs.Checkerboard();
 | 
			
		||||
  conformable(ret,rhs);
 | 
			
		||||
  accelerator_loop(ss,rhs,{
 | 
			
		||||
@@ -63,7 +63,7 @@ template<class obj> Lattice<obj> div(const Lattice<obj> &rhs,Integer y){
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template<class obj> Lattice<obj> expMat(const Lattice<obj> &rhs, RealD alpha, Integer Nexp = DEFAULT_MAT_EXP){
 | 
			
		||||
  Lattice<obj> ret(rhs._grid);
 | 
			
		||||
  Lattice<obj> ret(rhs.Grid());
 | 
			
		||||
  ret.Checkerboard() = rhs.Checkerboard();
 | 
			
		||||
  conformable(ret,rhs);
 | 
			
		||||
  accelerator_loop(ss,rhs,{
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ inline void whereWolf(Lattice<vobj> &ret,const Lattice<iobj> &predicate,Lattice<
 | 
			
		||||
  conformable(iftrue,predicate);
 | 
			
		||||
  conformable(iftrue,ret);
 | 
			
		||||
 | 
			
		||||
  GridBase *grid=iftrue._grid;
 | 
			
		||||
  GridBase *grid=iftrue.Grid();
 | 
			
		||||
 | 
			
		||||
  typedef typename vobj::scalar_object scalar_object;
 | 
			
		||||
  typedef typename vobj::scalar_type scalar_type;
 | 
			
		||||
@@ -79,7 +79,7 @@ inline Lattice<vobj> whereWolf(const Lattice<iobj> &predicate,Lattice<vobj> &ift
 | 
			
		||||
  conformable(iftrue,iffalse);
 | 
			
		||||
  conformable(iftrue,predicate);
 | 
			
		||||
 | 
			
		||||
  Lattice<vobj> ret(iftrue._grid);
 | 
			
		||||
  Lattice<vobj> ret(iftrue.Grid());
 | 
			
		||||
 | 
			
		||||
  where(ret,predicate,iftrue,iffalse);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -89,7 +89,7 @@ public:
 | 
			
		||||
  {
 | 
			
		||||
    typedef typename vobj::scalar_object sobj;
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = lat._grid;
 | 
			
		||||
    GridBase *grid = lat.Grid();
 | 
			
		||||
    int lsites = grid->lSites();
 | 
			
		||||
 | 
			
		||||
    std::vector<sobj> scalardata(lsites); 
 | 
			
		||||
@@ -522,7 +522,7 @@ public:
 | 
			
		||||
    typedef typename vobj::scalar_object sobj;
 | 
			
		||||
    typedef typename vobj::Realified::scalar_type word;    word w=0;
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = Umu._grid;
 | 
			
		||||
    GridBase *grid = Umu.Grid();
 | 
			
		||||
    int lsites = grid->lSites();
 | 
			
		||||
 | 
			
		||||
    std::vector<sobj> scalardata(lsites); 
 | 
			
		||||
@@ -558,7 +558,7 @@ public:
 | 
			
		||||
  {
 | 
			
		||||
    typedef typename vobj::scalar_object sobj;
 | 
			
		||||
    typedef typename vobj::Realified::scalar_type word;    word w=0;
 | 
			
		||||
    GridBase *grid = Umu._grid;
 | 
			
		||||
    GridBase *grid = Umu.Grid();
 | 
			
		||||
    int lsites = grid->lSites();
 | 
			
		||||
 | 
			
		||||
    std::vector<sobj> scalardata(lsites); 
 | 
			
		||||
@@ -599,7 +599,7 @@ public:
 | 
			
		||||
 | 
			
		||||
    std::string format = "IEEE32BIG";
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = parallel._grid;
 | 
			
		||||
    GridBase *grid = parallel.Grid();
 | 
			
		||||
    int gsites = grid->gSites();
 | 
			
		||||
    int lsites = grid->lSites();
 | 
			
		||||
 | 
			
		||||
@@ -659,7 +659,7 @@ public:
 | 
			
		||||
    const int RngStateCount = GridSerialRNG::RngStateCount;
 | 
			
		||||
    typedef std::array<RngStateType,RngStateCount> RNGstate;
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = parallel._grid;
 | 
			
		||||
    GridBase *grid = parallel.Grid();
 | 
			
		||||
    int gsites = grid->gSites();
 | 
			
		||||
    int lsites = grid->lSites();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -133,7 +133,7 @@ template<class vobj> void ScidacMetaData(Lattice<vobj> & field,
 | 
			
		||||
  /////////////////////////////////////
 | 
			
		||||
  // Scidac Private File structure
 | 
			
		||||
  /////////////////////////////////////
 | 
			
		||||
  _scidacFile              = scidacFile(field._grid);
 | 
			
		||||
  _scidacFile              = scidacFile(field.Grid());
 | 
			
		||||
 | 
			
		||||
  /////////////////////////////////////
 | 
			
		||||
  // Scidac Private Record structure
 | 
			
		||||
@@ -214,10 +214,10 @@ public:
 | 
			
		||||
 | 
			
		||||
	//	std::cout << GridLogMessage<< " readLimeLatticeBinaryObject matches ! " <<std::endl;
 | 
			
		||||
 | 
			
		||||
	uint64_t PayloadSize = sizeof(sobj) * field._grid->_gsites;
 | 
			
		||||
	uint64_t PayloadSize = sizeof(sobj) * field.Grid()->_gsites;
 | 
			
		||||
 | 
			
		||||
	//	std::cout << "R sizeof(sobj)= " <<sizeof(sobj)<<std::endl;
 | 
			
		||||
	//	std::cout << "R Gsites " <<field._grid->_gsites<<std::endl;
 | 
			
		||||
	//	std::cout << "R Gsites " <<field.Grid()->_gsites<<std::endl;
 | 
			
		||||
	//	std::cout << "R Payload expected " <<PayloadSize<<std::endl;
 | 
			
		||||
	//	std::cout << "R file size " <<file_bytes <<std::endl;
 | 
			
		||||
 | 
			
		||||
@@ -342,11 +342,11 @@ public:
 | 
			
		||||
    typedef typename vobj::scalar_object sobj;
 | 
			
		||||
    int err;
 | 
			
		||||
    uint32_t nersc_csum,scidac_csuma,scidac_csumb;
 | 
			
		||||
    uint64_t PayloadSize = sizeof(sobj) * field._grid->_gsites;
 | 
			
		||||
    uint64_t PayloadSize = sizeof(sobj) * field.Grid()->_gsites;
 | 
			
		||||
    createLimeRecordHeader(record_name, 0, 0, PayloadSize);
 | 
			
		||||
 | 
			
		||||
    //    std::cout << "W sizeof(sobj)"      <<sizeof(sobj)<<std::endl;
 | 
			
		||||
    //    std::cout << "W Gsites "           <<field._grid->_gsites<<std::endl;
 | 
			
		||||
    //    std::cout << "W Gsites "           <<field.Grid()->_gsites<<std::endl;
 | 
			
		||||
    //    std::cout << "W Payload expected " <<PayloadSize<<std::endl;
 | 
			
		||||
 | 
			
		||||
    ////////////////////////////////////////////////////////////////////
 | 
			
		||||
@@ -400,7 +400,7 @@ public:
 | 
			
		||||
  template <class vobj, class userRecord>
 | 
			
		||||
  void writeScidacFieldRecord(Lattice<vobj> &field,userRecord _userRecord) 
 | 
			
		||||
  {
 | 
			
		||||
    GridBase * grid = field._grid;
 | 
			
		||||
    GridBase * grid = field.Grid();
 | 
			
		||||
 | 
			
		||||
    ////////////////////////////////////////
 | 
			
		||||
    // fill the Grid header
 | 
			
		||||
@@ -439,7 +439,7 @@ public:
 | 
			
		||||
  void readScidacFieldRecord(Lattice<vobj> &field,userRecord &_userRecord) 
 | 
			
		||||
  {
 | 
			
		||||
    typedef typename vobj::scalar_object sobj;
 | 
			
		||||
    GridBase * grid = field._grid;
 | 
			
		||||
    GridBase * grid = field.Grid();
 | 
			
		||||
 | 
			
		||||
    ////////////////////////////////////////
 | 
			
		||||
    // fill the Grid header
 | 
			
		||||
@@ -504,7 +504,7 @@ public:
 | 
			
		||||
  template <class vsimd>
 | 
			
		||||
  void writeConfiguration(Lattice<iLorentzColourMatrix<vsimd> > &Umu,int sequence,std::string LFN,std::string description) 
 | 
			
		||||
  {
 | 
			
		||||
    GridBase * grid = Umu._grid;
 | 
			
		||||
    GridBase * grid = Umu.Grid();
 | 
			
		||||
    typedef Lattice<iLorentzColourMatrix<vsimd> > GaugeField;
 | 
			
		||||
    typedef iLorentzColourMatrix<vsimd> vobj;
 | 
			
		||||
    typedef typename vobj::scalar_object sobj;
 | 
			
		||||
@@ -591,9 +591,9 @@ public:
 | 
			
		||||
    typedef LorentzColourMatrixF fobj;
 | 
			
		||||
    typedef LorentzColourMatrixD dobj;
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = Umu._grid;
 | 
			
		||||
    GridBase *grid = Umu.Grid();
 | 
			
		||||
 | 
			
		||||
    std::vector<int> dims = Umu._grid->FullDimensions();
 | 
			
		||||
    std::vector<int> dims = Umu.Grid()->FullDimensions();
 | 
			
		||||
 | 
			
		||||
    assert(dims.size()==4);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -167,7 +167,7 @@ inline void MachineCharacteristics(FieldMetaData &header)
 | 
			
		||||
 | 
			
		||||
template<class vobj> inline void PrepareMetaData(Lattice<vobj> & field, FieldMetaData &header)
 | 
			
		||||
{
 | 
			
		||||
  GridBase *grid = field._grid;
 | 
			
		||||
  GridBase *grid = field.Grid();
 | 
			
		||||
  std::string format = getFormatString<vobj>();
 | 
			
		||||
  header.floating_point = format;
 | 
			
		||||
  header.checksum = 0x0; // Nersc checksum unused in ILDG, Scidac
 | 
			
		||||
@@ -189,7 +189,7 @@ inline void GaugeStatistics(Lattice<vLorentzColourMatrixD> & data,FieldMetaData
 | 
			
		||||
template<> inline void PrepareMetaData<vLorentzColourMatrixF>(Lattice<vLorentzColourMatrixF> & field, FieldMetaData &header)
 | 
			
		||||
{
 | 
			
		||||
   
 | 
			
		||||
  GridBase *grid = field._grid;
 | 
			
		||||
  GridBase *grid = field.Grid();
 | 
			
		||||
  std::string format = getFormatString<vLorentzColourMatrixF>();
 | 
			
		||||
  header.floating_point = format;
 | 
			
		||||
  header.checksum = 0x0; // Nersc checksum unused in ILDG, Scidac
 | 
			
		||||
@@ -199,7 +199,7 @@ template<> inline void PrepareMetaData<vLorentzColourMatrixF>(Lattice<vLorentzCo
 | 
			
		||||
}
 | 
			
		||||
template<> inline void PrepareMetaData<vLorentzColourMatrixD>(Lattice<vLorentzColourMatrixD> & field, FieldMetaData &header)
 | 
			
		||||
{
 | 
			
		||||
  GridBase *grid = field._grid;
 | 
			
		||||
  GridBase *grid = field.Grid();
 | 
			
		||||
  std::string format = getFormatString<vLorentzColourMatrixD>();
 | 
			
		||||
  header.floating_point = format;
 | 
			
		||||
  header.checksum = 0x0; // Nersc checksum unused in ILDG, Scidac
 | 
			
		||||
 
 | 
			
		||||
@@ -136,7 +136,7 @@ public:
 | 
			
		||||
  {
 | 
			
		||||
    typedef Lattice<iLorentzColourMatrix<vsimd> > GaugeField;
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = Umu._grid;
 | 
			
		||||
    GridBase *grid = Umu.Grid();
 | 
			
		||||
    int offset = readHeader(file,grid,header);
 | 
			
		||||
 | 
			
		||||
    FieldMetaData clone(header);
 | 
			
		||||
@@ -227,7 +227,7 @@ public:
 | 
			
		||||
    typedef LorentzColourMatrixD fobj3D;
 | 
			
		||||
    typedef LorentzColour2x3D    fobj2D;
 | 
			
		||||
  
 | 
			
		||||
    GridBase *grid = Umu._grid;
 | 
			
		||||
    GridBase *grid = Umu.Grid();
 | 
			
		||||
 | 
			
		||||
    GridMetaData(grid,header);
 | 
			
		||||
    assert(header.nd==4);
 | 
			
		||||
@@ -268,7 +268,7 @@ public:
 | 
			
		||||
    header.ensemble_id     = "UKQCD";
 | 
			
		||||
    header.ensemble_label  = "DWF";
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = parallel._grid;
 | 
			
		||||
    GridBase *grid = parallel.Grid();
 | 
			
		||||
 | 
			
		||||
    GridMetaData(grid,header);
 | 
			
		||||
    assert(header.nd==4);
 | 
			
		||||
@@ -309,7 +309,7 @@ public:
 | 
			
		||||
  {
 | 
			
		||||
    typedef typename GridParallelRNG::RngStateType RngStateType;
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = parallel._grid;
 | 
			
		||||
    GridBase *grid = parallel.Grid();
 | 
			
		||||
 | 
			
		||||
    int offset = readHeader(file,grid,header);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -189,7 +189,7 @@ public:
 | 
			
		||||
  void evolve(void) {
 | 
			
		||||
    Real DeltaH;
 | 
			
		||||
 | 
			
		||||
    Field Ucopy(Ucur._grid);
 | 
			
		||||
    Field Ucopy(Ucur.Grid());
 | 
			
		||||
 | 
			
		||||
    Params.print_parameters();
 | 
			
		||||
    TheIntegrator.print_actions();
 | 
			
		||||
 
 | 
			
		||||
@@ -98,11 +98,11 @@ protected:
 | 
			
		||||
    void operator()(std::vector<Action<FieldType>*> repr_set, Repr& Rep,
 | 
			
		||||
                    GF& Mom, GF& U, double ep) {
 | 
			
		||||
      for (int a = 0; a < repr_set.size(); ++a) {
 | 
			
		||||
        FieldType forceR(U._grid);
 | 
			
		||||
        FieldType forceR(U.Grid());
 | 
			
		||||
        // Implement smearing only for the fundamental representation now
 | 
			
		||||
        repr_set.at(a)->deriv(Rep.U, forceR);
 | 
			
		||||
        GF force = Rep.RtoFundamentalProject(forceR);  // Ta for the fundamental rep
 | 
			
		||||
        Real force_abs = std::sqrt(norm2(force)/(U._grid->gSites()));
 | 
			
		||||
        Real force_abs = std::sqrt(norm2(force)/(U.Grid()->gSites()));
 | 
			
		||||
        std::cout << GridLogIntegrator << "Hirep Force average: " << force_abs << std::endl;
 | 
			
		||||
        Mom -= force * ep ;
 | 
			
		||||
      }
 | 
			
		||||
@@ -114,15 +114,15 @@ protected:
 | 
			
		||||
    // Fundamental updates, include smearing
 | 
			
		||||
 | 
			
		||||
    for (int a = 0; a < as[level].actions.size(); ++a) {
 | 
			
		||||
      Field force(U._grid);
 | 
			
		||||
      conformable(U._grid, Mom._grid);
 | 
			
		||||
      Field force(U.Grid());
 | 
			
		||||
      conformable(U.Grid(), Mom.Grid());
 | 
			
		||||
      Field& Us = Smearer.get_U(as[level].actions.at(a)->is_smeared);
 | 
			
		||||
      as[level].actions.at(a)->deriv(Us, force);  // deriv should NOT include Ta
 | 
			
		||||
 | 
			
		||||
      std::cout << GridLogIntegrator << "Smearing (on/off): " << as[level].actions.at(a)->is_smeared << std::endl;
 | 
			
		||||
      if (as[level].actions.at(a)->is_smeared) Smearer.smeared_force(force);
 | 
			
		||||
      force = FieldImplementation::projectForce(force); // Ta for gauge fields
 | 
			
		||||
      Real force_abs = std::sqrt(norm2(force)/U._grid->gSites());
 | 
			
		||||
      Real force_abs = std::sqrt(norm2(force)/U.Grid()->gSites());
 | 
			
		||||
      std::cout << GridLogIntegrator << "Force average: " << force_abs << std::endl;
 | 
			
		||||
      Mom -= force * ep; 
 | 
			
		||||
    }
 | 
			
		||||
@@ -210,7 +210,7 @@ public:
 | 
			
		||||
 | 
			
		||||
  // Initialization of momenta and actions
 | 
			
		||||
  void refresh(Field& U, GridParallelRNG& pRNG) {
 | 
			
		||||
    assert(P._grid == U._grid);
 | 
			
		||||
    assert(P.Grid() == U.Grid());
 | 
			
		||||
    std::cout << GridLogIntegrator << "Integrator refresh\n";
 | 
			
		||||
 | 
			
		||||
    FieldImplementation::generate_momenta(P, pRNG);
 | 
			
		||||
 
 | 
			
		||||
@@ -226,8 +226,8 @@ public:
 | 
			
		||||
  std::string integrator_name(){return "ForceGradient";}
 | 
			
		||||
  
 | 
			
		||||
  void FG_update_P(Field& U, int level, double fg_dt, double ep) {
 | 
			
		||||
    Field Ufg(U._grid);
 | 
			
		||||
    Field Pfg(U._grid);
 | 
			
		||||
    Field Ufg(U.Grid());
 | 
			
		||||
    Field Pfg(U.Grid());
 | 
			
		||||
    Ufg = U;
 | 
			
		||||
    Pfg = zero;
 | 
			
		||||
    std::cout << GridLogIntegrator << "FG update " << fg_dt << " " << ep
 | 
			
		||||
 
 | 
			
		||||
@@ -37,12 +37,12 @@ public:
 | 
			
		||||
    // T_F is 1/2 for the fundamental representation
 | 
			
		||||
    conformable(U, Uin);
 | 
			
		||||
    U = zero;
 | 
			
		||||
    LatticeColourMatrix tmp(Uin._grid);
 | 
			
		||||
    LatticeColourMatrix tmp(Uin.Grid());
 | 
			
		||||
 | 
			
		||||
    Vector<typename SU<ncolour>::Matrix> ta(Dimension);
 | 
			
		||||
 | 
			
		||||
    // Debug lines
 | 
			
		||||
    // LatticeMatrix uno(Uin._grid);
 | 
			
		||||
    // LatticeMatrix uno(Uin.Grid());
 | 
			
		||||
    // uno = 1.0;
 | 
			
		||||
    ////////////////
 | 
			
		||||
 | 
			
		||||
@@ -75,16 +75,16 @@ public:
 | 
			
		||||
 | 
			
		||||
  LatticeGaugeField RtoFundamentalProject(const LatticeField &in,
 | 
			
		||||
                                          Real scale = 1.0) const {
 | 
			
		||||
    LatticeGaugeField out(in._grid);
 | 
			
		||||
    LatticeGaugeField out(in.Grid());
 | 
			
		||||
    out = zero;
 | 
			
		||||
 | 
			
		||||
    for (int mu = 0; mu < Nd; mu++) {
 | 
			
		||||
      LatticeColourMatrix out_mu(in._grid);  // fundamental representation
 | 
			
		||||
      LatticeColourMatrix out_mu(in.Grid());  // fundamental representation
 | 
			
		||||
      LatticeMatrix in_mu = peekLorentz(in, mu);
 | 
			
		||||
 | 
			
		||||
      out_mu = zero;
 | 
			
		||||
 | 
			
		||||
      typename SU<ncolour>::LatticeAlgebraVector h(in._grid);
 | 
			
		||||
      typename SU<ncolour>::LatticeAlgebraVector h(in.Grid());
 | 
			
		||||
      projectOnAlgebra(h, in_mu, double(Nc) * 2.0);  // factor C(r)/C(fund)
 | 
			
		||||
      FundamentalLieAlgebraMatrix(h, out_mu);   // apply scale only once
 | 
			
		||||
      pokeLorentz(out, out_mu, mu);
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ public:
 | 
			
		||||
    // (U)_{(ij)(lk)} = tr [ adj(e^(ij)) U e^(lk) transpose(U) ]
 | 
			
		||||
    conformable(U, Uin);
 | 
			
		||||
    U = zero;
 | 
			
		||||
    LatticeColourMatrix tmp(Uin._grid);
 | 
			
		||||
    LatticeColourMatrix tmp(Uin.Grid());
 | 
			
		||||
 | 
			
		||||
    Vector<typename SU<ncolour>::Matrix> eij(Dimension);
 | 
			
		||||
 | 
			
		||||
@@ -61,16 +61,16 @@ public:
 | 
			
		||||
 | 
			
		||||
  LatticeGaugeField RtoFundamentalProject(const LatticeField &in,
 | 
			
		||||
                                          Real scale = 1.0) const {
 | 
			
		||||
    LatticeGaugeField out(in._grid);
 | 
			
		||||
    LatticeGaugeField out(in.Grid());
 | 
			
		||||
    out = zero;
 | 
			
		||||
 | 
			
		||||
    for (int mu = 0; mu < Nd; mu++) {
 | 
			
		||||
      LatticeColourMatrix out_mu(in._grid);  // fundamental representation
 | 
			
		||||
      LatticeColourMatrix out_mu(in.Grid());  // fundamental representation
 | 
			
		||||
      LatticeMatrix in_mu = peekLorentz(in, mu);
 | 
			
		||||
 | 
			
		||||
      out_mu = zero;
 | 
			
		||||
 | 
			
		||||
      typename SU<ncolour>::LatticeAlgebraVector h(in._grid);
 | 
			
		||||
      typename SU<ncolour>::LatticeAlgebraVector h(in.Grid());
 | 
			
		||||
      projectOnAlgebra(h, in_mu, double(Nc + 2 * S));  // factor T(r)/T(fund)
 | 
			
		||||
      FundamentalLieAlgebraMatrix(h, out_mu);          // apply scale only once
 | 
			
		||||
      pokeLorentz(out, out_mu, mu);
 | 
			
		||||
 
 | 
			
		||||
@@ -63,7 +63,7 @@ public:
 | 
			
		||||
 | 
			
		||||
  ///////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
  void smear(GaugeField& u_smr, const GaugeField& U)const{
 | 
			
		||||
    GridBase *grid = U._grid;
 | 
			
		||||
    GridBase *grid = U.Grid();
 | 
			
		||||
    GaugeLinkField Cup(grid), tmp_stpl(grid);
 | 
			
		||||
    WilsonLoops<Gimpl> WL;
 | 
			
		||||
    u_smr = zero;
 | 
			
		||||
@@ -93,7 +93,7 @@ public:
 | 
			
		||||
    // Computing Sigma_mu, derivative of S[fat links] with respect to the thin links
 | 
			
		||||
    // Output SigmaTerm
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = U._grid;
 | 
			
		||||
    GridBase *grid = U.Grid();
 | 
			
		||||
 | 
			
		||||
    WilsonLoops<Gimpl> WL;
 | 
			
		||||
    GaugeLinkField staple(grid), u_tmp(grid);
 | 
			
		||||
 
 | 
			
		||||
@@ -81,7 +81,7 @@ private:
 | 
			
		||||
  //====================================================================
 | 
			
		||||
  GaugeField AnalyticSmearedForce(const GaugeField& SigmaKPrime,
 | 
			
		||||
                                  const GaugeField& GaugeK) const {
 | 
			
		||||
    GridBase* grid = GaugeK._grid;
 | 
			
		||||
    GridBase* grid = GaugeK.Grid();
 | 
			
		||||
    GaugeField C(grid), SigmaK(grid), iLambda(grid);
 | 
			
		||||
    GaugeLinkField iLambda_mu(grid);
 | 
			
		||||
    GaugeLinkField iQ(grid), e_iQ(grid);
 | 
			
		||||
@@ -115,7 +115,7 @@ private:
 | 
			
		||||
  void set_iLambda(GaugeLinkField& iLambda, GaugeLinkField& e_iQ,
 | 
			
		||||
                   const GaugeLinkField& iQ, const GaugeLinkField& Sigmap,
 | 
			
		||||
                   const GaugeLinkField& GaugeK) const {
 | 
			
		||||
    GridBase* grid = iQ._grid;
 | 
			
		||||
    GridBase* grid = iQ.Grid();
 | 
			
		||||
    GaugeLinkField iQ2(grid), iQ3(grid), B1(grid), B2(grid), USigmap(grid);
 | 
			
		||||
    GaugeLinkField unity(grid);
 | 
			
		||||
    unity = 1.0;
 | 
			
		||||
@@ -230,7 +230,7 @@ public:
 | 
			
		||||
  void smeared_force(GaugeField& SigmaTilde) const {
 | 
			
		||||
    if (smearingLevels > 0) {
 | 
			
		||||
      GaugeField force = SigmaTilde; // actually = U*SigmaTilde
 | 
			
		||||
      GaugeLinkField tmp_mu(SigmaTilde._grid);
 | 
			
		||||
      GaugeLinkField tmp_mu(SigmaTilde.Grid());
 | 
			
		||||
 | 
			
		||||
      for (int mu = 0; mu < Nd; mu++) {
 | 
			
		||||
        // to get just SigmaTilde
 | 
			
		||||
 
 | 
			
		||||
@@ -28,8 +28,8 @@ public:
 | 
			
		||||
  ~Smear_Stout() {}  // delete SmearBase...
 | 
			
		||||
 | 
			
		||||
  void smear(GaugeField& u_smr, const GaugeField& U) const {
 | 
			
		||||
    GaugeField C(U._grid);
 | 
			
		||||
    GaugeLinkField tmp(U._grid), iq_mu(U._grid), Umu(U._grid);
 | 
			
		||||
    GaugeField C(U.Grid());
 | 
			
		||||
    GaugeLinkField tmp(U.Grid()), iq_mu(U.Grid()), Umu(U.Grid());
 | 
			
		||||
 | 
			
		||||
    std::cout << GridLogDebug << "Stout smearing started\n";
 | 
			
		||||
 | 
			
		||||
@@ -70,7 +70,7 @@ public:
 | 
			
		||||
    // the i sign is coming from outside
 | 
			
		||||
    // input matrix is anti-hermitian NOT hermitian
 | 
			
		||||
 | 
			
		||||
    GridBase* grid = iQ._grid;
 | 
			
		||||
    GridBase* grid = iQ.Grid();
 | 
			
		||||
    GaugeLinkField unity(grid);
 | 
			
		||||
    unity = 1.0;
 | 
			
		||||
 | 
			
		||||
@@ -92,7 +92,7 @@ public:
 | 
			
		||||
    Complex one_over_three = 1.0 / 3.0;
 | 
			
		||||
    Complex one_over_two = 1.0 / 2.0;
 | 
			
		||||
 | 
			
		||||
    GridBase* grid = u._grid;
 | 
			
		||||
    GridBase* grid = u.Grid();
 | 
			
		||||
    LatticeComplex c0(grid), c1(grid), tmp(grid), c0max(grid), theta(grid);
 | 
			
		||||
 | 
			
		||||
    // sign in c0 from the conventions on the Ta
 | 
			
		||||
@@ -111,7 +111,7 @@ public:
 | 
			
		||||
 | 
			
		||||
  void set_fj(LatticeComplex& f0, LatticeComplex& f1, LatticeComplex& f2,
 | 
			
		||||
              const LatticeComplex& u, const LatticeComplex& w) const {
 | 
			
		||||
    GridBase* grid = u._grid;
 | 
			
		||||
    GridBase* grid = u.Grid();
 | 
			
		||||
    LatticeComplex xi0(grid), u2(grid), w2(grid), cosw(grid);
 | 
			
		||||
    LatticeComplex fden(grid);
 | 
			
		||||
    LatticeComplex h0(grid), h1(grid), h2(grid);
 | 
			
		||||
 
 | 
			
		||||
@@ -85,8 +85,8 @@ public:
 | 
			
		||||
////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
template <class Gimpl>
 | 
			
		||||
void WilsonFlow<Gimpl>::evolve_step(typename Gimpl::GaugeField &U) const{
 | 
			
		||||
  GaugeField Z(U._grid);
 | 
			
		||||
  GaugeField tmp(U._grid);
 | 
			
		||||
  GaugeField Z(U.Grid());
 | 
			
		||||
  GaugeField tmp(U.Grid());
 | 
			
		||||
  SG.deriv(U, Z);
 | 
			
		||||
  Z *= 0.25;                                  // Z0 = 1/4 * F(U)
 | 
			
		||||
  Gimpl::update_field(Z, U, -2.0*epsilon);    // U = W1 = exp(ep*Z0)*W0
 | 
			
		||||
@@ -108,9 +108,9 @@ void WilsonFlow<Gimpl>::evolve_step_adaptive(typename Gimpl::GaugeField &U, Real
 | 
			
		||||
    epsilon = maxTau-taus;
 | 
			
		||||
  }
 | 
			
		||||
  //std::cout << GridLogMessage << "Integration epsilon : " << epsilon << std::endl;
 | 
			
		||||
  GaugeField Z(U._grid);
 | 
			
		||||
  GaugeField Zprime(U._grid);
 | 
			
		||||
  GaugeField tmp(U._grid), Uprime(U._grid);
 | 
			
		||||
  GaugeField Z(U.Grid());
 | 
			
		||||
  GaugeField Zprime(U.Grid());
 | 
			
		||||
  GaugeField tmp(U.Grid()), Uprime(U.Grid());
 | 
			
		||||
  Uprime = U;
 | 
			
		||||
  SG.deriv(U, Z);
 | 
			
		||||
  Zprime = -Z;
 | 
			
		||||
@@ -147,12 +147,12 @@ void WilsonFlow<Gimpl>::evolve_step_adaptive(typename Gimpl::GaugeField &U, Real
 | 
			
		||||
template <class Gimpl>
 | 
			
		||||
RealD WilsonFlow<Gimpl>::energyDensityPlaquette(unsigned int step, const GaugeField& U) const {
 | 
			
		||||
  RealD td = tau(step);
 | 
			
		||||
  return 2.0 * td * td * SG.S(U)/U._grid->gSites();
 | 
			
		||||
  return 2.0 * td * td * SG.S(U)/U.Grid()->gSites();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <class Gimpl>
 | 
			
		||||
RealD WilsonFlow<Gimpl>::energyDensityPlaquette(const GaugeField& U) const {
 | 
			
		||||
  return 2.0 * taus * taus * SG.S(U)/U._grid->gSites();
 | 
			
		||||
  return 2.0 * taus * taus * SG.S(U)/U.Grid()->gSites();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -48,7 +48,7 @@ namespace PeriodicBC {
 | 
			
		||||
									    int mu,
 | 
			
		||||
									    const Lattice<covariant> &field)
 | 
			
		||||
  {
 | 
			
		||||
    Lattice<covariant> tmp(field._grid);
 | 
			
		||||
    Lattice<covariant> tmp(field.Grid());
 | 
			
		||||
    tmp = adj(Link)*field;
 | 
			
		||||
    return Cshift(tmp,mu,-1);// moves towards positive mu
 | 
			
		||||
  }
 | 
			
		||||
@@ -87,7 +87,7 @@ namespace ConjugateBC {
 | 
			
		||||
									   int mu,
 | 
			
		||||
									   const Lattice<covariant> &field)
 | 
			
		||||
  {
 | 
			
		||||
    GridBase * grid = Link._grid;
 | 
			
		||||
    GridBase * grid = Link.Grid();
 | 
			
		||||
 | 
			
		||||
    int Lmu = grid->GlobalDimensions()[mu]-1;
 | 
			
		||||
 | 
			
		||||
@@ -106,7 +106,7 @@ namespace ConjugateBC {
 | 
			
		||||
									    int mu,
 | 
			
		||||
									    const Lattice<covariant> &field)
 | 
			
		||||
  {
 | 
			
		||||
    GridBase * grid = field._grid;
 | 
			
		||||
    GridBase * grid = field.Grid();
 | 
			
		||||
 | 
			
		||||
    int Lmu = grid->GlobalDimensions()[mu]-1;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -108,14 +108,14 @@ public:
 | 
			
		||||
    //GaugeField herm = in + adj(in);
 | 
			
		||||
    //std::cout << "AHermiticity: " << norm2(herm) << std::endl;
 | 
			
		||||
 | 
			
		||||
    GaugeLinkField tmp(in._grid);
 | 
			
		||||
    GaugeLinkField tmp2(in._grid);
 | 
			
		||||
    GaugeLinkField sum(in._grid);
 | 
			
		||||
    GaugeLinkField tmp(in.Grid());
 | 
			
		||||
    GaugeLinkField tmp2(in.Grid());
 | 
			
		||||
    GaugeLinkField sum(in.Grid());
 | 
			
		||||
 | 
			
		||||
    for (int nu = 0; nu < Nd; nu++) {
 | 
			
		||||
      sum = zero;
 | 
			
		||||
      GaugeLinkField in_nu = PeekIndex<LorentzIndex>(in, nu);
 | 
			
		||||
      GaugeLinkField out_nu(out._grid);
 | 
			
		||||
      GaugeLinkField out_nu(out.Grid());
 | 
			
		||||
      for (int mu = 0; mu < Nd; mu++) {
 | 
			
		||||
        tmp = U[mu] * Cshift(in_nu, mu, +1) * adj(U[mu]);
 | 
			
		||||
        tmp2 = adj(U[mu]) * in_nu * U[mu];
 | 
			
		||||
@@ -131,7 +131,7 @@ public:
 | 
			
		||||
    RealD factor = -kappa / (double(4 * Nd));
 | 
			
		||||
    
 | 
			
		||||
    for (int mu = 0; mu < Nd; mu++){
 | 
			
		||||
      GaugeLinkField der_mu(der._grid);
 | 
			
		||||
      GaugeLinkField der_mu(der.Grid());
 | 
			
		||||
      der_mu = zero;
 | 
			
		||||
      for (int nu = 0; nu < Nd; nu++){
 | 
			
		||||
        GaugeLinkField in_nu = PeekIndex<LorentzIndex>(in, nu);
 | 
			
		||||
@@ -150,7 +150,7 @@ public:
 | 
			
		||||
    RealD factor = -kappa / (double(4 * Nd));
 | 
			
		||||
 | 
			
		||||
    for (int mu = 0; mu < Nd; mu++) {
 | 
			
		||||
      GaugeLinkField der_mu(der._grid);
 | 
			
		||||
      GaugeLinkField der_mu(der.Grid());
 | 
			
		||||
      der_mu = zero;
 | 
			
		||||
      for (int nu = 0; nu < Nd; nu++) {
 | 
			
		||||
        GaugeLinkField left_nu = PeekIndex<LorentzIndex>(left, nu);
 | 
			
		||||
@@ -168,7 +168,7 @@ public:
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void MSquareRoot(GaugeField& P){
 | 
			
		||||
    GaugeField Gp(P._grid);
 | 
			
		||||
    GaugeField Gp(P.Grid());
 | 
			
		||||
    HermitianLinearOperator<LaplacianAdjointField<Impl>,GaugeField> HermOp(*this);
 | 
			
		||||
    ConjugateGradientMultiShift<GaugeField> msCG(param.MaxIter,PowerHalf);
 | 
			
		||||
    msCG(HermOp,P,Gp);
 | 
			
		||||
@@ -176,7 +176,7 @@ public:
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void MInvSquareRoot(GaugeField& P){
 | 
			
		||||
    GaugeField Gp(P._grid);
 | 
			
		||||
    GaugeField Gp(P.Grid());
 | 
			
		||||
    HermitianLinearOperator<LaplacianAdjointField<Impl>,GaugeField> HermOp(*this);
 | 
			
		||||
    ConjugateGradientMultiShift<GaugeField> msCG(param.MaxIter,PowerInvHalf);
 | 
			
		||||
    msCG(HermOp,P,Gp);
 | 
			
		||||
 
 | 
			
		||||
@@ -52,7 +52,7 @@ public:
 | 
			
		||||
    }
 | 
			
		||||
  }  
 | 
			
		||||
  static void SteepestDescentGaugeFix(GaugeLorentz &Umu,Real & alpha,int maxiter,Real Omega_tol, Real Phi_tol,bool Fourier=false) {
 | 
			
		||||
    GridBase *grid = Umu._grid;
 | 
			
		||||
    GridBase *grid = Umu.Grid();
 | 
			
		||||
 | 
			
		||||
    Real org_plaq      =WilsonLoops<Gimpl>::avgPlaquette(Umu);
 | 
			
		||||
    Real org_link_trace=WilsonLoops<Gimpl>::linkTrace(Umu); 
 | 
			
		||||
@@ -97,7 +97,7 @@ public:
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
  static Real SteepestDescentStep(std::vector<GaugeMat> &U,Real & alpha, GaugeMat & dmuAmu) {
 | 
			
		||||
    GridBase *grid = U[0]._grid;
 | 
			
		||||
    GridBase *grid = U[0].Grid();
 | 
			
		||||
 | 
			
		||||
    std::vector<GaugeMat> A(Nd,grid);
 | 
			
		||||
    GaugeMat g(grid);
 | 
			
		||||
@@ -116,7 +116,7 @@ public:
 | 
			
		||||
 | 
			
		||||
  static Real FourierAccelSteepestDescentStep(std::vector<GaugeMat> &U,Real & alpha, GaugeMat & dmuAmu) {
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = U[0]._grid;
 | 
			
		||||
    GridBase *grid = U[0].Grid();
 | 
			
		||||
 | 
			
		||||
    Real vol = grid->gSites();
 | 
			
		||||
 | 
			
		||||
@@ -179,7 +179,7 @@ public:
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  static void ExpiAlphaDmuAmu(const std::vector<GaugeMat> &A,GaugeMat &g,Real & alpha, GaugeMat &dmuAmu) {
 | 
			
		||||
    GridBase *grid = g._grid;
 | 
			
		||||
    GridBase *grid = g.Grid();
 | 
			
		||||
    Complex cialpha(0.0,-alpha);
 | 
			
		||||
    GaugeMat ciadmam(grid);
 | 
			
		||||
    DmuAmu(A,dmuAmu);
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ void axpibg5x(Lattice<vobj> &z,const Lattice<vobj> &x,Coeff a,Coeff b)
 | 
			
		||||
  z.Checkerboard() = x.Checkerboard();
 | 
			
		||||
  conformable(x,z);
 | 
			
		||||
 | 
			
		||||
  GridBase *grid=x._grid;
 | 
			
		||||
  GridBase *grid=x.Grid();
 | 
			
		||||
 | 
			
		||||
  Gamma G5(Gamma::Algebra::Gamma5);
 | 
			
		||||
  parallel_for(int ss=0;ss<grid->oSites();ss++){
 | 
			
		||||
@@ -62,7 +62,7 @@ void axpby_ssp(Lattice<vobj> &z, Coeff a,const Lattice<vobj> &x,Coeff b,const La
 | 
			
		||||
  z.Checkerboard() = x.Checkerboard();
 | 
			
		||||
  conformable(x,y);
 | 
			
		||||
  conformable(x,z);
 | 
			
		||||
  GridBase *grid=x._grid;
 | 
			
		||||
  GridBase *grid=x.Grid();
 | 
			
		||||
  int Ls = grid->_rdimensions[0];
 | 
			
		||||
  parallel_for(int ss=0;ss<grid->oSites();ss+=Ls){ // adds Ls
 | 
			
		||||
    vobj tmp = a*x[ss+s]+b*y[ss+sp];
 | 
			
		||||
@@ -76,7 +76,7 @@ void ag5xpby_ssp(Lattice<vobj> &z,Coeff a,const Lattice<vobj> &x,Coeff b,const L
 | 
			
		||||
  z.Checkerboard() = x.Checkerboard();
 | 
			
		||||
  conformable(x,y);
 | 
			
		||||
  conformable(x,z);
 | 
			
		||||
  GridBase *grid=x._grid;
 | 
			
		||||
  GridBase *grid=x.Grid();
 | 
			
		||||
  int Ls = grid->_rdimensions[0];
 | 
			
		||||
 | 
			
		||||
  Gamma G5(Gamma::Algebra::Gamma5);
 | 
			
		||||
@@ -94,7 +94,7 @@ void axpbg5y_ssp(Lattice<vobj> &z,Coeff a,const Lattice<vobj> &x,Coeff b,const L
 | 
			
		||||
  z.Checkerboard() = x.Checkerboard();
 | 
			
		||||
  conformable(x,y);
 | 
			
		||||
  conformable(x,z);
 | 
			
		||||
  GridBase *grid=x._grid;
 | 
			
		||||
  GridBase *grid=x.Grid();
 | 
			
		||||
  int Ls = grid->_rdimensions[0];
 | 
			
		||||
  Gamma G5(Gamma::Algebra::Gamma5);
 | 
			
		||||
  parallel_for(int ss=0;ss<grid->oSites();ss+=Ls){ // adds Ls
 | 
			
		||||
@@ -111,7 +111,7 @@ void ag5xpbg5y_ssp(Lattice<vobj> &z,Coeff a,const Lattice<vobj> &x,Coeff b,const
 | 
			
		||||
  z.Checkerboard() = x.Checkerboard();
 | 
			
		||||
  conformable(x,y);
 | 
			
		||||
  conformable(x,z);
 | 
			
		||||
  GridBase *grid=x._grid;
 | 
			
		||||
  GridBase *grid=x.Grid();
 | 
			
		||||
  int Ls = grid->_rdimensions[0];
 | 
			
		||||
 | 
			
		||||
  Gamma G5(Gamma::Algebra::Gamma5);
 | 
			
		||||
@@ -130,7 +130,7 @@ void axpby_ssp_pminus(Lattice<vobj> &z,Coeff a,const Lattice<vobj> &x,Coeff b,co
 | 
			
		||||
  z.Checkerboard() = x.Checkerboard();
 | 
			
		||||
  conformable(x,y);
 | 
			
		||||
  conformable(x,z);
 | 
			
		||||
  GridBase *grid=x._grid;
 | 
			
		||||
  GridBase *grid=x.Grid();
 | 
			
		||||
  int Ls = grid->_rdimensions[0];
 | 
			
		||||
  parallel_for(int ss=0;ss<grid->oSites();ss+=Ls){ // adds Ls
 | 
			
		||||
    vobj tmp;
 | 
			
		||||
@@ -146,7 +146,7 @@ void axpby_ssp_pplus(Lattice<vobj> &z,Coeff a,const Lattice<vobj> &x,Coeff b,con
 | 
			
		||||
  z.Checkerboard() = x.Checkerboard();
 | 
			
		||||
  conformable(x,y);
 | 
			
		||||
  conformable(x,z);
 | 
			
		||||
  GridBase *grid=x._grid;
 | 
			
		||||
  GridBase *grid=x.Grid();
 | 
			
		||||
  int Ls = grid->_rdimensions[0];
 | 
			
		||||
  parallel_for(int ss=0;ss<grid->oSites();ss+=Ls){ // adds Ls
 | 
			
		||||
    vobj tmp;
 | 
			
		||||
@@ -159,7 +159,7 @@ void axpby_ssp_pplus(Lattice<vobj> &z,Coeff a,const Lattice<vobj> &x,Coeff b,con
 | 
			
		||||
template<class vobj> 
 | 
			
		||||
void G5R5(Lattice<vobj> &z,const Lattice<vobj> &x)
 | 
			
		||||
{
 | 
			
		||||
  GridBase *grid=x._grid;
 | 
			
		||||
  GridBase *grid=x.Grid();
 | 
			
		||||
  z.Checkerboard() = x.Checkerboard();
 | 
			
		||||
  conformable(x,z);
 | 
			
		||||
  int Ls = grid->_rdimensions[0];
 | 
			
		||||
 
 | 
			
		||||
@@ -107,7 +107,7 @@ public:
 | 
			
		||||
    if (1) {
 | 
			
		||||
      // Auxiliary momenta
 | 
			
		||||
      // do nothing if trivial, so hide in the metric
 | 
			
		||||
      MomentaField AuxMomTemp(Mom._grid);
 | 
			
		||||
      MomentaField AuxMomTemp(Mom.Grid());
 | 
			
		||||
      Implementation::generate_momenta(AuxMom, pRNG);
 | 
			
		||||
      Implementation::generate_momenta(AuxField, pRNG);
 | 
			
		||||
      // Modify the distribution with the metric
 | 
			
		||||
@@ -118,10 +118,10 @@ public:
 | 
			
		||||
 | 
			
		||||
  // Correct
 | 
			
		||||
  RealD MomentaAction(){
 | 
			
		||||
    MomentaField inv(Mom._grid);
 | 
			
		||||
    MomentaField inv(Mom.Grid());
 | 
			
		||||
    inv = zero;
 | 
			
		||||
    M.Minv(Mom, inv);
 | 
			
		||||
    LatticeComplex Hloc(Mom._grid);
 | 
			
		||||
    LatticeComplex Hloc(Mom.Grid());
 | 
			
		||||
    Hloc = zero;
 | 
			
		||||
    for (int mu = 0; mu < Nd; mu++) {
 | 
			
		||||
      // This is not very general
 | 
			
		||||
@@ -155,8 +155,8 @@ public:
 | 
			
		||||
 | 
			
		||||
    // Compute the derivative of the kinetic term
 | 
			
		||||
    // with respect to the gauge field
 | 
			
		||||
    MomentaField MDer(in._grid);
 | 
			
		||||
    MomentaField X(in._grid);
 | 
			
		||||
    MomentaField MDer(in.Grid());
 | 
			
		||||
    MomentaField X(in.Grid());
 | 
			
		||||
    X = zero;
 | 
			
		||||
    M.Minv(in, X);  // X = G in
 | 
			
		||||
    M.MDeriv(X, MDer);  // MDer = U * dS/dU
 | 
			
		||||
@@ -168,8 +168,8 @@ public:
 | 
			
		||||
    der = zero;
 | 
			
		||||
    if (1){
 | 
			
		||||
      // Auxiliary fields
 | 
			
		||||
      MomentaField der_temp(der._grid);
 | 
			
		||||
      MomentaField X(der._grid);
 | 
			
		||||
      MomentaField der_temp(der.Grid());
 | 
			
		||||
      MomentaField X(der.Grid());
 | 
			
		||||
      X=zero;
 | 
			
		||||
      //M.M(AuxMom, X); // X = M Aux
 | 
			
		||||
      // Two derivative terms
 | 
			
		||||
@@ -200,8 +200,8 @@ public:
 | 
			
		||||
 | 
			
		||||
  void update_auxiliary_fields(RealD ep){
 | 
			
		||||
    if (1) {
 | 
			
		||||
      MomentaField tmp(AuxMom._grid);
 | 
			
		||||
      MomentaField tmp2(AuxMom._grid);
 | 
			
		||||
      MomentaField tmp(AuxMom.Grid());
 | 
			
		||||
      MomentaField tmp2(AuxMom.Grid());
 | 
			
		||||
      M.M(AuxMom, tmp);
 | 
			
		||||
      // M.M(tmp, tmp2);
 | 
			
		||||
      AuxField += ep * tmp;  // M^2 AuxMom
 | 
			
		||||
 
 | 
			
		||||
@@ -217,7 +217,7 @@ public:
 | 
			
		||||
                         Lattice<iSU2Matrix<vcplx> > &subgroup,
 | 
			
		||||
                         const Lattice<iSUnMatrix<vcplx> > &source,
 | 
			
		||||
                         int su2_index) {
 | 
			
		||||
    GridBase *grid(source._grid);
 | 
			
		||||
    GridBase *grid(source.Grid());
 | 
			
		||||
    conformable(subgroup, source);
 | 
			
		||||
    conformable(subgroup, Determinant);
 | 
			
		||||
    int i0, i1;
 | 
			
		||||
@@ -247,7 +247,7 @@ public:
 | 
			
		||||
  template <class vcplx>
 | 
			
		||||
  static void su2Insert(const Lattice<iSU2Matrix<vcplx> > &subgroup,
 | 
			
		||||
                        Lattice<iSUnMatrix<vcplx> > &dest, int su2_index) {
 | 
			
		||||
    GridBase *grid(dest._grid);
 | 
			
		||||
    GridBase *grid(dest.Grid());
 | 
			
		||||
    conformable(subgroup, dest);
 | 
			
		||||
    int i0, i1;
 | 
			
		||||
    su2SubGroupIndex(i0, i1, su2_index);
 | 
			
		||||
@@ -277,7 +277,7 @@ public:
 | 
			
		||||
			       LatticeMatrix &link,
 | 
			
		||||
			       const LatticeMatrix &barestaple,  // multiplied by action coeffs so th
 | 
			
		||||
			       int su2_subgroup, int nheatbath, LatticeInteger &wheremask) {
 | 
			
		||||
    GridBase *grid = link._grid;
 | 
			
		||||
    GridBase *grid = link.Grid();
 | 
			
		||||
 | 
			
		||||
    const RealD twopi = 2.0 * M_PI;
 | 
			
		||||
 | 
			
		||||
@@ -604,7 +604,7 @@ public:
 | 
			
		||||
  template <typename LatticeMatrixType>
 | 
			
		||||
  static void LieRandomize(GridParallelRNG &pRNG, LatticeMatrixType &out,
 | 
			
		||||
                           double scale = 1.0) {
 | 
			
		||||
    GridBase *grid = out._grid;
 | 
			
		||||
    GridBase *grid = out.Grid();
 | 
			
		||||
 | 
			
		||||
    typedef typename LatticeMatrixType::vector_type vector_type;
 | 
			
		||||
    typedef typename LatticeMatrixType::scalar_type scalar_type;
 | 
			
		||||
@@ -641,7 +641,7 @@ public:
 | 
			
		||||
  static void GaussianFundamentalLieAlgebraMatrix(GridParallelRNG &pRNG,
 | 
			
		||||
                                                  LatticeMatrix &out,
 | 
			
		||||
                                                  Real scale = 1.0) {
 | 
			
		||||
    GridBase *grid = out._grid;
 | 
			
		||||
    GridBase *grid = out.Grid();
 | 
			
		||||
    LatticeReal ca(grid);
 | 
			
		||||
    LatticeMatrix la(grid);
 | 
			
		||||
    Complex ci(0.0, scale);
 | 
			
		||||
@@ -661,7 +661,7 @@ public:
 | 
			
		||||
                                          LatticeMatrix &out,
 | 
			
		||||
                                          Real scale = 1.0) {
 | 
			
		||||
    conformable(h, out);
 | 
			
		||||
    GridBase *grid = out._grid;
 | 
			
		||||
    GridBase *grid = out.Grid();
 | 
			
		||||
    LatticeMatrix la(grid);
 | 
			
		||||
    Matrix ta;
 | 
			
		||||
 | 
			
		||||
@@ -678,8 +678,8 @@ public:
 | 
			
		||||
 | 
			
		||||
  template<typename GaugeField,typename GaugeMat>
 | 
			
		||||
  static void GaugeTransform( GaugeField &Umu, GaugeMat &g){
 | 
			
		||||
    GridBase *grid = Umu._grid;
 | 
			
		||||
    conformable(grid,g._grid);
 | 
			
		||||
    GridBase *grid = Umu.Grid();
 | 
			
		||||
    conformable(grid,g.Grid());
 | 
			
		||||
 | 
			
		||||
    GaugeMat U(grid);
 | 
			
		||||
    GaugeMat ag(grid); ag = adj(g);
 | 
			
		||||
@@ -692,7 +692,7 @@ public:
 | 
			
		||||
  }
 | 
			
		||||
  template<typename GaugeMat>
 | 
			
		||||
  static void GaugeTransform( std::vector<GaugeMat> &U, GaugeMat &g){
 | 
			
		||||
    GridBase *grid = g._grid;
 | 
			
		||||
    GridBase *grid = g.Grid();
 | 
			
		||||
    GaugeMat ag(grid); ag = adj(g);
 | 
			
		||||
    for(int mu=0;mu<Nd;mu++){
 | 
			
		||||
      U[mu] = g*U[mu]*Cshift(ag, mu, 1);
 | 
			
		||||
@@ -724,7 +724,7 @@ public:
 | 
			
		||||
    typedef iSUnMatrix<vector_type> vMatrixType;
 | 
			
		||||
    typedef Lattice<vMatrixType> LatticeMatrixType;
 | 
			
		||||
 | 
			
		||||
    LatticeMatrixType Umu(out._grid);
 | 
			
		||||
    LatticeMatrixType Umu(out.Grid());
 | 
			
		||||
    for (int mu = 0; mu < Nd; mu++) {
 | 
			
		||||
      LieRandomize(pRNG, Umu, 1.0);
 | 
			
		||||
      PokeIndex<LorentzIndex>(out, Umu, mu);
 | 
			
		||||
@@ -736,7 +736,7 @@ public:
 | 
			
		||||
    typedef iSUnMatrix<vector_type> vMatrixType;
 | 
			
		||||
    typedef Lattice<vMatrixType> LatticeMatrixType;
 | 
			
		||||
 | 
			
		||||
    LatticeMatrixType Umu(out._grid);
 | 
			
		||||
    LatticeMatrixType Umu(out.Grid());
 | 
			
		||||
    for(int mu=0;mu<Nd;mu++){
 | 
			
		||||
      LieRandomize(pRNG,Umu,0.01);
 | 
			
		||||
      PokeIndex<LorentzIndex>(out,Umu,mu);
 | 
			
		||||
@@ -748,7 +748,7 @@ public:
 | 
			
		||||
    typedef iSUnMatrix<vector_type> vMatrixType;
 | 
			
		||||
    typedef Lattice<vMatrixType> LatticeMatrixType;
 | 
			
		||||
 | 
			
		||||
    LatticeMatrixType Umu(out._grid);
 | 
			
		||||
    LatticeMatrixType Umu(out.Grid());
 | 
			
		||||
    Umu=1.0;
 | 
			
		||||
    for(int mu=0;mu<Nd;mu++){
 | 
			
		||||
      PokeIndex<LorentzIndex>(out,Umu,mu);
 | 
			
		||||
@@ -767,7 +767,7 @@ public:
 | 
			
		||||
  static void taExp(const LatticeMatrixType &x, LatticeMatrixType &ex) {
 | 
			
		||||
    typedef typename LatticeMatrixType::scalar_type ComplexType;
 | 
			
		||||
 | 
			
		||||
    LatticeMatrixType xn(x._grid);
 | 
			
		||||
    LatticeMatrixType xn(x.Grid());
 | 
			
		||||
    RealD nfac = 1.0;
 | 
			
		||||
 | 
			
		||||
    xn = x;
 | 
			
		||||
 
 | 
			
		||||
@@ -114,7 +114,7 @@ public:
 | 
			
		||||
				      const typename SU<ncolour>::LatticeAlgebraVector &h,
 | 
			
		||||
				      LatticeAdjMatrix &out, Real scale = 1.0) {
 | 
			
		||||
    conformable(h, out);
 | 
			
		||||
    GridBase *grid = out._grid;
 | 
			
		||||
    GridBase *grid = out.Grid();
 | 
			
		||||
    LatticeAdjMatrix la(grid);
 | 
			
		||||
    AMatrix iTa;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -199,7 +199,7 @@ public:
 | 
			
		||||
				       const typename SU<ncolour>::LatticeAlgebraVector &h,
 | 
			
		||||
				       LatticeTwoIndexMatrix &out, Real scale = 1.0) {
 | 
			
		||||
    conformable(h, out);
 | 
			
		||||
    GridBase *grid = out._grid;
 | 
			
		||||
    GridBase *grid = out.Grid();
 | 
			
		||||
    LatticeTwoIndexMatrix la(grid);
 | 
			
		||||
    TIMatrix i2indTa;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -67,7 +67,7 @@ public:
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
  static RealD sumphider(const typename Impl::Field &f) {
 | 
			
		||||
    typename Impl::Field tmp(f._grid);
 | 
			
		||||
    typename Impl::Field tmp(f.Grid());
 | 
			
		||||
    tmp = Cshift(f, 0, -1) * f;
 | 
			
		||||
    for (int mu = 1; mu < Nd; mu++) {
 | 
			
		||||
      tmp += Cshift(f, mu, -1) * f;
 | 
			
		||||
@@ -76,13 +76,13 @@ public:
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  static RealD sumphisquared(const typename Impl::Field &f) {
 | 
			
		||||
    typename Impl::Field tmp(f._grid);
 | 
			
		||||
    typename Impl::Field tmp(f.Grid());
 | 
			
		||||
    tmp = f * f;
 | 
			
		||||
    return sum(trace(tmp));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  static RealD sumphifourth(const typename Impl::Field &f) {
 | 
			
		||||
    typename Impl::Field tmp(f._grid);
 | 
			
		||||
    typename Impl::Field tmp(f.Grid());
 | 
			
		||||
    phifourth(tmp, f);
 | 
			
		||||
    return sum(trace(tmp));
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -76,7 +76,7 @@ public:
 | 
			
		||||
  static void traceDirPlaquette(ComplexField &plaq,
 | 
			
		||||
                                const std::vector<GaugeMat> &U, const int mu,
 | 
			
		||||
                                const int nu) {
 | 
			
		||||
    GaugeMat sp(U[0]._grid);
 | 
			
		||||
    GaugeMat sp(U[0].Grid());
 | 
			
		||||
    dirPlaquette(sp, U, mu, nu);
 | 
			
		||||
    plaq = trace(sp);
 | 
			
		||||
  }
 | 
			
		||||
@@ -85,7 +85,7 @@ public:
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static void sitePlaquette(ComplexField &Plaq,
 | 
			
		||||
                            const std::vector<GaugeMat> &U) {
 | 
			
		||||
    ComplexField sitePlaq(U[0]._grid);
 | 
			
		||||
    ComplexField sitePlaq(U[0].Grid());
 | 
			
		||||
    Plaq = zero;
 | 
			
		||||
    for (int mu = 1; mu < Nd; mu++) {
 | 
			
		||||
      for (int nu = 0; nu < mu; nu++) {
 | 
			
		||||
@@ -98,13 +98,13 @@ public:
 | 
			
		||||
  // sum over all x,y,z,t and over all planes of plaquette
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static RealD sumPlaquette(const GaugeLorentz &Umu) {
 | 
			
		||||
    std::vector<GaugeMat> U(Nd, Umu._grid);
 | 
			
		||||
    std::vector<GaugeMat> U(Nd, Umu.Grid());
 | 
			
		||||
    // inefficient here
 | 
			
		||||
    for (int mu = 0; mu < Nd; mu++) {
 | 
			
		||||
      U[mu] = PeekIndex<LorentzIndex>(Umu, mu);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ComplexField Plaq(Umu._grid);
 | 
			
		||||
    ComplexField Plaq(Umu.Grid());
 | 
			
		||||
 | 
			
		||||
    sitePlaquette(Plaq, U);
 | 
			
		||||
    auto Tp = sum(Plaq);
 | 
			
		||||
@@ -118,7 +118,7 @@ public:
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static RealD avgPlaquette(const GaugeLorentz &Umu) {
 | 
			
		||||
    RealD sumplaq = sumPlaquette(Umu);
 | 
			
		||||
    double vol = Umu._grid->gSites();
 | 
			
		||||
    double vol = Umu.Grid()->gSites();
 | 
			
		||||
    double faces = (1.0 * Nd * (Nd - 1)) / 2.0;
 | 
			
		||||
    return sumplaq / vol / faces / Nc; // Nd , Nc dependent... FIXME
 | 
			
		||||
  }
 | 
			
		||||
@@ -127,9 +127,9 @@ public:
 | 
			
		||||
  // average over traced single links
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static RealD linkTrace(const GaugeLorentz &Umu) {
 | 
			
		||||
    std::vector<GaugeMat> U(Nd, Umu._grid);
 | 
			
		||||
    std::vector<GaugeMat> U(Nd, Umu.Grid());
 | 
			
		||||
 | 
			
		||||
    ComplexField Tr(Umu._grid);
 | 
			
		||||
    ComplexField Tr(Umu.Grid());
 | 
			
		||||
    Tr = zero;
 | 
			
		||||
    for (int mu = 0; mu < Nd; mu++) {
 | 
			
		||||
      U[mu] = PeekIndex<LorentzIndex>(Umu, mu);
 | 
			
		||||
@@ -139,7 +139,7 @@ public:
 | 
			
		||||
    auto Tp = sum(Tr);
 | 
			
		||||
    auto p = TensorRemove(Tp);
 | 
			
		||||
 | 
			
		||||
    double vol = Umu._grid->gSites();
 | 
			
		||||
    double vol = Umu.Grid()->gSites();
 | 
			
		||||
 | 
			
		||||
    return p.real() / vol / 4.0 / 3.0;
 | 
			
		||||
  };
 | 
			
		||||
@@ -150,7 +150,7 @@ public:
 | 
			
		||||
  static void Staple(GaugeMat &staple, const GaugeLorentz &Umu, int mu,
 | 
			
		||||
                     int nu) {
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = Umu._grid;
 | 
			
		||||
    GridBase *grid = Umu.Grid();
 | 
			
		||||
 | 
			
		||||
    std::vector<GaugeMat> U(Nd, grid);
 | 
			
		||||
    for (int d = 0; d < Nd; d++) {
 | 
			
		||||
@@ -191,7 +191,7 @@ public:
 | 
			
		||||
 | 
			
		||||
  // For the force term
 | 
			
		||||
  static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
 | 
			
		||||
    GridBase *grid = Umu._grid;
 | 
			
		||||
    GridBase *grid = Umu.Grid();
 | 
			
		||||
    std::vector<GaugeMat> U(Nd, grid);
 | 
			
		||||
    for (int d = 0; d < Nd; d++) {
 | 
			
		||||
      // this operation is taking too much time
 | 
			
		||||
@@ -219,7 +219,7 @@ public:
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static void Staple(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = Umu._grid;
 | 
			
		||||
    GridBase *grid = Umu.Grid();
 | 
			
		||||
 | 
			
		||||
    std::vector<GaugeMat> U(Nd, grid);
 | 
			
		||||
    for (int d = 0; d < Nd; d++) {
 | 
			
		||||
@@ -266,7 +266,7 @@ public:
 | 
			
		||||
  static void StapleUpper(GaugeMat &staple, const GaugeLorentz &Umu, int mu,
 | 
			
		||||
                          int nu) {
 | 
			
		||||
    if (nu != mu) {
 | 
			
		||||
      GridBase *grid = Umu._grid;
 | 
			
		||||
      GridBase *grid = Umu.Grid();
 | 
			
		||||
 | 
			
		||||
      std::vector<GaugeMat> U(Nd, grid);
 | 
			
		||||
      for (int d = 0; d < Nd; d++) {
 | 
			
		||||
@@ -297,7 +297,7 @@ public:
 | 
			
		||||
  static void StapleLower(GaugeMat &staple, const GaugeLorentz &Umu, int mu,
 | 
			
		||||
                          int nu) {
 | 
			
		||||
    if (nu != mu) {
 | 
			
		||||
      GridBase *grid = Umu._grid;
 | 
			
		||||
      GridBase *grid = Umu.Grid();
 | 
			
		||||
 | 
			
		||||
      std::vector<GaugeMat> U(Nd, grid);
 | 
			
		||||
      for (int d = 0; d < Nd; d++) {
 | 
			
		||||
@@ -329,7 +329,7 @@ public:
 | 
			
		||||
    //     |     |     |     |
 | 
			
		||||
    //     +--<--+     +--<--+
 | 
			
		||||
 | 
			
		||||
    GaugeMat Vup(Umu._grid), Vdn(Umu._grid);
 | 
			
		||||
    GaugeMat Vup(Umu.Grid()), Vdn(Umu.Grid());
 | 
			
		||||
    StapleUpper(Vup, Umu, mu, nu);
 | 
			
		||||
    StapleLower(Vdn, Umu, mu, nu);
 | 
			
		||||
    GaugeMat v = Vup - Vdn;
 | 
			
		||||
@@ -342,13 +342,13 @@ public:
 | 
			
		||||
    // 4d topological charge
 | 
			
		||||
    assert(Nd==4);
 | 
			
		||||
    // Bx = -iF(y,z), By = -iF(z,y), Bz = -iF(x,y)
 | 
			
		||||
    GaugeMat Bx(U._grid), By(U._grid), Bz(U._grid);
 | 
			
		||||
    GaugeMat Bx(U.Grid()), By(U.Grid()), Bz(U.Grid());
 | 
			
		||||
    FieldStrength(Bx, U, Ydir, Zdir);
 | 
			
		||||
    FieldStrength(By, U, Zdir, Xdir);
 | 
			
		||||
    FieldStrength(Bz, U, Xdir, Ydir);
 | 
			
		||||
 | 
			
		||||
    // Ex = -iF(t,x), Ey = -iF(t,y), Ez = -iF(t,z)
 | 
			
		||||
    GaugeMat Ex(U._grid), Ey(U._grid), Ez(U._grid);
 | 
			
		||||
    GaugeMat Ex(U.Grid()), Ey(U.Grid()), Ez(U.Grid());
 | 
			
		||||
    FieldStrength(Ex, U, Tdir, Xdir);
 | 
			
		||||
    FieldStrength(Ey, U, Tdir, Ydir);
 | 
			
		||||
    FieldStrength(Ez, U, Tdir, Zdir);
 | 
			
		||||
@@ -378,13 +378,13 @@ public:
 | 
			
		||||
  static void traceDirRectangle(ComplexField &rect,
 | 
			
		||||
                                const std::vector<GaugeMat> &U, const int mu,
 | 
			
		||||
                                const int nu) {
 | 
			
		||||
    GaugeMat sp(U[0]._grid);
 | 
			
		||||
    GaugeMat sp(U[0].Grid());
 | 
			
		||||
    dirRectangle(sp, U, mu, nu);
 | 
			
		||||
    rect = trace(sp);
 | 
			
		||||
  }
 | 
			
		||||
  static void siteRectangle(ComplexField &Rect,
 | 
			
		||||
                            const std::vector<GaugeMat> &U) {
 | 
			
		||||
    ComplexField siteRect(U[0]._grid);
 | 
			
		||||
    ComplexField siteRect(U[0].Grid());
 | 
			
		||||
    Rect = zero;
 | 
			
		||||
    for (int mu = 1; mu < Nd; mu++) {
 | 
			
		||||
      for (int nu = 0; nu < mu; nu++) {
 | 
			
		||||
@@ -398,13 +398,13 @@ public:
 | 
			
		||||
  // sum over all x,y,z,t and over all planes of plaquette
 | 
			
		||||
  //////////////////////////////////////////////////
 | 
			
		||||
  static RealD sumRectangle(const GaugeLorentz &Umu) {
 | 
			
		||||
    std::vector<GaugeMat> U(Nd, Umu._grid);
 | 
			
		||||
    std::vector<GaugeMat> U(Nd, Umu.Grid());
 | 
			
		||||
 | 
			
		||||
    for (int mu = 0; mu < Nd; mu++) {
 | 
			
		||||
      U[mu] = PeekIndex<LorentzIndex>(Umu, mu);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ComplexField Rect(Umu._grid);
 | 
			
		||||
    ComplexField Rect(Umu.Grid());
 | 
			
		||||
 | 
			
		||||
    siteRectangle(Rect, U);
 | 
			
		||||
 | 
			
		||||
@@ -419,7 +419,7 @@ public:
 | 
			
		||||
 | 
			
		||||
    RealD sumrect = sumRectangle(Umu);
 | 
			
		||||
 | 
			
		||||
    double vol = Umu._grid->gSites();
 | 
			
		||||
    double vol = Umu.Grid()->gSites();
 | 
			
		||||
 | 
			
		||||
    double faces = (1.0 * Nd * (Nd - 1)); // 2 distinct orientations summed
 | 
			
		||||
 | 
			
		||||
@@ -445,7 +445,7 @@ public:
 | 
			
		||||
 | 
			
		||||
    Stap = zero;
 | 
			
		||||
 | 
			
		||||
    GridBase *grid = U[0]._grid;
 | 
			
		||||
    GridBase *grid = U[0].Grid();
 | 
			
		||||
 | 
			
		||||
    GaugeMat Staple2x1(grid);
 | 
			
		||||
    GaugeMat tmp(grid);
 | 
			
		||||
@@ -522,7 +522,7 @@ public:
 | 
			
		||||
 | 
			
		||||
  static void RectStapleUnoptimised(GaugeMat &Stap, const GaugeLorentz &Umu,
 | 
			
		||||
                                    int mu) {
 | 
			
		||||
    GridBase *grid = Umu._grid;
 | 
			
		||||
    GridBase *grid = Umu.Grid();
 | 
			
		||||
 | 
			
		||||
    std::vector<GaugeMat> U(Nd, grid);
 | 
			
		||||
    for (int d = 0; d < Nd; d++) {
 | 
			
		||||
 
 | 
			
		||||
@@ -82,7 +82,7 @@ void Gather_plane_exchange_table(std::vector<std::pair<int,int> >& table,const L
 | 
			
		||||
{
 | 
			
		||||
  assert( (table.size()&0x1)==0);
 | 
			
		||||
  int num=table.size()/2;
 | 
			
		||||
  int so  = plane*rhs._grid->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
  int so  = plane*rhs.Grid()->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
  parallel_for(int j=0;j<num;j++){
 | 
			
		||||
    compress.CompressExchange(&pointers[0][0],&pointers[1][0],&rhs[0],
 | 
			
		||||
			      j,so+table[2*j].second,so+table[2*j+1].second,type);
 | 
			
		||||
@@ -141,8 +141,10 @@ public:
 | 
			
		||||
  
 | 
			
		||||
  int                               _checkerboard;
 | 
			
		||||
  int                               _npoints; // Move to template param?
 | 
			
		||||
protected:
 | 
			
		||||
  GridBase *                        _grid;
 | 
			
		||||
  
 | 
			
		||||
public: 
 | 
			
		||||
  GridBase *Grid(void) const { return _grid; }
 | 
			
		||||
  // npoints of these
 | 
			
		||||
  std::vector<int>                  _directions;
 | 
			
		||||
  std::vector<int>                  _distances;
 | 
			
		||||
@@ -436,8 +438,8 @@ public:
 | 
			
		||||
    _grid->StencilBarrier();// Synch shared memory on a single nodes
 | 
			
		||||
    mpi3synctime_g+=usecond();
 | 
			
		||||
 | 
			
		||||
    // conformable(source._grid,_grid);
 | 
			
		||||
    assert(source._grid==_grid);
 | 
			
		||||
    // conformable(source.Grid(),_grid);
 | 
			
		||||
    assert(source.Grid()==_grid);
 | 
			
		||||
    halogtime-=usecond();
 | 
			
		||||
    
 | 
			
		||||
    u_comm_offset=0;
 | 
			
		||||
@@ -864,8 +866,8 @@ public:
 | 
			
		||||
    typedef typename cobj::vector_type vector_type;
 | 
			
		||||
    typedef typename cobj::scalar_type scalar_type;
 | 
			
		||||
    
 | 
			
		||||
    assert(rhs._grid==_grid);
 | 
			
		||||
    //	  conformable(_grid,rhs._grid);
 | 
			
		||||
    assert(rhs.Grid()==_grid);
 | 
			
		||||
    //	  conformable(_grid,rhs.Grid());
 | 
			
		||||
    
 | 
			
		||||
    int fd              = _grid->_fdimensions[dimension];
 | 
			
		||||
    int rd              = _grid->_rdimensions[dimension];
 | 
			
		||||
@@ -895,7 +897,7 @@ public:
 | 
			
		||||
	
 | 
			
		||||
	int bytes =  words * compress.CommDatumSize();
 | 
			
		||||
	
 | 
			
		||||
	int so  = sx*rhs._grid->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
	int so  = sx*rhs.Grid()->_ostride[dimension]; // base offset for start of plane 
 | 
			
		||||
	if ( !face_table_computed ) {
 | 
			
		||||
	  face_table.resize(face_idx+1);
 | 
			
		||||
	  Gather_plane_table_compute ((GridBase *)_grid,dimension,sx,cbmask,u_comm_offset,face_table[face_idx]);
 | 
			
		||||
 
 | 
			
		||||
@@ -103,7 +103,7 @@ int main(int argc, char ** argv) {
 | 
			
		||||
	Bar = Cshift(Foo,dir,disp);
 | 
			
		||||
 | 
			
		||||
	// Implement a stencil code that should agree with cshift!
 | 
			
		||||
	for(int i=0;i<Check._grid->oSites();i++){
 | 
			
		||||
	for(int i=0;i<Check.Grid()->oSites();i++){
 | 
			
		||||
	  
 | 
			
		||||
	  int permute_type;
 | 
			
		||||
	  StencilEntry *SE;
 | 
			
		||||
@@ -200,7 +200,7 @@ int main(int argc, char ** argv) {
 | 
			
		||||
 | 
			
		||||
	// Implement a stencil code that should agree with that darn cshift!
 | 
			
		||||
	EStencil.HaloExchange(EFoo,compress);
 | 
			
		||||
	for(int i=0;i<OCheck._grid->oSites();i++){
 | 
			
		||||
	for(int i=0;i<OCheck.Grid()->oSites();i++){
 | 
			
		||||
	  int permute_type;
 | 
			
		||||
	  StencilEntry *SE;
 | 
			
		||||
	  SE = EStencil.GetEntry(permute_type,0,i);
 | 
			
		||||
@@ -214,7 +214,7 @@ int main(int argc, char ** argv) {
 | 
			
		||||
	    OCheck[i] = EStencil.CommBuf()[SE->_offset];
 | 
			
		||||
	}
 | 
			
		||||
	OStencil.HaloExchange(OFoo,compress);
 | 
			
		||||
	for(int i=0;i<ECheck._grid->oSites();i++){
 | 
			
		||||
	for(int i=0;i<ECheck.Grid()->oSites();i++){
 | 
			
		||||
	  int permute_type;
 | 
			
		||||
	  StencilEntry *SE;
 | 
			
		||||
	  SE = OStencil.GetEntry(permute_type,0,i);
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user