[Openmp-dev] __kmpc_global_num_threads bug

Yonghong Yan via Openmp-dev openmp-dev at lists.llvm.org
Tue Nov 1 09:31:58 PDT 2016


Though not used, the __kmpc_global_num_threads, based on the comments for
it, returns the value of the wrong variable. Below is a patch for a fix,
which I think I did it right.

Where is the official link for submitting bugs and patches?

Thanks
Yonghong


diff --git a/runtime/src/kmp_csupport.c b/runtime/src/kmp_csupport.c
index f774ac1..257d5a8 100644
--- a/runtime/src/kmp_csupport.c
+++ b/runtime/src/kmp_csupport.c
@@ -121,9 +121,9 @@ waiting for work.
 kmp_int32
 __kmpc_global_num_threads(ident_t *loc)
 {
-    KC_TRACE( 10, ("__kmpc_global_num_threads: num_threads = %d\n",
__kmp_nth ) );
+    KC_TRACE( 10, ("__kmpc_global_num_threads: num_threads = %d\n",
__kmp_all_nth ) );

-    return TCR_4(__kmp_nth);
+    return TCR_4(__kmp_all_nth);
 }

 /*!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20161101/49c55220/attachment.html>


More information about the Openmp-dev mailing list