[Openmp-dev] __kmpc_global_num_threads bug

Hahnfeld, Jonas via Openmp-dev openmp-dev at lists.llvm.org
Tue Nov 1 23:54:35 PDT 2016


Hi,



Please use the Phabricator as described here: 
http://llvm.org/docs/Phabricator.html

For patches in the OpenMP runtime, please add openmp-commits as subscriber.



Cheers,

Jonas



From: Openmp-dev [mailto:openmp-dev-bounces at lists.llvm.org] On Behalf Of 
Yonghong Yan via Openmp-dev
Sent: Tuesday, November 01, 2016 5:32 PM
To: openmp-dev
Subject: [Openmp-dev] __kmpc_global_num_threads bug



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/20161102/446b762b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5868 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20161102/446b762b/attachment.bin>


More information about the Openmp-dev mailing list