From d43b88af765a6e00dadc99d71f9015b90d4c9b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R=2E=20Brodtkorb?= Date: Tue, 20 Oct 2015 09:30:06 +0200 Subject: [PATCH] Added/fixed comments --- examples/flow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/flow.cpp b/examples/flow.cpp index 6b1840087..35266952d 100644 --- a/examples/flow.cpp +++ b/examples/flow.cpp @@ -156,14 +156,15 @@ try #ifdef _OPENMP if (!getenv("OMP_NUM_THREADS")) { - //Default to max(4,#cores) threads, - //not number of cores (unless ENV(OMP_NUM_THREADS) is defined) + //Default to at most 4 threads, regardless of + //number of cores (unless ENV(OMP_NUM_THREADS) is defined) int num_cores = omp_get_num_procs(); int num_threads = std::min(4, num_cores); omp_set_num_threads(num_threads); } #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; } #endif