2 ! { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } }
3 ! { dg-set-target-env-var OMP_PROC_BIND "spread,close" }
4 ! { dg-set-target-env-var OMP_PLACES "{6,7}:4:-2,!{2,3}" }
5 ! { dg-set-target-env-var OMP_NUM_THREADS "2" }
8 integer :: num
, i
, nump
9 num
= omp_get_num_places ()
10 print *, 'omp_get_num_places () == ', num
12 nump
= omp_get_place_num_procs (place_num
= i
)
14 print *, 'place ', i
, ' {}'
16 call print_place (i
, nump
)
20 call omp_set_nested (nested
= .true
.)
22 if (omp_get_thread_num () == omp_get_num_threads () - 1) then
24 if (omp_get_thread_num () == omp_get_num_threads () - 1) &
30 subroutine print_place (i
, nump
)
31 integer, intent (in
) :: i
, nump
33 call omp_get_place_proc_ids (place_num
= i
, ids
= ids
)
34 print *, 'place ', i
, ' {', ids
, '}'
36 subroutine print_place_var
37 integer :: place
, num_places
38 place
= omp_get_place_num ()
39 num_places
= omp_get_partition_num_places ()
40 print *, 'place ', place
41 if (num_places
.gt
. 0) call print_partition (num_places
)
43 subroutine print_partition (num_places
)
44 integer, intent (in
) :: num_places
45 integer :: place_nums(num_places
)
46 call omp_get_partition_place_nums (place_nums
= place_nums
)
47 print *, 'partition ', place_nums(1), '-', place_nums(num_places
)