mdrun without OpenMP with thread-MPI now uses all cores
[alexxy/gromacs.git] / src / kernel / runner.c
index 285f926414975b4534105c5a4604986157677869..3ca6a4b57931ea6e2f31a492848a588ce181d9f2 100644 (file)
@@ -775,6 +775,14 @@ static void check_and_update_hw_opt(gmx_hw_opt_t *hw_opt,
     }
 #endif
 
+#ifndef GMX_OPENMP
+    if (hw_opt->nthreads_omp > 1)
+    {
+        gmx_fatal(FARGS, "More than 1 OpenMP thread requested, but Gromacs was compiled without OpenMP support");
+    }
+    hw_opt->nthreads_omp = 1;
+#endif
+
     if (hw_opt->nthreads_tot > 0 && hw_opt->nthreads_omp_pme <= 0)
     {
         /* We have the same number of OpenMP threads for PP and PME processes,