int gnth_pme; /**< Global num. of threads per PME only process/tMPI thread. */
gmx::EnumerationArray<ModuleMultiThread, int> nth; /**< Number of threads for each module, indexed with module_nth_t */
- bool initialized; /**< TRUE if the module as been initialized. */
} omp_module_nthreads_t;
/** Names of environment variables to set the per module number of threads.
* the init call is omitted.
* */
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
-static omp_module_nthreads_t modth = { 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, FALSE };
+static omp_module_nthreads_t modth = { 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
/** Determine the number of threads for module \p mod.
GMX_UNUSED_VALUE(cr);
#endif
- if (modth.initialized)
- {
- /* Just return if the initialization has already been
- done. This could only happen if gmx_omp_nthreads_init() has
- already been called. */
- return;
- }
-
/* With full OpenMP support (verlet scheme) set the number of threads
* per process / default:
* - 1 if not compiled with OpenMP or
gmx_omp_set_num_threads(nth);
}
}
-
- modth.initialized = TRUE;
}
/*! \brief Report on the OpenMP settings that will be used */
*
* It is compatible with tMPI, thread-safety is ensured (for the features
* available with tMPI).
- * This function should caled only once during the initialization of mdrun. */
+ * This function should be called only once during the initialization of mdrun. */
void gmx_omp_nthreads_init(const gmx::MDLogger& fplog,
t_commrec* cr,
int nthreads_hw_avail,