maybe this is a general Intel OpenMP problem, but I observed it when testing the Parallel Studio beta.
I would have expected to get different values from omp_get_thread_num() when 2 blocks of code run in different threads.
But when adding:
#pragma omp critical
cout << omp_get_thread_num() << "/" << GetCurrentThreadId() << " ";
To a parallel section I get outputs like 0/8640 0/9268 0/8640 0/9268 0/8640... So obviously I have the threads 8640 and 9268, but omp_get_thread_num() always returns 0.
How can this be?