From 5c5516933bca283382d830350b0501a74750b360 Mon Sep 17 00:00:00 2001 From: Erik Lindahl Date: Wed, 25 Sep 2013 00:28:29 +0200 Subject: [PATCH] Fix bug in (long) neighborlist SIMD padding when adding to previous list Gromacs-4.6 introduced SIMD padding in the neighborlists, which works fine for normal simulations. However, when the neighborlist gets long and we end up adding a second batch of particles we need to remove the previous padding, which was not done until now. This will typically only occur when the list per node is large, e.g. when using long cutoffs (>2nm) with only a single core. Normal simulations should not have been affected by it (which is also why we did not find it until now). Fixes #1341. Change-Id: Ie64ab6c0313a8dc0d3545a5e7d610f24adae4438 --- src/mdlib/ns.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mdlib/ns.c b/src/mdlib/ns.c index 1f137b363e..6aa89cee38 100644 --- a/src/mdlib/ns.c +++ b/src/mdlib/ns.c @@ -404,6 +404,17 @@ static inline void new_i_nblist(t_nblist *nlist, nlist->gid[nri] = gid; nlist->shift[nri] = shift; } + else + { + /* Adding to previous list. First remove possible previous padding */ + if(nlist->simd_padding_width>1) + { + while(nlist->nrj>0 && nlist->jjnr[nlist->nrj-1]<0) + { + nlist->nrj--; + } + } + } } static inline void close_i_nblist(t_nblist *nlist) -- 2.22.0