Fix pull code bug with DD and atom sets
authorBerk Hess <hess@kth.se>
Wed, 21 Oct 2020 20:14:46 +0000 (22:14 +0200)
committerBerk Hess <hess@kth.se>
Wed, 21 Oct 2020 20:16:33 +0000 (22:16 +0200)
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
src/gromacs/domdec/partition.cpp

index e0a021f48a56d8404df647efa0f630525cdffb37..a20bef7710eebdc67a13aa3c0e9832d680f4f6fc 100644 (file)
@@ -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
 ^^^^^^^^^^^^^^^^^^^^^^^
 
index b00ceec520596409c50bc96b027913a0dc0e7749..19ab95707d1503271d1f2f913c41f31b68ee14b1 100644 (file)
@@ -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);