From fd11f635c17804f503ccec88f78f769ad663e523 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov <2536374+asmorkalov@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:13:19 +0300 Subject: [PATCH] Merge pull request #28122 from asmorkalov:as/dynamic_openmp Dropped OPENCV_FOR_OPENMP_DYNAMIC_DISABLE environment varibale in favor of standard OMP_DYNAMIC #28122 Fixes: https://github.com/opencv/opencv/issues/25717 Replaces: https://github.com/opencv/opencv/pull/28084 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [ ] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake --- .../introduction/env_reference/env_reference.markdown | 2 +- modules/core/src/parallel.cpp | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/tutorials/introduction/env_reference/env_reference.markdown b/doc/tutorials/introduction/env_reference/env_reference.markdown index d4e2881f42..c370ab8d6e 100644 --- a/doc/tutorials/introduction/env_reference/env_reference.markdown +++ b/doc/tutorials/introduction/env_reference/env_reference.markdown @@ -114,7 +114,7 @@ Links: | OPENCV_THREAD_POOL_ACTIVE_WAIT_WORKER | num | 2000 | tune pthreads parallel_for backend | | OPENCV_THREAD_POOL_ACTIVE_WAIT_MAIN | num | 10000 | tune pthreads parallel_for backend | | OPENCV_THREAD_POOL_ACTIVE_WAIT_THREADS_LIMIT | num | 0 | tune pthreads parallel_for backend | -| OPENCV_FOR_OPENMP_DYNAMIC_DISABLE | bool | false | use single OpenMP thread | +| OPENCV_FOR_OPENMP_DYNAMIC_DISABLE | bool | false | Removed in 4.13.0. Use standard [OMP_DYNAMIC](https://www.openmp.org/spec-html/5.0/openmpsu116.html) instead | ## backends diff --git a/modules/core/src/parallel.cpp b/modules/core/src/parallel.cpp index 09c86e94d2..3aa72f9f44 100644 --- a/modules/core/src/parallel.cpp +++ b/modules/core/src/parallel.cpp @@ -465,10 +465,6 @@ namespace { static inline int _initMaxThreads() { int maxThreads = omp_get_max_threads(); - if (!utils::getConfigurationParameterBool("OPENCV_FOR_OPENMP_DYNAMIC_DISABLE", false)) - { - omp_set_dynamic(1); - } return maxThreads; } static int numThreadsMax = _initMaxThreads();