omp_get_ancestor_thread_num

Purpose

Use omp_get_ancestor_thread_num to return the thread number in the current level of the ancestor that is at the specified nested level. omp_get_ancestor_thread_num returns -1 if the nested level is not within the range of 0 and the current thread's nested level as returned by omp_get_level.

Prototype

int omp_get_ancestor_thread_num(int level);