Fix intermolecular interactions with DD
authorBerk Hess <hess@kth.se>
Mon, 18 Nov 2019 15:33:29 +0000 (16:33 +0100)
committerBerk Hess <hess@kth.se>
Mon, 18 Nov 2019 16:10:45 +0000 (17:10 +0100)
The links for atoms with intermolecular interactions would use
incorrect atom indices. This meant that mdrun could exit with
a missing interactions errors when using domain decompostion
with intermolecular interactions at distance larger than the cutoff.

Fixes #3204

Change-Id: I0c78810204f116f028b18c83bc6b51859ed7245a

docs/release-notes/2019/2019.5.rst
src/gromacs/domdec/domdec_topology.cpp

index c0cd22cc01fa3f0924c0e9b85782122b25f24440..38398497955ea69294609cfb1518db351e36f557 100644 (file)
@@ -51,7 +51,16 @@ if Apple itself did not ship a C library that violates the
 stack alignment with AVX instructions are enabled.
 
 :issue:`3199`
-       
+
+Fix error with intermolecular interactions and domain decomposition
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+With intermolecular interactions at distances longer than the cutoff
+and domain decomposition, mdrun could exit with an error message
+about missing interactions.
+
+:issue:`3204`
+
 Fixes for ``gmx`` tools
 ^^^^^^^^^^^^^^^^^^^^^^^
 
index 1079f366967a7b00ca877e80bb92c4fd14e07f4e..2bb331549f3a7e846259541e5a815b0ed483976a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019, 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.
@@ -2362,8 +2362,8 @@ t_blocka *make_charge_group_links(const gmx_mtop_t *mtop, gmx_domdec_t *dd,
 
                     if (mtop->bIntermolecularInteractions)
                     {
-                        int i = ril_intermol.index[a];
-                        while (i < ril_intermol.index[a+1])
+                        int i = ril_intermol.index[cg_gl];
+                        while (i < ril_intermol.index[cg_gl + 1])
                         {
                             int ftype = ril_intermol.il[i++];
                             int nral  = NRAL(ftype);