Query regarding the ICV: 'nthreads-var'

Hi folks,

I am working on modifying OMPD (in the OpenMPToolsInterface/LLVM-openmp/ompd-tests branch) to retrieve the value of the ICV ‘nthreads-var’. ‘nthreads-var’ is a list and as per my understanding, the value of this list at any point for a particular thread would be:

[this_thr->th.th_current_task->td_icvs.nproc, __kmp_nested_nth.nth[current_nesting_level +1], __kmp_nested_nth.nth[current_nesting_level + 2], …, __kmp_nested_nth.nth[used - 1]]

Except for the first element of this list, the other elements of this list are subject to the condition that current_nesting_level is less than __kmp_nested_nth.used. Wanted to confirm with you folks that my understanding is correct. Please correct me otherwise.

Thanks a bunch,


Hi Jini,

Your judgement basically looks correct. Besides that current_nesting_level should be lesser than (used – 1) in order to enumerate __kmp_nested_nth.nth array. I’d also guess that you meant “at any point” of user’s code, as at the start of parallel region the nthreads-var is changing inside the runtime library code along with changing of nesting level.



Thanks a bunch, Andrey!

  • Jini