From b7bcff77595f7b1ae0647e340539caf4db8a757a Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Fri, 26 Sep 2014 20:38:29 +0200 Subject: [PATCH] Fix calc_grid avoiding PME grid factor 84 Due to an indexing issue, it was unlikely that calc_grid, and thus grompp, would choose a PME grid of 84*2^n and instead use a factor 96. For a cubic box, this could increase the FFT cost by a factor 1.5. Fixes #1605. Change-Id: I8d6a85a98267af053b66867722fc5626ef907964 --- src/gromacs/gmxlib/calcgrid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gromacs/gmxlib/calcgrid.c b/src/gromacs/gmxlib/calcgrid.c index 3d1e70d909..81856d489c 100644 --- a/src/gromacs/gmxlib/calcgrid.c +++ b/src/gromacs/gmxlib/calcgrid.c @@ -137,7 +137,7 @@ real calc_grid(FILE *fp, matrix box, real gr_sp, /* Determine how many pre-factors of 2 we need */ fac2 = 1; i = g_baseNR - 1; - while (fac2*grid_base[i-1] < nmin) + while (fac2*grid_base[i] < nmin) { fac2 *= 2; } -- 2.22.0