1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

GB/s output

This commit is contained in:
ferben 2020-05-20 12:26:57 +01:00
parent 1f154fe652
commit 6c6812a5ca

View File

@ -46,7 +46,7 @@ public:
typedef typename SpinMatrixField::vector_object sobj; typedef typename SpinMatrixField::vector_object sobj;
static const int epsilon[6][3] ; static const int epsilon[6][3] ;
static const Complex epsilon_sgn[6]; static const Real epsilon_sgn[6];
private: private:
template <class mobj, class robj> template <class mobj, class robj>
@ -151,13 +151,16 @@ public:
template <class FImpl> template <class FImpl>
const int BaryonUtils<FImpl>::epsilon[6][3] = {{0,1,2},{1,2,0},{2,0,1},{0,2,1},{2,1,0},{1,0,2}}; const int BaryonUtils<FImpl>::epsilon[6][3] = {{0,1,2},{1,2,0},{2,0,1},{0,2,1},{2,1,0},{1,0,2}};
template <class FImpl> /*template <class FImpl>
const Complex BaryonUtils<FImpl>::epsilon_sgn[6] = {Complex(1), const Complex BaryonUtils<FImpl>::epsilon_sgn[6] = {Complex(1),
Complex(1), Complex(1),
Complex(1), Complex(1),
Complex(-1), Complex(-1),
Complex(-1), Complex(-1),
Complex(-1)}; Complex(-1)};
*/
template <class FImpl>
const Real BaryonUtils<FImpl>::epsilon_sgn[6] = {1.,1.,1.,-1.,-1.,-1.};
//This is the old version //This is the old version
template <class FImpl> template <class FImpl>
@ -175,12 +178,10 @@ void BaryonUtils<FImpl>::baryon_site(const mobj &D1,
{ {
Gamma g4(Gamma::Algebra::GammaT); //needed for parity P_\pm = 0.5*(1 \pm \gamma_4) Gamma g4(Gamma::Algebra::GammaT); //needed for parity P_\pm = 0.5*(1 \pm \gamma_4)
auto gD1a = GammaA_left * GammaA_right * D1; auto gD1a = GammaA_left * GammaA_right * D1;
auto gD1b = GammaA_left * g4 * GammaA_right * D1; auto gD1b = GammaA_left * g4 * GammaA_right * D1;
auto pD1 = 0.5* (gD1a + (double)parity * gD1b); auto pD1 = 0.5* (gD1a + (Real)parity * gD1b);
auto gD3 = GammaB_right * D3; auto gD3 = GammaB_right * D3;
auto D2g = D2 * GammaB_left; auto D2g = D2 * GammaB_left;
auto pD1g = pD1 * GammaB_left; auto pD1g = pD1 * GammaB_left;
auto gD3g = gD3 * GammaB_left; auto gD3g = gD3 * GammaB_left;
@ -193,7 +194,7 @@ void BaryonUtils<FImpl>::baryon_site(const mobj &D1,
int a_right = epsilon[ie_right][0]; //a' int a_right = epsilon[ie_right][0]; //a'
int b_right = epsilon[ie_right][1]; //b' int b_right = epsilon[ie_right][1]; //b'
int c_right = epsilon[ie_right][2]; //c' int c_right = epsilon[ie_right][2]; //c'
Complex ee = epsilon_sgn[ie_left] * epsilon_sgn[ie_right]; Real ee = epsilon_sgn[ie_left] * epsilon_sgn[ie_right];
//This is the \delta_{456}^{123} part //This is the \delta_{456}^{123} part
if (wick_contraction[0]){ if (wick_contraction[0]){
for (int gamma_left=0; gamma_left<Ns; gamma_left++){ for (int gamma_left=0; gamma_left<Ns; gamma_left++){
@ -203,7 +204,8 @@ void BaryonUtils<FImpl>::baryon_site(const mobj &D1,
auto D2g_ab = D2g()(alpha_right,beta_left)(a_right,a_left); auto D2g_ab = D2g()(alpha_right,beta_left)(a_right,a_left);
auto gD3_ab = gD3()(alpha_right,beta_left)(b_right,b_left); auto gD3_ab = gD3()(alpha_right,beta_left)(b_right,b_left);
result()()() += eepD1*D2g_ab*gD3_ab; result()()() += eepD1*D2g_ab*gD3_ab;
}}} }}
}
} }
//This is the \delta_{456}^{231} part //This is the \delta_{456}^{231} part
if (wick_contraction[1]){ if (wick_contraction[1]){
@ -214,7 +216,8 @@ void BaryonUtils<FImpl>::baryon_site(const mobj &D1,
auto eepD1g_gb = ee * pD1g()(gamma_left,beta_left)(c_right,a_left); auto eepD1g_gb = ee * pD1g()(gamma_left,beta_left)(c_right,a_left);
auto D2_ab = D2()(alpha_right,beta_left)(a_right,b_left); auto D2_ab = D2()(alpha_right,beta_left)(a_right,b_left);
result()()() += eepD1g_gb*D2_ab*gD3_ag; result()()() += eepD1g_gb*D2_ab*gD3_ag;
}}} }
}}
} }
//This is the \delta_{456}^{312} part //This is the \delta_{456}^{312} part
if (wick_contraction[2]){ if (wick_contraction[2]){
@ -225,7 +228,8 @@ void BaryonUtils<FImpl>::baryon_site(const mobj &D1,
auto eepD1_gb = ee * pD1()(gamma_left,beta_left)(c_right,b_left); auto eepD1_gb = ee * pD1()(gamma_left,beta_left)(c_right,b_left);
auto gD3g_ab = gD3g()(alpha_right,beta_left)(b_right,a_left); auto gD3g_ab = gD3g()(alpha_right,beta_left)(b_right,a_left);
result()()() += eepD1_gb*D2_ag*gD3g_ab; result()()() += eepD1_gb*D2_ag*gD3g_ab;
}}} }
}}
} }
//This is the \delta_{456}^{132} part //This is the \delta_{456}^{132} part
if (wick_contraction[3]){ if (wick_contraction[3]){
@ -236,7 +240,8 @@ void BaryonUtils<FImpl>::baryon_site(const mobj &D1,
auto D2_ab = D2()(alpha_right,beta_left)(a_right,b_left); auto D2_ab = D2()(alpha_right,beta_left)(a_right,b_left);
auto gD3g_ab = gD3g()(alpha_right,beta_left)(b_right,a_left); auto gD3g_ab = gD3g()(alpha_right,beta_left)(b_right,a_left);
result()()() -= eepD1*D2_ab*gD3g_ab; result()()() -= eepD1*D2_ab*gD3g_ab;
}}} }}
}
} }
//This is the \delta_{456}^{321} part //This is the \delta_{456}^{321} part
if (wick_contraction[4]){ if (wick_contraction[4]){
@ -247,7 +252,8 @@ void BaryonUtils<FImpl>::baryon_site(const mobj &D1,
auto eepD1_gb = ee * pD1()(gamma_left,beta_left)(c_right,b_left); auto eepD1_gb = ee * pD1()(gamma_left,beta_left)(c_right,b_left);
auto D2g_ab = D2g()(alpha_right,beta_left)(a_right,a_left); auto D2g_ab = D2g()(alpha_right,beta_left)(a_right,a_left);
result()()() -= eepD1_gb*D2g_ab*gD3_ag; result()()() -= eepD1_gb*D2g_ab*gD3_ag;
}}} }
}}
} }
//This is the \delta_{456}^{213} part //This is the \delta_{456}^{213} part
if (wick_contraction[5]){ if (wick_contraction[5]){
@ -258,7 +264,8 @@ void BaryonUtils<FImpl>::baryon_site(const mobj &D1,
auto eepD1g_gb = ee * pD1g()(gamma_left,beta_left)(c_right,a_left); auto eepD1g_gb = ee * pD1g()(gamma_left,beta_left)(c_right,a_left);
auto gD3_ab = gD3()(alpha_right,beta_left)(b_right,b_left); auto gD3_ab = gD3()(alpha_right,beta_left)(b_right,b_left);
result()()() -= eepD1g_gb*D2_ag*gD3_ab; result()()() -= eepD1g_gb*D2_ag*gD3_ab;
}}} }
}}
} }
} }
} }
@ -301,19 +308,22 @@ void BaryonUtils<FImpl>::ContractBaryons(const PropagatorField &q1_left,
auto v3 = q3_left.View(); auto v3 = q3_left.View();
Real bytes =0.; Real bytes =0.;
bytes += grid->oSites() * (432.*sizeof(vComplex) + 126.*sizeof(int) + 36.*sizeof(Real));
for (int ie=0; ie < 6 ; ie++){ for (int ie=0; ie < 6 ; ie++){
//bytes += 3. * (grid->oSites() * 12. * 12. * sizeof(Complex)) * wick_contraction[ie]; // size of the 3 propagatorFields if(ie==0 or ie==3){
bytes += grid->oSites() * 36. * 4. * 4. * sizeof(Complex) * wick_contraction[ie]; //number of operations bytes += grid->oSites() * (4.*sizeof(int) + 4752.*sizeof(vComplex)) * wick_contraction[ie];
}
else{
bytes += grid->oSites() * (64.*sizeof(int) + 5184.*sizeof(vComplex)) * wick_contraction[ie];
}
} }
Real t=0.; Real t=0.;
t =-usecond(); t =-usecond();
accelerator_for(ss, grid->oSites(), grid->Nsimd(), { accelerator_for(ss, grid->oSites(), grid->Nsimd(), {
auto D1 = v1[ss]; auto D1 = v1[ss];
auto D2 = v2[ss]; auto D2 = v2[ss];
auto D3 = v3[ss]; auto D3 = v3[ss];
vobj result=Zero(); vobj result=Zero();
baryon_site(D1,D2,D3,GammaA_left,GammaB_left,GammaA_right,GammaB_right,parity,wick_contraction,result); baryon_site(D1,D2,D3,GammaA_left,GammaB_left,GammaA_right,GammaB_right,parity,wick_contraction,result);
vbaryon_corr[ss] = result; vbaryon_corr[ss] = result;