[Openmp-commits] [PATCH] D54305: Fix for bugzilla https://bugs.llvm.org/show_bug.cgi?id=39137.

Andrey Churbanov via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Nov 9 05:50:37 PST 2018


AndreyChurbanov created this revision.
AndreyChurbanov added reviewers: hbae, tlwilmar, jlpeyton.
AndreyChurbanov added a project: OpenMP.
Herald added a subscriber: openmp-commits.

Exit earlier from omp_set_num_threads in case requested number of threads is equal to num_threads ICV (internal control variable), in order to avoid unnecessary write.


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D54305

Files:
  runtime/src/kmp_runtime.cpp


Index: runtime/src/kmp_runtime.cpp
===================================================================
--- runtime/src/kmp_runtime.cpp
+++ runtime/src/kmp_runtime.cpp
@@ -2649,6 +2649,8 @@
 
   KMP_COUNT_VALUE(OMP_set_numthreads, new_nth);
   thread = __kmp_threads[gtid];
+  if (thread->th.th_current_task->td_icvs.nproc == new_nth)
+    return; // nothing to do
 
   __kmp_save_internal_controls(thread);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54305.173307.patch
Type: text/x-patch
Size: 409 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20181109/cf88e65b/attachment.bin>


More information about the Openmp-commits mailing list