omp_get_max_active_levels() can be called from anywhere in the program. The call will return the value of the max-active-levels-var internal control variable.