2 /* { dg-set-target-env-var OMP_PROC_BIND "spread,close" } */
3 /* { dg-set-target-env-var OMP_PLACES "{6,7}:4:-2,!{2,3}" } */
4 /* { dg-set-target-env-var OMP_NUM_THREADS "2" } */
14 static size_t buf_size
;
15 if ((size_t) nump
> buf_size
)
20 int *bufn
= realloc (buf
, buf_size
* sizeof (int));
23 fprintf (stderr
, "memory allocation error\n");
32 print_place (int count
, int *ids
)
36 for (i
= 0; i
< count
; i
++)
38 for (j
= i
+ 1; j
< count
; j
++)
39 if (ids
[j
] != ids
[i
] + (j
- i
))
44 printf ("%d", ids
[i
]);
47 printf ("%d:%d", ids
[i
], j
- i
);
55 print_place_var (void)
57 int place
= omp_get_place_num ();
58 int num_places
= omp_get_partition_num_places ();
59 int *ids
= get_buf (num_places
);
60 omp_get_partition_place_nums (ids
);
61 printf ("place %d\n", place
);
63 printf ("partition %d-%d\n", ids
[0], ids
[num_places
- 1]);
69 int i
, num
= omp_get_num_places (), nump
, *ids
;
70 printf ("omp_get_num_places () == %d\n", num
);
71 for (i
= 0; i
< num
; i
++)
73 printf ("place %d ", i
);
74 nump
= omp_get_place_num_procs (i
);
76 omp_get_place_proc_ids (i
, ids
);
77 print_place (nump
, ids
);
82 if (omp_get_thread_num () == omp_get_num_threads () - 1)
85 if (omp_get_thread_num () == omp_get_num_threads () - 1)