https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80859
--- Comment #8 from Thorsten Kurth <thorstenkurth at me dot com> --- Here is the output of the get_num_threads section: [tkurth@cori02 omp_3_vs_45_test]$ export OMP_NUM_THREADS=32 [tkurth@cori02 omp_3_vs_45_test]$ ./nested_test_omp_4dot5.x We got 1 teams and 32 threads. and: [tkurth@cori02 omp_3_vs_45_test]$ ./nested_test_omp_4dot5.x We got 1 teams and 12 threads. I think the code is OK.