Fix GMX_NONBONDED_NUM_THREADS!=GMX_PAIRSEARCH_NUM_THREADS
[alexxy/gromacs.git] / src / gromacs / mdlib / nbnxn_search.c
index ae8b82caf72abdd63fae0e4288d58d1a173ed23c..1bc3f05847cd94782e1a67ceae0cc70ef57e3462 100644 (file)
@@ -1697,8 +1697,8 @@ static void calc_cell_indices(const nbnxn_search_t nbs,
     }
 
     /* Sort the super-cell columns along z into the sub-cells. */
-#pragma omp parallel for num_threads(nbs->nthread_max) schedule(static)
-    for (thread = 0; thread < nbs->nthread_max; thread++)
+#pragma omp parallel for num_threads(nthread) schedule(static)
+    for (thread = 0; thread < nthread; thread++)
     {
         if (grid->bSimple)
         {