__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);
    }

/*!

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