From 031f85247ce8d84c13afed83fd7d50638a082f48 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Thu, 23 Nov 2023 18:18:35 -0500 Subject: [PATCH] multRHS initial support -- needs optimisation for multi project/promote. Bug fix in freeing intermediate grids to stop double free --- Grid/lattice/Lattice_transfer.h | 32 ++++++++++++++++++++++++++++++-- Grid/lattice/PaddedCell.h | 5 ++++- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/Grid/lattice/Lattice_transfer.h b/Grid/lattice/Lattice_transfer.h index 39fcb376..38501d3d 100644 --- a/Grid/lattice/Lattice_transfer.h +++ b/Grid/lattice/Lattice_transfer.h @@ -265,8 +265,8 @@ inline auto localInnerProductD(const Lattice &lhs,const Lattice &rhs //////////////////////////////////////////////////////////////////////////////////////////// template inline void blockProject(Lattice > &coarseData, - const Lattice &fineData, - const VLattice &Basis) + const Lattice &fineData, + const VLattice &Basis) { GridBase * fine = fineData.Grid(); GridBase * coarse= coarseData.Grid(); @@ -300,6 +300,7 @@ inline void blockProject(Lattice > &coarseData, // std::cout << GridLogPerformance << " blockProject : conv : "< > & full,Lattice & split) } } +////////////////////////////////////////////////////// +// MultiRHS interface support for coarse space +// -- Simplest possible implementation to begin with +////////////////////////////////////////////////////// +template +inline void blockProjectMany(Lattice > &coarseIP, + Lattice > &coarseTMP, + const VLattice &fineData, // Basis and fineData necessarily same type + const VLattice &Basis) +{ + for(int r=0;r +inline void blockPromoteMany(Lattice > &coarseIP, + Lattice > &coarseTMP, + const VLattice &fineData, // Basis and fineData necessarily same type + const VLattice &Basis) +{ + for(int r=0;r_processors; for(int d=0;d 1 ) { + delete grids[d]; + } } grids.resize(0); };