From 97240d254619689932102b5a7b077ff3070188fe Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Mon, 12 Mar 2018 16:54:04 +0100 Subject: [PATCH] Fix COM pulling with external potential with #ranks>32 With more than 32 PP-ranks, the pull code could use only a subset of the PP-ranks. This change forces all ranks to do pulling when external potentials are present (currently only used by AWH). Fixes #2441 Change-Id: I8501024b7961600ec79f3707e239ddf25525aa79 --- src/gromacs/pulling/pull.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gromacs/pulling/pull.cpp b/src/gromacs/pulling/pull.cpp index 3459ff21d2..6609961a21 100644 --- a/src/gromacs/pulling/pull.cpp +++ b/src/gromacs/pulling/pull.cpp @@ -2483,9 +2483,13 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir, comm = &pull->comm; #if GMX_MPI - /* Use a sub-communicator when we have more than 32 ranks */ + /* Use a sub-communicator when we have more than 32 ranks, but not + * when we have an external pull potential, since then the external + * potential provider expects each rank to have the coordinate. + */ comm->bParticipateAll = (cr == nullptr || !DOMAINDECOMP(cr) || cr->dd->nnodes <= 32 || + pull->numCoordinatesWithExternalPotential > 0 || getenv("GMX_PULL_PARTICIPATE_ALL") != nullptr); /* This sub-commicator is not used with comm->bParticipateAll, * so we can always initialize it to NULL. -- 2.11.4.GIT