1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-24 12:45:56 +01:00

Better block dimension checking and if Block >= Global dims implement non-Dirichlet

This commit is contained in:
Peter Boyle 2021-05-14 11:28:24 -04:00
parent def51267e9
commit d3fd23117a

View File

@ -47,7 +47,7 @@ public:
FermionOperator<Impl> & FermOp; FermionOperator<Impl> & FermOp;
// Constructor / bespoke // Constructor / bespoke
DirichletFermionOperator(FermionOperator<Impl> & _FermOp, Coordinate _Block) : FermOp(_FermOp), Block(_Block), Filter(_Block) DirichletFermionOperator(FermionOperator<Impl> & _FermOp, Coordinate &_Block) : FermOp(_FermOp), Block(_Block), Filter(_Block)
{ {
// Save what the comms mode should be under normal BCs // Save what the comms mode should be under normal BCs
CommsMode = WilsonKernelsStatic::Comms; CommsMode = WilsonKernelsStatic::Comms;
@ -59,11 +59,15 @@ public:
int blocks_per_rank = 1; int blocks_per_rank = 1;
Coordinate LocalDims = grid->LocalDimensions(); Coordinate LocalDims = grid->LocalDimensions();
Coordinate GlobalDims= grid->GlobalDimensions();
assert(Block.size()==LocalDims.size()); assert(Block.size()==LocalDims.size());
for(int d=0;d<LocalDims.size();d++){ for(int d=0;d<LocalDims.size();d++){
int r = LocalDims[d] / Block[d]; if (Block[d]<=GlobalDims[d]){
assert(r != 0); int r = LocalDims[d] % Block[d];
blocks_per_rank *= r; assert(r == 0);
blocks_per_rank *= (LocalDims[d] / Block[d]);
}
} }
// Even blocks per node required // Even blocks per node required
assert( (blocks_per_rank % 2) == 0); assert( (blocks_per_rank % 2) == 0);