From 81c3f9019fc5fc62d2bce84d2f3b1db9c7c9f530 Mon Sep 17 00:00:00 2001 From: Conor Finn <conor.finn@stfc.ac.uk> Date: Tue, 3 Dec 2019 14:01:05 +0000 Subject: [PATCH] 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. --- Framework/Kernel/inc/MantidKernel/MultiThreaded.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Framework/Kernel/inc/MantidKernel/MultiThreaded.h b/Framework/Kernel/inc/MantidKernel/MultiThreaded.h index d1c8674316f..a3c22249b41 100644 --- a/Framework/Kernel/inc/MantidKernel/MultiThreaded.h +++ b/Framework/Kernel/inc/MantidKernel/MultiThreaded.h @@ -137,6 +137,7 @@ void AtomicOp(std::atomic<T> &f, T d, BinaryOp op) { */ #define PARALLEL_FOR_IF(condition) \ PARALLEL_SET_THREADS_TO_CONFIG \ + PARALLEL_SET_DYNAMIC(false); \ PRAGMA(omp parallel for if (condition) ) /** 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) { */ #define PARALLEL_FOR_NO_WSP_CHECK() \ PARALLEL_SET_THREADS_TO_CONFIG \ + PARALLEL_SET_DYNAMIC(false); \ PRAGMA(omp parallel for) /** 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) { */ #define PARALLEL_FOR_NOWS_CHECK_FIRSTPRIVATE(variable) \ PARALLEL_SET_THREADS_TO_CONFIG \ + PARALLEL_SET_DYNAMIC(false); \ PRAGMA(omp parallel for firstprivate(variable) ) #define PARALLEL_FOR_NO_WSP_CHECK_FIRSTPRIVATE2(variable1, variable2) \ PARALLEL_SET_THREADS_TO_CONFIG \ + PARALLEL_SET_DYNAMIC(false); \ PRAGMA(omp parallel for firstprivate(variable1, variable2) ) /** Ensures that the next execution line or block is only executed if -- GitLab