Fix memory issue in solvate
authorRoland Schulz <roland@utk.edu>
Thu, 22 May 2014 22:16:13 +0000 (18:16 -0400)
committerRoland Schulz <roland@utk.edu>
Thu, 22 May 2014 22:16:13 +0000 (18:16 -0400)
Caused by SIMD padding introduced by new group kernels.

Fixes #1499

Change-Id: I5126217c9b752f1c1fd04d01e2644987fdc52d5b

src/tools/addconf.c

index 0df691f0b3481cdd9f89eaa037eede513909f65b..448d7955d08f2402cdf9eb217533994b34e3bf27 100644 (file)
@@ -431,6 +431,11 @@ void add_conf(t_atoms *atoms, rvec **x, rvec **v, real **r, gmx_bool bSrenew,
             for (j = j0; (j < j1 && nremove < natoms_solvt); j++)
             {
                 jnr = nlist->jjnr[j];
+                if (jnr < 0)
+                {
+                    /* skip padding */
+                    continue;
+                }
                 copy_rvec(x_all[jnr], xj);
 
                 /* Check solvent-protein and solvent-solvent */