2016-06-03 11:24:26 +01:00
|
|
|
/*************************************************************************************
|
2016-01-02 14:51:32 +00:00
|
|
|
|
|
|
|
Grid physics library, www.github.com/paboyle/Grid
|
|
|
|
|
|
|
|
Source file: ./lib/qcd/action/fermion/WilsonFermion5D.cc
|
|
|
|
|
|
|
|
Copyright (C) 2015
|
|
|
|
|
|
|
|
Author: Azusa Yamaguchi <ayamaguc@staffmail.ed.ac.uk>
|
|
|
|
Author: Peter Boyle <pabobyle@ph.ed.ac.uk>
|
|
|
|
Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
|
|
|
Author: Peter Boyle <peterboyle@Peters-MacBook-Pro-2.local>
|
|
|
|
Author: paboyle <paboyle@ph.ed.ac.uk>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
|
|
|
See the full license in the file "LICENSE" in the top level distribution directory
|
|
|
|
*************************************************************************************/
|
|
|
|
/* END LEGAL */
|
2015-05-31 15:09:02 +01:00
|
|
|
#include <Grid.h>
|
2015-11-06 11:47:14 +00:00
|
|
|
#include <PerfCount.h>
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
namespace Grid {
|
|
|
|
namespace QCD {
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
// S-direction is INNERMOST and takes no part in the parity.
|
|
|
|
const std::vector<int> WilsonFermion5DStatic::directions ({1,2,3,4, 1, 2, 3, 4});
|
|
|
|
const std::vector<int> WilsonFermion5DStatic::displacements({1,1,1,1,-1,-1,-1,-1});
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
// 5d lattice for DWF.
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
|
|
|
WilsonFermion5D<Impl>::WilsonFermion5D(GaugeField &_Umu,
|
|
|
|
GridCartesian &FiveDimGrid,
|
|
|
|
GridRedBlackCartesian &FiveDimRedBlackGrid,
|
|
|
|
GridCartesian &FourDimGrid,
|
|
|
|
GridRedBlackCartesian &FourDimRedBlackGrid,
|
2015-08-15 23:25:49 +01:00
|
|
|
RealD _M5,const ImplParams &p) :
|
|
|
|
Kernels(p),
|
2015-05-31 15:09:02 +01:00
|
|
|
_FiveDimGrid(&FiveDimGrid),
|
|
|
|
_FiveDimRedBlackGrid(&FiveDimRedBlackGrid),
|
|
|
|
_FourDimGrid(&FourDimGrid),
|
|
|
|
_FourDimRedBlackGrid(&FourDimRedBlackGrid),
|
|
|
|
Stencil (_FiveDimGrid,npoint,Even,directions,displacements),
|
|
|
|
StencilEven(_FiveDimRedBlackGrid,npoint,Even,directions,displacements), // source is Even
|
|
|
|
StencilOdd (_FiveDimRedBlackGrid,npoint,Odd ,directions,displacements), // source is Odd
|
2015-06-02 16:57:12 +01:00
|
|
|
M5(_M5),
|
2015-05-31 15:09:02 +01:00
|
|
|
Umu(_FourDimGrid),
|
|
|
|
UmuEven(_FourDimRedBlackGrid),
|
|
|
|
UmuOdd (_FourDimRedBlackGrid),
|
|
|
|
Lebesgue(_FourDimGrid),
|
|
|
|
LebesgueEvenOdd(_FourDimRedBlackGrid)
|
|
|
|
{
|
|
|
|
// some assertions
|
|
|
|
assert(FiveDimGrid._ndimension==5);
|
|
|
|
assert(FourDimGrid._ndimension==4);
|
|
|
|
assert(FiveDimRedBlackGrid._ndimension==5);
|
|
|
|
assert(FourDimRedBlackGrid._ndimension==4);
|
|
|
|
assert(FiveDimRedBlackGrid._checker_dim==1);
|
|
|
|
|
|
|
|
// Dimension zero of the five-d is the Ls direction
|
|
|
|
Ls=FiveDimGrid._fdimensions[0];
|
|
|
|
assert(FiveDimRedBlackGrid._fdimensions[0]==Ls);
|
|
|
|
assert(FiveDimRedBlackGrid._processors[0] ==1);
|
|
|
|
assert(FiveDimRedBlackGrid._simd_layout[0]==1);
|
|
|
|
assert(FiveDimGrid._processors[0] ==1);
|
|
|
|
assert(FiveDimGrid._simd_layout[0] ==1);
|
|
|
|
|
|
|
|
// Other dimensions must match the decomposition of the four-D fields
|
|
|
|
for(int d=0;d<4;d++){
|
|
|
|
assert(FourDimRedBlackGrid._fdimensions[d] ==FourDimGrid._fdimensions[d]);
|
|
|
|
assert(FiveDimRedBlackGrid._fdimensions[d+1]==FourDimGrid._fdimensions[d]);
|
|
|
|
|
|
|
|
assert(FourDimRedBlackGrid._processors[d] ==FourDimGrid._processors[d]);
|
|
|
|
assert(FiveDimRedBlackGrid._processors[d+1] ==FourDimGrid._processors[d]);
|
|
|
|
|
|
|
|
assert(FourDimRedBlackGrid._simd_layout[d] ==FourDimGrid._simd_layout[d]);
|
|
|
|
assert(FiveDimRedBlackGrid._simd_layout[d+1]==FourDimGrid._simd_layout[d]);
|
|
|
|
|
|
|
|
assert(FiveDimGrid._fdimensions[d+1] ==FourDimGrid._fdimensions[d]);
|
|
|
|
assert(FiveDimGrid._processors[d+1] ==FourDimGrid._processors[d]);
|
|
|
|
assert(FiveDimGrid._simd_layout[d+1] ==FourDimGrid._simd_layout[d]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Allocate the required comms buffer
|
2015-07-29 09:53:39 +01:00
|
|
|
ImportGauge(_Umu);
|
2016-01-11 00:54:27 +00:00
|
|
|
alltime=0;
|
2015-11-06 11:30:17 +00:00
|
|
|
commtime=0;
|
2016-01-04 14:42:16 +00:00
|
|
|
jointime=0;
|
2015-11-06 11:30:17 +00:00
|
|
|
dslashtime=0;
|
2016-01-10 19:20:16 +00:00
|
|
|
dslash1time=0;
|
2015-07-29 09:53:39 +01:00
|
|
|
}
|
2016-04-19 23:38:01 +01:00
|
|
|
|
|
|
|
template<class Impl>
|
|
|
|
WilsonFermion5D<Impl>::WilsonFermion5D(int simd, GaugeField &_Umu,
|
|
|
|
GridCartesian &FiveDimGrid,
|
|
|
|
GridRedBlackCartesian &FiveDimRedBlackGrid,
|
|
|
|
GridCartesian &FourDimGrid,
|
|
|
|
GridRedBlackCartesian &FourDimRedBlackGrid,
|
|
|
|
RealD _M5,const ImplParams &p) :
|
|
|
|
Kernels(p),
|
|
|
|
_FiveDimGrid (&FiveDimGrid),
|
|
|
|
_FiveDimRedBlackGrid(&FiveDimRedBlackGrid),
|
|
|
|
_FourDimGrid (&FourDimGrid),
|
|
|
|
_FourDimRedBlackGrid(&FourDimRedBlackGrid),
|
|
|
|
Stencil (_FiveDimGrid,npoint,Even,directions,displacements),
|
|
|
|
StencilEven(_FiveDimRedBlackGrid,npoint,Even,directions,displacements), // source is Even
|
|
|
|
StencilOdd (_FiveDimRedBlackGrid,npoint,Odd ,directions,displacements), // source is Odd
|
|
|
|
M5(_M5),
|
|
|
|
Umu(_FourDimGrid),
|
|
|
|
UmuEven(_FourDimRedBlackGrid),
|
|
|
|
UmuOdd (_FourDimRedBlackGrid),
|
|
|
|
Lebesgue(_FourDimGrid),
|
|
|
|
LebesgueEvenOdd(_FourDimRedBlackGrid)
|
|
|
|
{
|
|
|
|
int nsimd = Simd::Nsimd();
|
|
|
|
|
|
|
|
// some assertions
|
|
|
|
assert(FiveDimGrid._ndimension==5);
|
|
|
|
assert(FiveDimRedBlackGrid._ndimension==5);
|
|
|
|
assert(FiveDimRedBlackGrid._checker_dim==0); // Checkerboard the s-direction
|
|
|
|
assert(FourDimGrid._ndimension==4);
|
|
|
|
assert(FourDimRedBlackGrid._ndimension==4);
|
|
|
|
|
|
|
|
// Dimension zero of the five-d is the Ls direction
|
|
|
|
Ls=FiveDimGrid._fdimensions[0];
|
|
|
|
assert(FiveDimGrid._processors[0] ==1);
|
|
|
|
assert(FiveDimGrid._simd_layout[0] ==nsimd);
|
|
|
|
|
|
|
|
assert(FiveDimRedBlackGrid._fdimensions[0]==Ls);
|
|
|
|
assert(FiveDimRedBlackGrid._processors[0] ==1);
|
|
|
|
assert(FiveDimRedBlackGrid._simd_layout[0]==nsimd);
|
|
|
|
|
|
|
|
// Other dimensions must match the decomposition of the four-D fields
|
|
|
|
for(int d=0;d<4;d++){
|
|
|
|
assert(FourDimRedBlackGrid._fdimensions[d] ==FourDimGrid._fdimensions[d]);
|
|
|
|
assert(FiveDimRedBlackGrid._fdimensions[d+1]==FourDimGrid._fdimensions[d]);
|
|
|
|
|
|
|
|
assert(FourDimRedBlackGrid._processors[d] ==FourDimGrid._processors[d]);
|
|
|
|
assert(FiveDimRedBlackGrid._processors[d+1] ==FourDimGrid._processors[d]);
|
|
|
|
|
|
|
|
assert(FourDimGrid._simd_layout[d]=1);
|
|
|
|
assert(FourDimRedBlackGrid._simd_layout[d] ==1);
|
|
|
|
assert(FourDimRedBlackGrid._simd_layout[d] ==1);
|
|
|
|
assert(FiveDimRedBlackGrid._simd_layout[d+1]==1);
|
|
|
|
|
|
|
|
assert(FiveDimGrid._fdimensions[d+1] ==FourDimGrid._fdimensions[d]);
|
|
|
|
assert(FiveDimGrid._processors[d+1] ==FourDimGrid._processors[d]);
|
|
|
|
assert(FiveDimGrid._simd_layout[d+1] ==FourDimGrid._simd_layout[d]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Allocate the required comms buffer
|
|
|
|
ImportGauge(_Umu);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
|
|
|
void WilsonFermion5D<Impl>::ImportGauge(const GaugeField &_Umu)
|
2015-07-29 09:53:39 +01:00
|
|
|
{
|
2016-04-19 23:38:01 +01:00
|
|
|
GaugeField HUmu(_Umu._grid);
|
|
|
|
HUmu = _Umu*(-0.5);
|
2016-02-15 22:02:36 +00:00
|
|
|
Impl::DoubleStore(GaugeGrid(),Umu,HUmu);
|
2015-05-31 15:09:02 +01:00
|
|
|
pickCheckerboard(Even,UmuEven,Umu);
|
|
|
|
pickCheckerboard(Odd ,UmuOdd,Umu);
|
|
|
|
}
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
|
|
|
void WilsonFermion5D<Impl>::DhopDir(const FermionField &in, FermionField &out,int dir5,int disp)
|
2015-06-08 12:04:59 +01:00
|
|
|
{
|
2015-06-09 22:41:59 +01:00
|
|
|
int dir = dir5-1; // Maps to the ordering above in "directions" that is passed to stencil
|
|
|
|
// we drop off the innermost fifth dimension
|
2015-06-22 12:49:44 +01:00
|
|
|
// assert( (disp==1)||(disp==-1) );
|
|
|
|
// assert( (dir>=0)&&(dir<4) ); //must do x,y,z or t;
|
2015-06-08 12:04:59 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
Compressor compressor(DaggerNo);
|
2016-01-10 19:20:16 +00:00
|
|
|
Stencil.HaloExchange(in,compressor);
|
2015-06-08 12:04:59 +01:00
|
|
|
|
|
|
|
int skip = (disp==1) ? 0 : 1;
|
|
|
|
|
|
|
|
int dirdisp = dir+skip*4;
|
2015-12-15 23:14:12 +00:00
|
|
|
int gamma = dir+(1-skip)*4;
|
2015-06-08 12:04:59 +01:00
|
|
|
|
2015-06-09 10:26:19 +01:00
|
|
|
assert(dirdisp<=7);
|
|
|
|
assert(dirdisp>=0);
|
|
|
|
|
2015-07-23 17:31:13 +01:00
|
|
|
PARALLEL_FOR_LOOP
|
2015-06-08 12:04:59 +01:00
|
|
|
for(int ss=0;ss<Umu._grid->oSites();ss++){
|
|
|
|
for(int s=0;s<Ls;s++){
|
|
|
|
int sU=ss;
|
|
|
|
int sF = s+Ls*sU;
|
2016-01-10 19:20:16 +00:00
|
|
|
Kernels::DiracOptDhopDir(Stencil,Umu,Stencil.comm_buf,sF,sU,in,out,dirdisp,gamma);
|
2015-06-08 12:04:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
2015-11-06 11:30:17 +00:00
|
|
|
void WilsonFermion5D<Impl>::DerivInternal(StencilImpl & st,
|
2015-08-15 23:25:49 +01:00
|
|
|
DoubledGaugeField & U,
|
|
|
|
GaugeField &mat,
|
|
|
|
const FermionField &A,
|
|
|
|
const FermionField &B,
|
|
|
|
int dag)
|
2015-07-26 02:54:38 +01:00
|
|
|
{
|
|
|
|
assert((dag==DaggerNo) ||(dag==DaggerYes));
|
|
|
|
|
2015-08-01 14:06:07 +01:00
|
|
|
conformable(st._grid,A._grid);
|
|
|
|
conformable(st._grid,B._grid);
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
Compressor compressor(dag);
|
2015-07-26 02:54:38 +01:00
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
FermionField Btilde(B._grid);
|
|
|
|
FermionField Atilde(B._grid);
|
2015-07-26 02:54:38 +01:00
|
|
|
|
2016-01-10 19:20:16 +00:00
|
|
|
st.HaloExchange(B,compressor);
|
2015-07-31 21:58:35 +01:00
|
|
|
|
|
|
|
Atilde=A;
|
|
|
|
|
2015-07-26 02:54:38 +01:00
|
|
|
for(int mu=0;mu<Nd;mu++){
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// Flip gamma if dag
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
int gamma = mu;
|
2015-12-15 23:14:12 +00:00
|
|
|
if ( !dag ) gamma+= Nd;
|
2015-07-26 02:54:38 +01:00
|
|
|
|
|
|
|
////////////////////////
|
|
|
|
// Call the single hop
|
|
|
|
////////////////////////
|
2015-07-31 21:58:35 +01:00
|
|
|
|
2015-07-26 02:54:38 +01:00
|
|
|
PARALLEL_FOR_LOOP
|
2015-08-01 14:06:07 +01:00
|
|
|
for(int sss=0;sss<U._grid->oSites();sss++){
|
2015-07-26 02:54:38 +01:00
|
|
|
for(int s=0;s<Ls;s++){
|
|
|
|
int sU=sss;
|
|
|
|
int sF = s+Ls*sU;
|
2015-08-01 14:06:07 +01:00
|
|
|
|
|
|
|
assert ( sF< B._grid->oSites());
|
|
|
|
assert ( sU< U._grid->oSites());
|
|
|
|
|
2016-01-10 19:20:16 +00:00
|
|
|
Kernels::DiracOptDhopDir(st,U,st.comm_buf,sF,sU,B,Btilde,mu,gamma);
|
2015-07-26 02:54:38 +01:00
|
|
|
|
|
|
|
////////////////////////////
|
|
|
|
// spin trace outer product
|
|
|
|
////////////////////////////
|
2015-07-31 21:58:35 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-08-15 23:25:49 +01:00
|
|
|
Impl::InsertForce5D(mat,Btilde,Atilde,mu);
|
2015-07-26 02:54:38 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
|
|
|
void WilsonFermion5D<Impl>::DhopDeriv( GaugeField &mat,
|
|
|
|
const FermionField &A,
|
|
|
|
const FermionField &B,
|
|
|
|
int dag)
|
2015-07-26 02:54:38 +01:00
|
|
|
{
|
|
|
|
conformable(A._grid,FermionGrid());
|
|
|
|
conformable(A._grid,B._grid);
|
|
|
|
conformable(GaugeGrid(),mat._grid);
|
|
|
|
|
|
|
|
mat.checkerboard = A.checkerboard;
|
|
|
|
|
|
|
|
DerivInternal(Stencil,Umu,mat,A,B,dag);
|
|
|
|
}
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
|
|
|
void WilsonFermion5D<Impl>::DhopDerivEO(GaugeField &mat,
|
|
|
|
const FermionField &A,
|
|
|
|
const FermionField &B,
|
|
|
|
int dag)
|
2015-07-26 02:54:38 +01:00
|
|
|
{
|
|
|
|
conformable(A._grid,FermionRedBlackGrid());
|
|
|
|
conformable(GaugeRedBlackGrid(),mat._grid);
|
|
|
|
conformable(A._grid,B._grid);
|
|
|
|
|
|
|
|
assert(B.checkerboard==Odd);
|
|
|
|
assert(A.checkerboard==Even);
|
|
|
|
mat.checkerboard = Even;
|
|
|
|
|
|
|
|
DerivInternal(StencilOdd,UmuEven,mat,A,B,dag);
|
|
|
|
}
|
|
|
|
|
2015-11-06 11:30:17 +00:00
|
|
|
|
|
|
|
template<class Impl>
|
|
|
|
void WilsonFermion5D<Impl>::Report(void)
|
|
|
|
{
|
2016-06-03 11:24:26 +01:00
|
|
|
return;
|
|
|
|
#if 0
|
2016-01-11 00:54:27 +00:00
|
|
|
std::cout<<GridLogMessage << "******************** WilsonFermion"<<std::endl;
|
|
|
|
std::cout<<GridLogMessage << "Wilson5d time "<<alltime <<" us"<<std::endl;
|
|
|
|
std::cout<<GridLogMessage << "HaloBegin time "<<commtime <<" us"<<std::endl;
|
|
|
|
std::cout<<GridLogMessage << "Dslash time "<<dslashtime<<" us"<<std::endl;
|
|
|
|
std::cout<<GridLogMessage << "Dslash1 time "<<dslash1time<<" us"<<std::endl;
|
|
|
|
std::cout<<GridLogMessage << "HaloComplete time "<<jointime<<" us"<<std::endl;
|
|
|
|
std::cout<<GridLogMessage << "******************** Stencil"<<std::endl;
|
|
|
|
std::cout<<GridLogMessage << "Stencil all gather time "<<Stencil.halogtime<<" us"<<std::endl;
|
|
|
|
std::cout<<GridLogMessage << "Stencil nosplice gather time "<<Stencil.nosplicetime<<" us"<<std::endl;
|
|
|
|
std::cout<<GridLogMessage << "Stencil splice gather time "<<Stencil.splicetime<<" us"<<std::endl;
|
2015-11-06 11:30:17 +00:00
|
|
|
std::cout<<GridLogMessage << "********************"<<std::endl;
|
2016-01-11 00:54:27 +00:00
|
|
|
std::cout<<GridLogMessage << "Stencil gather "<<Stencil.gathertime<<" us"<<std::endl;
|
|
|
|
std::cout<<GridLogMessage << "Stencil gather simd "<<Stencil.gathermtime<<" us"<<std::endl;
|
|
|
|
std::cout<<GridLogMessage << "Stencil merge simd "<<Stencil.mergetime<<" us"<<std::endl;
|
2016-01-11 14:34:22 +00:00
|
|
|
std::cout<<GridLogMessage << "Stencil spin simd "<<Stencil.spintime<<" us"<<std::endl;
|
2015-11-06 11:30:17 +00:00
|
|
|
std::cout<<GridLogMessage << "********************"<<std::endl;
|
2016-01-11 14:34:22 +00:00
|
|
|
std::cout<<GridLogMessage << "Stencil MB/s "<<(double)Stencil.comms_bytes/Stencil.commtime<<std::endl;
|
2016-01-11 00:54:27 +00:00
|
|
|
std::cout<<GridLogMessage << "Stencil comm time "<<Stencil.commtime<<" us"<<std::endl;
|
|
|
|
std::cout<<GridLogMessage << "Stencil join time "<<Stencil.jointime<<" us"<<std::endl;
|
2015-11-06 11:30:17 +00:00
|
|
|
std::cout<<GridLogMessage << "********************"<<std::endl;
|
2016-06-03 11:24:26 +01:00
|
|
|
#endif
|
2015-11-06 11:30:17 +00:00
|
|
|
}
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
|
|
|
void WilsonFermion5D<Impl>::DhopDerivOE(GaugeField &mat,
|
|
|
|
const FermionField &A,
|
|
|
|
const FermionField &B,
|
2015-07-26 02:54:38 +01:00
|
|
|
int dag)
|
|
|
|
{
|
|
|
|
conformable(A._grid,FermionRedBlackGrid());
|
|
|
|
conformable(GaugeRedBlackGrid(),mat._grid);
|
|
|
|
conformable(A._grid,B._grid);
|
|
|
|
|
|
|
|
assert(B.checkerboard==Even);
|
|
|
|
assert(A.checkerboard==Odd);
|
|
|
|
mat.checkerboard = Odd;
|
|
|
|
|
|
|
|
DerivInternal(StencilEven,UmuOdd,mat,A,B,dag);
|
|
|
|
}
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
2015-11-06 11:30:17 +00:00
|
|
|
void WilsonFermion5D<Impl>::DhopInternal(StencilImpl & st, LebesgueOrder &lo,
|
2015-08-10 20:47:44 +01:00
|
|
|
DoubledGaugeField & U,
|
|
|
|
const FermionField &in, FermionField &out,int dag)
|
2015-05-31 15:09:02 +01:00
|
|
|
{
|
2015-06-22 12:49:44 +01:00
|
|
|
// assert((dag==DaggerNo) ||(dag==DaggerYes));
|
2016-01-11 00:54:27 +00:00
|
|
|
alltime-=usecond();
|
2015-08-10 20:47:44 +01:00
|
|
|
Compressor compressor(dag);
|
2015-05-31 15:09:02 +01:00
|
|
|
|
2016-04-19 23:38:01 +01:00
|
|
|
int LLs = in._grid->_rdimensions[0];
|
2015-11-06 11:47:14 +00:00
|
|
|
|
2015-11-06 11:30:17 +00:00
|
|
|
commtime -=usecond();
|
2016-04-30 00:49:18 +01:00
|
|
|
st.HaloExchange(in,compressor);
|
2015-11-06 11:30:17 +00:00
|
|
|
commtime +=usecond();
|
2016-01-04 14:42:16 +00:00
|
|
|
|
|
|
|
jointime -=usecond();
|
|
|
|
jointime +=usecond();
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
// Dhop takes the 4d grid from U, and makes a 5d index for fermion
|
2015-11-06 11:30:17 +00:00
|
|
|
dslashtime -=usecond();
|
2015-05-31 15:09:02 +01:00
|
|
|
if ( dag == DaggerYes ) {
|
2015-06-30 15:03:11 +01:00
|
|
|
PARALLEL_FOR_LOOP
|
2016-06-03 11:24:26 +01:00
|
|
|
for(int ss=0;ss<U._grid->oSites();ss++){
|
|
|
|
for(int s=0;s<LLs;s++){
|
|
|
|
int sU=ss;
|
|
|
|
int sF=s+LLs*sU;
|
|
|
|
Kernels::DiracOptDhopSiteDag(st,U,st.comm_buf,sF,sU,in,out);
|
2015-05-31 15:09:02 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2016-06-03 11:47:54 +01:00
|
|
|
PARALLEL_FOR_LOOP
|
2016-06-03 11:24:26 +01:00
|
|
|
for(int ss=0;ss<U._grid->oSites();ss++){
|
|
|
|
int sU=lo.Reorder(ss);
|
|
|
|
int sF=LLs*sU;
|
|
|
|
for(int s=0;s<LLs;s++){
|
|
|
|
Kernels::DiracOptDhopSite(st,U,st.comm_buf,sF,sU,in,out);
|
|
|
|
sF++;
|
2016-04-06 10:32:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dslashtime +=usecond();
|
|
|
|
alltime+=usecond();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
|
|
|
void WilsonFermion5D<Impl>::DhopOE(const FermionField &in, FermionField &out,int dag)
|
2015-05-31 15:09:02 +01:00
|
|
|
{
|
|
|
|
conformable(in._grid,FermionRedBlackGrid()); // verifies half grid
|
|
|
|
conformable(in._grid,out._grid); // drops the cb check
|
|
|
|
|
|
|
|
assert(in.checkerboard==Even);
|
|
|
|
out.checkerboard = Odd;
|
|
|
|
|
2016-01-04 14:18:40 +00:00
|
|
|
DhopInternal(StencilEven,LebesgueEvenOdd,UmuOdd,in,out,dag);
|
2015-05-31 15:09:02 +01:00
|
|
|
}
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
|
|
|
void WilsonFermion5D<Impl>::DhopEO(const FermionField &in, FermionField &out,int dag)
|
2015-05-31 15:09:02 +01:00
|
|
|
{
|
|
|
|
conformable(in._grid,FermionRedBlackGrid()); // verifies half grid
|
|
|
|
conformable(in._grid,out._grid); // drops the cb check
|
|
|
|
|
|
|
|
assert(in.checkerboard==Odd);
|
|
|
|
out.checkerboard = Even;
|
|
|
|
|
2016-01-04 14:18:40 +00:00
|
|
|
DhopInternal(StencilOdd,LebesgueEvenOdd,UmuEven,in,out,dag);
|
2015-05-31 15:09:02 +01:00
|
|
|
}
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
|
|
|
void WilsonFermion5D<Impl>::Dhop(const FermionField &in, FermionField &out,int dag)
|
2015-05-31 15:09:02 +01:00
|
|
|
{
|
|
|
|
conformable(in._grid,FermionGrid()); // verifies full grid
|
|
|
|
conformable(in._grid,out._grid);
|
|
|
|
|
|
|
|
out.checkerboard = in.checkerboard;
|
|
|
|
|
2016-01-04 14:18:40 +00:00
|
|
|
DhopInternal(Stencil,Lebesgue,Umu,in,out,dag);
|
2015-05-31 15:09:02 +01:00
|
|
|
}
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class Impl>
|
|
|
|
void WilsonFermion5D<Impl>::DW(const FermionField &in, FermionField &out,int dag)
|
2015-06-02 16:57:12 +01:00
|
|
|
{
|
|
|
|
out.checkerboard=in.checkerboard;
|
|
|
|
Dhop(in,out,dag); // -0.5 is included
|
|
|
|
axpy(out,4.0-M5,in,out);
|
|
|
|
}
|
2015-08-10 20:47:44 +01:00
|
|
|
|
|
|
|
FermOpTemplateInstantiate(WilsonFermion5D);
|
2015-12-07 07:04:57 +00:00
|
|
|
GparityFermOpTemplateInstantiate(WilsonFermion5D);
|
2016-04-19 23:38:01 +01:00
|
|
|
template class WilsonFermion5D<DomainWallRedBlack5dImplF>;
|
|
|
|
template class WilsonFermion5D<DomainWallRedBlack5dImplD>;
|
2016-06-03 11:24:26 +01:00
|
|
|
|
2015-06-20 14:22:29 +01:00
|
|
|
}}
|
2015-05-31 15:09:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
|