From bd80f27d8e8fbc0795a2d9897ef3986333df5eb6 Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Wed, 21 Oct 2020 22:14:46 +0200 Subject: [PATCH] Fix pull code bug with DD and atom sets The local pull groups were constructed before instead of after constructing the local atom sets, which were needed for setting the relative atom weights and with more than 32 DD PP-ranks. Fixes #3750 --- docs/release-notes/2020/2020.5.rst | 10 ++++++++++ src/gromacs/domdec/partition.cpp | 15 ++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/release-notes/2020/2020.5.rst b/docs/release-notes/2020/2020.5.rst index e0a021f48a..a20bef7710 100644 --- a/docs/release-notes/2020/2020.5.rst +++ b/docs/release-notes/2020/2020.5.rst @@ -16,6 +16,16 @@ in the :ref:`release-notes`. Fixes where mdrun could behave incorrectly ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Fixed bugs with COM pulling and domain decompostion with weight or >32 ranks +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +When using COM pulling and domain decomposition, the results would be +incorrect when using relative weights per atom or when using more than +32 DD MPI ranks. This would usually lead to crashes or obviously wrong +results. + +:issue:`3750` + Fixes for ``gmx`` tools ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/gromacs/domdec/partition.cpp b/src/gromacs/domdec/partition.cpp index b00ceec520..19ab95707d 100644 --- a/src/gromacs/domdec/partition.cpp +++ b/src/gromacs/domdec/partition.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018,2019, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -3167,18 +3167,19 @@ void dd_partition_system(FILE* fplog, mdatoms->sigmaB, dd_pme_maxshift_x(dd), dd_pme_maxshift_y(dd)); } - if (ir->bPull) - { - /* Update the local pull groups */ - dd_make_local_pull_groups(cr, pull_work); - } - if (dd->atomSets != nullptr) { /* Update the local atom sets */ dd->atomSets->setIndicesInDomainDecomposition(*(dd->ga2la)); } + // The pull group construction can need the atom sets updated above + if (ir->bPull) + { + /* Update the local pull groups */ + dd_make_local_pull_groups(cr, pull_work); + } + /* Update the local atoms to be communicated via the IMD protocol if bIMD is TRUE. */ imdSession->dd_make_local_IMD_atoms(dd); -- 2.22.0