From: Erik Lindahl Date: Tue, 24 Sep 2013 22:28:29 +0000 (+0200) Subject: Fix bug in (long) neighborlist SIMD padding when adding to previous list X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=5c5516933bca283382d830350b0501a74750b360;p=alexxy%2Fgromacs.git 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 --- 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)