1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-25 05:05: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;
// 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
CommsMode = WilsonKernelsStatic::Comms;
@ -59,11 +59,15 @@ public:
int blocks_per_rank = 1;
Coordinate LocalDims = grid->LocalDimensions();
Coordinate GlobalDims= grid->GlobalDimensions();
assert(Block.size()==LocalDims.size());
for(int d=0;d<LocalDims.size();d++){
int r = LocalDims[d] / Block[d];
assert(r != 0);
blocks_per_rank *= r;
if (Block[d]<=GlobalDims[d]){
int r = LocalDims[d] % Block[d];
assert(r == 0);
blocks_per_rank *= (LocalDims[d] / Block[d]);
}
}
// Even blocks per node required
assert( (blocks_per_rank % 2) == 0);