From 26b30e15519a42d168484863881c8b4e9a2bde6e Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Wed, 27 Sep 2023 16:20:11 -0400 Subject: [PATCH] Flop count and projection to nearest neighbour (keeps redundant flops) --- Grid/algorithms/GeneralCoarsenedMatrix.h | 46 +++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/Grid/algorithms/GeneralCoarsenedMatrix.h b/Grid/algorithms/GeneralCoarsenedMatrix.h index 0d666eac..e1b086fa 100644 --- a/Grid/algorithms/GeneralCoarsenedMatrix.h +++ b/Grid/algorithms/GeneralCoarsenedMatrix.h @@ -220,6 +220,30 @@ public: GridBase * FineGrid(void) { return _FineGrid; }; // this is all the linalg routines need to know GridCartesian * CoarseGrid(void) { return _CoarseGrid; }; // this is all the linalg routines need to know + + void ProjectNearestNeighbour(RealD shift) + { + int Nd = geom.grid->Nd(); + int point; + std::cout << "ProjectNearestNeighbour "<1) { + std::cout << "setting geom "< &A,const CoarseVector &in, CoarseVector &out) { + RealD ttot=0; + RealD tmult=0; + RealD texch=0; + RealD text=0; + ttot=-usecond(); conformable(CoarseGrid(),in.Grid()); conformable(in.Grid(),out.Grid()); out.Checkerboard() = in.Checkerboard(); CoarseVector tin=in; + texch-=usecond(); CoarseVector pin = Cell.Exchange(tin); + texch+=usecond(); CoarseVector pout(pin.Grid()); @@ -281,11 +312,15 @@ public: typedef CComplex calcComplex; int osites=pin.Grid()->oSites(); + int gsites=pin.Grid()->gSites(); + RealD flops = 1.0* npoint * nbasis * nbasis * 8 * gsites; + for(int point=0;point