mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use correct number of threads when printing banner.
At that stage flow did not set the number of thread in the case where OMP_NUM_THREADS is not defined. That happens in setupParallelism which is called when the simulator is run. Hence we have to manually compute the number of threads similar to there.
This commit is contained in:
parent
afc76a8b27
commit
b4ec2f0611
@ -224,7 +224,13 @@ namespace Opm
|
|||||||
int mpiSize = 1;
|
int mpiSize = 1;
|
||||||
|
|
||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
|
// This function is called before the parallel OpenMP stuff gets initialized.
|
||||||
|
// That initialization happends after the deck is read and we want this message.
|
||||||
|
// Hence we duplicate the code of setupParallelism to get the number of threads.
|
||||||
|
if (getenv("OMP_NUM_THREADS"))
|
||||||
threads = omp_get_max_threads();
|
threads = omp_get_max_threads();
|
||||||
|
else
|
||||||
|
threads = std::min(2, omp_get_max_threads());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_MPI
|
#if HAVE_MPI
|
||||||
|
Loading…
Reference in New Issue
Block a user