Merge branch release-4-6 into master
[alexxy/gromacs.git] / src / gromacs / mdlib / ns.c
index 4527ebec7571ba52524f61ba0ff9ff49693a9822..6a21eea81832c8cd88241a4be8518f80bc601dfa 100644 (file)
@@ -401,6 +401,17 @@ static inline void new_i_nblist(t_nblist *nlist, atom_id i_atom, int shift, int
         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)