Merge release-2018 into master
[alexxy/gromacs.git] / src / gromacs / mdlib / gmx_omp_nthreads.cpp
index de97bf8689231af767dc9301d9684969841ed42a..b642651f44cea48a3eaee8cfb4e7fb7935544b2d 100644 (file)
@@ -175,8 +175,8 @@ static void pick_module_nthreads(const gmx::MDLogger &mdlog, int m,
     gmx_omp_nthreads_set(m, nth);
 }
 
-void gmx_omp_nthreads_read_env(int     *nthreads_omp,
-                               gmx_bool bIsSimMaster)
+void gmx_omp_nthreads_read_env(const gmx::MDLogger &mdlog,
+                               int                 *nthreads_omp)
 {
     char    *env;
     gmx_bool bCommandLineSetNthreadsOMP = *nthreads_omp > 0;
@@ -204,16 +204,14 @@ void gmx_omp_nthreads_read_env(int     *nthreads_omp,
 
         /* Output the results */
         sprintf(buffer,
-                "The number of OpenMP threads was set by environment variable OMP_NUM_THREADS to %d%s\n",
+                "\nThe number of OpenMP threads was set by environment variable OMP_NUM_THREADS to %d%s\n\n",
                 nt_omp,
                 bCommandLineSetNthreadsOMP ? " (and the command-line setting agreed with that)" : "");
-        if (bIsSimMaster)
-        {
-            /* This prints once per simulation for multi-simulations,
-             * which might help diagnose issues with inhomogenous
-             * cluster setups. */
-            fputs(buffer, stderr);
-        }
+
+        /* This prints once per simulation for multi-simulations,
+         * which might help diagnose issues with inhomogenous
+         * cluster setups. */
+        GMX_LOG(mdlog.info).appendTextFormatted(buffer);
         if (debug)
         {
             /* This prints once per process for real MPI (i.e. once