Added epsilon shift to eliminate uneven tiebreaks
This commit is contained in:
@ -191,6 +191,19 @@ void ComputeGridLocal::set_grid_local()
|
||||
zfrachi = comm->mysplit[2][1];
|
||||
}
|
||||
|
||||
// not fully clear why this works
|
||||
// without, sometimes get uneven assignments
|
||||
// in case where ngridz is multiple of nprocz
|
||||
|
||||
double MYEPS = 1.0e-10;
|
||||
|
||||
xfraclo += MYEPS;
|
||||
xfrachi += MYEPS;
|
||||
yfraclo += MYEPS;
|
||||
yfrachi += MYEPS;
|
||||
zfraclo += MYEPS;
|
||||
zfrachi += MYEPS;
|
||||
|
||||
nxlo = static_cast<int> (xfraclo * nx);
|
||||
if (1.0*nxlo != xfraclo*nx) nxlo++;
|
||||
nxhi = static_cast<int> (xfrachi * nx);
|
||||
|
||||
Reference in New Issue
Block a user