1
0
mirror of https://github.com/paboyle/Grid.git synced 2026-05-15 06:34:31 +01:00
This commit is contained in:
Peter Boyle
2025-10-22 21:44:51 -04:00
parent da8dc3da0d
commit d0ee38d1da
+18 -64
View File
@@ -98,13 +98,9 @@ public:
accelerator_for(ss,EdgeGrid->oSites(),vComplex::Nsimd(),{ accelerator_for(ss,EdgeGrid->oSites(),vComplex::Nsimd(),{
const int x = IcosahedronPatchX; auto Lx = Umu_v(ss)(IcosahedronPatchX);
const int y = IcosahedronPatchY; auto Ly = Umu_v(ss)(IcosahedronPatchY);
const int d = IcosahedronPatchDiagonal; auto Ld = Umu_v(ss)(IcosahedronPatchDiagonal);
auto Lx = Umu_v(ss)(x);
auto Ly = Umu_v(ss)(y);
auto Ld = Umu_v(ss)(d);
// for trace [ U_x(z) U_y(z+\hat x) adj(U_d(z)) ] // for trace [ U_x(z) U_y(z+\hat x) adj(U_d(z)) ]
{ {
@@ -119,8 +115,6 @@ public:
coalescedWrite(plaq1_v[ss](),trace(Lx*L1*adj(Ld) ) ); coalescedWrite(plaq1_v[ss](),trace(Lx*L1*adj(Ld) ) );
} }
// This was wrong after GT
// Could be EITHER the GT or the the plaq / stencil
// for trace [ U_y(z) U_x(z+\hat y) adj(U_d(z)) ] // for trace [ U_y(z) U_x(z+\hat y) adj(U_d(z)) ]
{ {
auto SE2 = stencil_v.GetEntry(1,ss); auto SE2 = stencil_v.GetEntry(1,ss);
@@ -131,7 +125,6 @@ public:
if(doAdj) if(doAdj)
L2 = adj(L2); L2 = adj(L2);
coalescedWrite(plaq2_v[ss](),trace(Ly*L2*adj(Ld) ) ); coalescedWrite(plaq2_v[ss](),trace(Ly*L2*adj(Ld) ) );
// std::cout << "site "<< ss<<" plaq "<< plaq2_v[ss] << " doAdj "<< (int) doAdj<<" pol "<<(int) pol <<std::endl;
} }
}); });
} }
@@ -157,28 +150,17 @@ public:
const int np = NNee._npoints; const int np = NNee._npoints;
const int ent_Xp = 0;
const int ent_Yp = 1;
const int ent_Xm = 3;
const int ent_Ym = 4;
accelerator_for(ss,EdgeGrid->oSites(),vComplex::Nsimd(),{ accelerator_for(ss,EdgeGrid->oSites(),vComplex::Nsimd(),{
const int ent_Xp = 0;
const int ent_Yp = 1;
const int ent_Xm = 3;
const int ent_Ym = 4;
Integer lexXp = ss*np+ent_Xp;
Integer lexYp = ss*np+ent_Yp;
Integer lexXm = ss*np+ent_Xm;
Integer lexYm = ss*np+ent_Ym;
// Integer lexDp = ss*np+2; // Not touched by staples.
// Integer lexDm = ss*np+5;
const int x = IcosahedronPatchX;
const int y = IcosahedronPatchY;
const int d = IcosahedronPatchDiagonal;
// Three forward links from this site // Three forward links from this site
auto Lx = Umu_v(ss)(x); auto Lx = Umu_v(ss)(IcosahedronPatchX);
auto Ly = Umu_v(ss)(y); auto Ly = Umu_v(ss)(IcosahedronPatchY);
auto Ld = Umu_v(ss)(d); auto Ld = Umu_v(ss)(IcosahedronPatchDiagonal);
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
// Terms for the staple orthog to PlusDiagonal // Terms for the staple orthog to PlusDiagonal
@@ -283,9 +265,6 @@ public:
const int np = NNvv._npoints; const int np = NNvv._npoints;
std::cout << GridLogMessage<< "Free Laplacian via STENCIL "<<std::endl;
const int ent_Xp = 0; const int ent_Xp = 0;
const int ent_Yp = 1; const int ent_Yp = 1;
const int ent_Dp = 2; const int ent_Dp = 2;
@@ -345,16 +324,12 @@ public:
std::cout << GridLogMessage<< "GaugeTransform via STENCIL "<<std::endl; std::cout << GridLogMessage<< "GaugeTransform via STENCIL "<<std::endl;
const int ent_Xp = 0;
const int ent_Yp = 1;
const int ent_Dp = 2;
accelerator_for(ss,EdgeGrid->oSites(),vComplex::Nsimd(),{ accelerator_for(ss,EdgeGrid->oSites(),vComplex::Nsimd(),{
const int ent_Xp = 0;
const int ent_Yp = 1;
const int ent_Dp = 2;
Integer lexXp = ss*np+ent_Xp;
Integer lexYp = ss*np+ent_Yp;
Integer lexDp = ss*np+ent_Dp;
// Three forward links from this site // Three forward links from this site
auto Lx = Umu_v(ss)(IcosahedronPatchX); auto Lx = Umu_v(ss)(IcosahedronPatchX);
auto Ly = Umu_v(ss)(IcosahedronPatchY); auto Ly = Umu_v(ss)(IcosahedronPatchY);
@@ -389,7 +364,6 @@ public:
} }
/* /*
* This routine is slow and single threaded on CPU * This routine is slow and single threaded on CPU
*/
void GaugeTransformCPU(GaugeLinkField &gt, GaugeField &Umu) void GaugeTransformCPU(GaugeLinkField &gt, GaugeField &Umu)
{ {
assert(gt.Grid()==VertexGrid); assert(gt.Grid()==VertexGrid);
@@ -407,9 +381,7 @@ public:
uint64_t Spole_sites = grid->SouthPoleOsites(); uint64_t Spole_sites = grid->SouthPoleOsites();
Coordinate pcoor = grid->ThisProcessorCoor(); Coordinate pcoor = grid->ThisProcessorCoor();
Coordinate pgrid = grid->ProcessorGrid(); Coordinate pgrid = grid->ProcessorGrid();
/*
* resize the stencil entries array and set npoints
*/
autoView(g_v,gt,CpuRead); autoView(g_v,gt,CpuRead);
autoView(Umu_v,Umu,CpuWrite); autoView(Umu_v,Umu,CpuWrite);
for(uint64_t site=0;site<cart_sites; site ++) { for(uint64_t site=0;site<cart_sites; site ++) {
@@ -494,20 +466,6 @@ public:
auto ly = Umu_v(site)(IcosahedronPatchY); auto ly = Umu_v(site)(IcosahedronPatchY);
auto ld = Umu_v(site)(IcosahedronPatchDiagonal); auto ld = Umu_v(site)(IcosahedronPatchDiagonal);
/*
std::cout << "site "<<site<<std::endl;
std::cout << " xp_idx "<<xp_idx<<std::endl;
std::cout << " yp_idx "<<yp_idx<<std::endl;
std::cout << " dp_idx "<<dp_idx<<std::endl;
std::cout << " g "<<g<<std::endl;
std::cout << " gx "<<gx<<std::endl;
std::cout << " gy "<<gy<<std::endl;
std::cout << " gd "<<gd<<std::endl;
std::cout << " lx "<<lx<<std::endl;
std::cout << " ly "<<ly<<std::endl;
std::cout << " ld "<<ld<<std::endl;
*/
lx = g*lx*adj(gx); lx = g*lx*adj(gx);
ly = g*ly*adj(gy); ly = g*ly*adj(gy);
ld = g*ld*adj(gd); ld = g*ld*adj(gd);
@@ -519,6 +477,7 @@ public:
} }
}; };
*/
int main (int argc, char ** argv) int main (int argc, char ** argv)
{ {
@@ -613,11 +572,7 @@ int main (int argc, char ** argv)
std::cout << GridLogMessage << " Check plaquette is gauge invariant "<<std::endl; std::cout << GridLogMessage << " Check plaquette is gauge invariant "<<std::endl;
std::cout << GridLogMessage << "****************************************"<<std::endl; std::cout << GridLogMessage << "****************************************"<<std::endl;
std::cout << GridLogMessage << " applying gauge transform"<<std::endl; std::cout << GridLogMessage << " applying gauge transform"<<std::endl;
Umuck = Umu; Support.GaugeTransform (g,Umu);
Support.GaugeTransform (g,Umuck);
Support.GaugeTransformCPU(g,Umu);
Umuck = Umuck - Umu;
std::cout << GridLogMessage <<"Diff between reference GT and stencil GT: "<<norm2(Umuck) <<std::endl;
std::cout << GridLogMessage << " applied gauge transform "<<std::endl; std::cout << GridLogMessage << " applied gauge transform "<<std::endl;
// std::cout << "Umu\n"<< Umu << std::endl; // std::cout << "Umu\n"<< Umu << std::endl;
std::cout << GridLogMessage << " recalculating plaquette "<<std::endl; std::cout << GridLogMessage << " recalculating plaquette "<<std::endl;
@@ -680,7 +635,6 @@ int main (int argc, char ** argv)
// std::cout << " DXY\n " << closure(linkD * stapleYX) <<std::endl; // std::cout << " DXY\n " << closure(linkD * stapleYX) <<std::endl;
// std::cout << " YXD\n " << closure(linkY * stapleXD) <<std::endl; // std::cout << " YXD\n " << closure(linkY * stapleXD) <<std::endl;
std::cout << GridLogMessage<< "Calling Laplacian" <<std::endl; std::cout << GridLogMessage<< "Calling Laplacian" <<std::endl;
LatticeComplex in(&VertexGrid); LatticeComplex in(&VertexGrid);
LatticeComplex out(&VertexGrid); LatticeComplex out(&VertexGrid);