fix for the __kmpc_global_num_threads function to return the value of the __kmp_all_nth global var

Authored by yanyh on Dec 20 2016, 2:50 AM.



As the comments and the function name indicate, the function returns the internal global num of a thread, not the num of a thread within a team, which is what the current function do by returning the value of kmp_nth global var. This patch fixes that by returning the kmp_all_nth value.

Diff Detail

yanyh retitled this revision from to fix for the __kmpc_global_num_threads function to return the value of the __kmp_all_nth global var.Dec 20 2016, 2:50 AM
yanyh updated this object.
yanyh added a reviewer: tlwilmar.
yanyh added a subscriber: openmp-commits.
AndreyChurbanov accepted this revision.Dec 20 2016, 10:41 AM
AndreyChurbanov added a reviewer: AndreyChurbanov.
AndreyChurbanov added a subscriber: AndreyChurbanov.


Yonghong, you are right, the kmp_all_nth counts all threads created by the runtime library, whereas kmp_nth counts only active threads those belong to OMP teams.

This revision is now accepted and ready to land.Dec 20 2016, 10:41 AM
This revision was automatically updated to reflect the committed changes.