HOME
| OPENMP API Specification: Version 5.0 November 2018

3.2.19  omp_get_ancestor_thread_num

SummaryThe omp_get_ancestor_thread_num routine returns, for a given nested level of the current thread, the thread number of the ancestor of the current thread.

Format

SVG-Viewer needed.

 

 
int omp_get_ancestor_thread_num(int level);  

SVG-Viewer needed.

SVG-Viewer needed.

 

 
integer function omp_get_ancestor_thread_num(level) 
integer level  

SVG-Viewer needed.

BindingThe binding thread set for an omp_get_ancestor_thread_num region is the encountering thread. The binding region for an omp_get_ancestor_thread_num region is the innermost enclosing parallel region.

EffectThe omp_get_ancestor_thread_num routine returns the thread number of the ancestor at a given nest level of the current thread or the thread number of the current thread. If the requested nest level is outside the range of 0 and the nest level of the current thread, as returned by the omp_get_level routine, the routine returns -1.

SVG-Viewer needed.

Note – When the omp_get_ancestor_thread_num routine is called with a value of level=0, the routine always returns 0. If level=omp_get_level(), the routine has the same effect as the omp_get_thread_num routine.

SVG-Viewer needed.

Cross References