1// RUN: %gdb-compile 2>&1 | tee %t.compile
2// RUN: env OMP_SCHEDULE=dynamic,2 %gdb-test -x %S/ompd_icvs.cmd %t 2>&1 | tee
3// %t.out | FileCheck %s
4
5#include <omp.h>
6#include <stdio.h>
7int main(void) {
8 omp_set_max_active_levels(3);
9 omp_set_dynamic(0);
10 omp_set_num_threads(9);
11#pragma omp parallel
12 {
13 omp_set_num_threads(5);
14#pragma omp parallel
15 {
16#pragma omp single
17 { printf(format: "Inner: num_thds=%d\n", omp_get_num_threads()); }
18 }
19#pragma omp barrier
20 omp_set_max_active_levels(0);
21#pragma omp parallel
22 {
23#pragma omp single
24 { printf(format: "Inner: num_thds=%d\n", omp_get_num_threads()); }
25 }
26#pragma omp barrier
27#pragma omp single
28 { printf(format: "Outer: num_thds=%d\n", omp_get_num_threads()); }
29 }
30 return 0;
31}
32// CHECK: Loaded OMPD lib successfully!
33
34// CHECK: run-sched-var task dynamic,2
35// CHECK: levels-var parallel 2
36// CHECK: active-levels-var parallel 2
37// CHECK: team-size-var parallel 5
38
39// CHECK: levels-var parallel 2
40// CHECK: active-levels-var parallel 1
41// CHECK: team-size-var parallel 1
42
43// CHECK: levels-var parallel 1
44// CHECK: active-levels-var parallel 1
45// CHECK: team-size-var parallel 9
46
47// CHECK-NOT: Python Exception
48// CHECK-NOT: The program is not being run.
49// CHECK-NOT: No such file or directory
50

source code of openmp/libompd/test/openmp_examples/ompd_icvs.c