From e348e56a354d90cbf62bedb6a2443d7fc58f97e2 Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Thu, 28 Feb 2013 18:10:34 +0100 Subject: [PATCH] fixed bug with DD cut-off check and PME DLB During the initial stage of PME DLB, the cut-off limit check for the DD DLB was not checked correcty. This reduced the effectiveness of both DD and PME DLB and could lead to missing interactions during a very limited number of steps. Fixes #1169 Change-Id: I0b0cac22d4abbe8a9b0c16488aeb662d7d4d9bcc --- src/mdlib/domdec.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mdlib/domdec.c b/src/mdlib/domdec.c index 871b3635c0..56eb38d25f 100644 --- a/src/mdlib/domdec.c +++ b/src/mdlib/domdec.c @@ -2738,10 +2738,18 @@ static real cellsize_min_dlb(gmx_domdec_comm_t *comm, int dim_ind, int dim) cellsize_min = comm->cellsize_min[dim]; - if (!comm->bVacDLBNoLimit && comm->bPMELoadBalDLBLimits) + if (!comm->bVacDLBNoLimit) { - cellsize_min = max(cellsize_min, - comm->PMELoadBal_max_cutoff/comm->cd[dim_ind].np_dlb); + /* The cut-off might have changed, e.g. by PME load balacning, + * from the value used to set comm->cellsize_min, so check it. + */ + cellsize_min = max(cellsize_min, comm->cutoff/comm->cd[dim_ind].np_dlb); + + if (comm->bPMELoadBalDLBLimits) + { + /* Check for the cut-off limit set by the PME load balancing */ + cellsize_min = max(cellsize_min, comm->PMELoadBal_max_cutoff/comm->cd[dim_ind].np_dlb); + } } return cellsize_min; -- 2.22.0