mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-29 10:40:59 -06:00
Refine OpenMP number-of-threads output.
Now each MPI rank will report, making it easier to see how MPI and OpenMP interacts w.r.t. processes and threads.
This commit is contained in:
parent
f7c96b4fc5
commit
c1bd7670c6
@ -455,8 +455,13 @@ namespace Opm
|
||||
}
|
||||
#pragma omp parallel
|
||||
if (omp_get_thread_num() == 0) {
|
||||
// opm_get_num_threads() only works as expected within a parallel region.
|
||||
std::cout << "OpenMP using " << omp_get_num_threads() << " threads." << std::endl;
|
||||
// omp_get_num_threads() only works as expected within a parallel region.
|
||||
const int num_omp_threads = omp_get_num_threads();
|
||||
if (mpi_size == 1) {
|
||||
std::cout << "OpenMP using " << num_omp_threads << " threads." << std::endl;
|
||||
} else {
|
||||
std::cout << "OpenMP using " << num_omp_threads << " threads on MPI rank " << mpi_rank << "." << std::endl;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user