Merge release-4-6 into master
[alexxy/gromacs.git] / src / gromacs / mdlib / nbnxn_search.c
index ef8cd2d08a524fac028baaddbbd47d61261187d0..7829fcdb95fbacac51fa409f868bb00a265dfa8f 100644 (file)
@@ -1350,7 +1350,8 @@ static void sort_columns_supersub(const nbnxn_search_t nbs,
             /* Sort the atoms along y */
             sort_atoms(YY, (sub_z & 1),
                        nbs->a+ash_z, na_z, x,
-                       grid->c0[YY]+cy*grid->sy, grid->inv_sy,
+                       grid->c0[YY]+cy*grid->sy,
+                       subdiv_y*SORT_GRID_OVERSIZE*grid->inv_sy,
                        subdiv_y*SGSF, sort_work);
 #endif
 
@@ -1363,7 +1364,8 @@ static void sort_columns_supersub(const nbnxn_search_t nbs,
                 /* Sort the atoms along x */
                 sort_atoms(XX, ((cz*GPU_NSUBCELL_Y + sub_y) & 1),
                            nbs->a+ash_y, na_y, x,
-                           grid->c0[XX]+cx*grid->sx, grid->inv_sx,
+                           grid->c0[XX]+cx*grid->sx,
+                           subdiv_x*SORT_GRID_OVERSIZE*grid->inv_sx,
                            subdiv_x*SGSF, sort_work);
 #endif