mdrun without OpenMP with thread-MPI now uses all cores
authorBerk Hess <hess@kth.se>
Mon, 12 Aug 2013 11:13:47 +0000 (13:13 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 16 Sep 2013 07:27:07 +0000 (09:27 +0200)
With the Verlet scheme, mdrun compiled without OpenMP would
often run on a single MPI-thread only.
Fixes #1317

Change-Id: I8fc43fe933ba23047f0ee9368ad9105cfc62eb4a

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,