Skip to content
Snippets Groups Projects
Commit 81c3f901 authored by Conor Finn's avatar Conor Finn
Browse files

RE #27375 Explicitly disable dynamic thread adjustment

Added done alongside setting the number of threads to ensure that
subsequent parallel regions do not change the number of threads they are
working with from the value set in the config.
parent 95f4badc
No related branches found
No related tags found
No related merge requests found
...@@ -137,6 +137,7 @@ void AtomicOp(std::atomic<T> &f, T d, BinaryOp op) { ...@@ -137,6 +137,7 @@ void AtomicOp(std::atomic<T> &f, T d, BinaryOp op) {
*/ */
#define PARALLEL_FOR_IF(condition) \ #define PARALLEL_FOR_IF(condition) \
PARALLEL_SET_THREADS_TO_CONFIG \ PARALLEL_SET_THREADS_TO_CONFIG \
PARALLEL_SET_DYNAMIC(false); \
PRAGMA(omp parallel for if (condition) ) PRAGMA(omp parallel for if (condition) )
/** Includes code to add OpenMP commands to run the next for loop in parallel. /** Includes code to add OpenMP commands to run the next for loop in parallel.
...@@ -145,6 +146,7 @@ void AtomicOp(std::atomic<T> &f, T d, BinaryOp op) { ...@@ -145,6 +146,7 @@ void AtomicOp(std::atomic<T> &f, T d, BinaryOp op) {
*/ */
#define PARALLEL_FOR_NO_WSP_CHECK() \ #define PARALLEL_FOR_NO_WSP_CHECK() \
PARALLEL_SET_THREADS_TO_CONFIG \ PARALLEL_SET_THREADS_TO_CONFIG \
PARALLEL_SET_DYNAMIC(false); \
PRAGMA(omp parallel for) PRAGMA(omp parallel for)
/** Includes code to add OpenMP commands to run the next for loop in parallel. /** Includes code to add OpenMP commands to run the next for loop in parallel.
...@@ -154,10 +156,12 @@ void AtomicOp(std::atomic<T> &f, T d, BinaryOp op) { ...@@ -154,10 +156,12 @@ void AtomicOp(std::atomic<T> &f, T d, BinaryOp op) {
*/ */
#define PARALLEL_FOR_NOWS_CHECK_FIRSTPRIVATE(variable) \ #define PARALLEL_FOR_NOWS_CHECK_FIRSTPRIVATE(variable) \
PARALLEL_SET_THREADS_TO_CONFIG \ PARALLEL_SET_THREADS_TO_CONFIG \
PARALLEL_SET_DYNAMIC(false); \
PRAGMA(omp parallel for firstprivate(variable) ) PRAGMA(omp parallel for firstprivate(variable) )
#define PARALLEL_FOR_NO_WSP_CHECK_FIRSTPRIVATE2(variable1, variable2) \ #define PARALLEL_FOR_NO_WSP_CHECK_FIRSTPRIVATE2(variable1, variable2) \
PARALLEL_SET_THREADS_TO_CONFIG \ PARALLEL_SET_THREADS_TO_CONFIG \
PARALLEL_SET_DYNAMIC(false); \
PRAGMA(omp parallel for firstprivate(variable1, variable2) ) PRAGMA(omp parallel for firstprivate(variable1, variable2) )
/** Ensures that the next execution line or block is only executed if /** Ensures that the next execution line or block is only executed if
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment