From 371b4449639bbbb1e8ec269a9d6f3de6bdfd0d26 Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Tue, 24 Apr 2018 16:02:09 +0200 Subject: [PATCH] Fix indexing issue in the pull code When determining if the COM of pull groups should be computed, the indexing range of group[] for each pull coordinate is one element too long. In most cases this element is 0, so in which case it only lead to extra, useless compute when a cylinder group is used. Note that for dihedral geometry the extra element is actually dim[0] in pull coord, which is 0 or 1, which is harmless. No release note, since this did not affect results, it could only cause a minor performance loss with cylinder pulling. Fixes #2486 Change-Id: Ie5785181fbe28d8db57e37c58553ae3835e657b7 --- src/gromacs/pulling/pull.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gromacs/pulling/pull.cpp b/src/gromacs/pulling/pull.cpp index caff4df72c..daad38aecc 100644 --- a/src/gromacs/pulling/pull.cpp +++ b/src/gromacs/pulling/pull.cpp @@ -2251,7 +2251,7 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir, calc_com_start = (pcrd->params.eGeom == epullgCYL ? 1 : 0); calc_com_end = pcrd->params.ngroup; - for (g = calc_com_start; g <= calc_com_end; g++) + for (g = calc_com_start; g < calc_com_end; g++) { pull->group[pcrd->params.group[g]].bCalcCOM = TRUE; } -- 2.11.4.GIT