1 | // RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s |
2 | // REQUIRES: ompt, multicpu |
3 | // UNSUPPORTED: gcc |
4 | // Compilation fails for icc |
5 | // XFAIL: icc |
6 | #include "callback.h" |
7 | |
8 | int main() { |
9 | #pragma omp target teams num_teams(2) thread_limit(1) |
10 | #pragma omp parallel num_threads(1) |
11 | { printf("In teams parallel\n" ); } |
12 | return 0; |
13 | } |
14 | |
15 | // CHECK: 0: NULL_POINTER=[[NULL:.*$]] |
16 | |
17 | // CHECK-NOT: 0: parallel_data initially not null |
18 | // CHECK-NOT: 0: task_data initially not null |
19 | // CHECK-NOT: 0: thread_data initially not null |
20 | |
21 | // CHECK: {{^}}[[MASTER_0:[0-9]+]]: ompt_event_initial_task_begin: |
22 | // CHECK-SAME: task_id=[[INIT_TASK:[0-9]+]], {{.*}}, index=1 |
23 | |
24 | // CHECK: {{^}}[[MASTER_0]]: ompt_event_teams_begin: |
25 | // CHECK-SAME: parent_task_id=[[INIT_TASK]] |
26 | // CHECK-SAME: {{.*}} requested_num_teams=2 |
27 | // CHECK-SAME: {{.*}} invoker=[[TEAMS_FLAGS:[0-9]+]] |
28 | |
29 | // |
30 | // team 0 |
31 | // |
32 | // initial task in the teams construct |
33 | // CHECK: {{^}}[[MASTER_0]]: ompt_event_initial_task_begin: |
34 | // CHECK-SAME: task_id=[[INIT_TASK_0:[0-9]+]], actual_parallelism=2, index=0 |
35 | |
36 | // parallel region forked by runtime |
37 | // CHECK: {{^}}[[MASTER_0]]: ompt_event_parallel_begin: |
38 | // CHECK-SAME: {{.*}} parent_task_id=[[INIT_TASK_0]] |
39 | // CHECK-SAME: {{.*}} parallel_id=[[PAR_0:[0-9]+]] |
40 | // CHECK: {{^}}[[MASTER_0]]: ompt_event_implicit_task_begin: |
41 | // CHECK-SAME: {{.*}} parallel_id=[[PAR_0]], task_id=[[IMPL_TASK_0:[0-9]+]] |
42 | |
43 | // user parallel region |
44 | // CHECK: {{^}}[[MASTER_0]]: ompt_event_parallel_begin: |
45 | // CHECK-SAME: {{.*}} parent_task_id=[[IMPL_TASK_0]] |
46 | // CHECK-SAME: {{.*}} parallel_id=[[PAR_00:[0-9]+]] |
47 | // CHECK: {{^}}[[MASTER_0]]: ompt_event_parallel_end: |
48 | // CHECK-SAME: {{.*}} parallel_id=[[PAR_00]], task_id=[[IMPL_TASK_0]] |
49 | |
50 | // CHECK: {{^}}[[MASTER_0]]: ompt_event_implicit_task_end: |
51 | // CHECK-SAME: {{.*}} parallel_id={{[0-9]+}}, task_id=[[IMPL_TASK_0]] |
52 | // CHECK: {{^}}[[MASTER_0]]: ompt_event_parallel_end: |
53 | // CHECK-SAME: {{.*}} parallel_id=[[PAR_0]], task_id=[[INIT_TASK_0]] |
54 | |
55 | // CHECK: {{^}}[[MASTER_0]]: ompt_event_initial_task_end: |
56 | // CHECK-SAME: task_id=[[INIT_TASK_0]], actual_parallelism=0, index=0 |
57 | |
58 | // CHECK: {{^}}[[MASTER_0]]: ompt_event_teams_end: |
59 | // CHECK-SAME: {{.*}} task_id=[[INIT_TASK]], invoker=[[TEAMS_FLAGS]] |
60 | |
61 | // CHECK: {{^}}[[MASTER_0]]: ompt_event_initial_task_end: |
62 | // CHECK-SAME: task_id=[[INIT_TASK]], {{.*}}, index=1 |
63 | |
64 | // |
65 | // team 1 |
66 | // |
67 | // initial task in the teams construct |
68 | // CHECK: {{^}}[[MASTER_1:[0-9]+]]: ompt_event_initial_task_begin: |
69 | // CHECK-SAME: task_id=[[INIT_TASK_1:[0-9]+]], actual_parallelism=2, index=1 |
70 | |
71 | // parallel region forked by runtime |
72 | // CHECK: {{^}}[[MASTER_1]]: ompt_event_parallel_begin: |
73 | // CHECK-SAME: {{.*}} parent_task_id=[[INIT_TASK_1]] |
74 | // CHECK-SAME: {{.*}} parallel_id=[[PAR_ID_1:[0-9]+]] |
75 | // CHECK: {{^}}[[MASTER_1]]: ompt_event_implicit_task_begin: |
76 | // CHECK-SAME: {{.*}} parallel_id=[[PAR_ID_1]], task_id=[[IMPL_TASK_1:[0-9]+]] |
77 | |
78 | // user parallel region |
79 | // CHECK: {{^}}[[MASTER_1]]: ompt_event_parallel_begin: |
80 | // CHECK-SAME: {{.*}} parent_task_id=[[IMPL_TASK_1]] |
81 | // CHECK-SAME: {{.*}} parallel_id=[[PAR_ID_11:[0-9]+]] |
82 | // CHECK: {{^}}[[MASTER_1]]: ompt_event_parallel_end: |
83 | // CHECK-SAME: {{.*}} parallel_id=[[PAR_ID_11]], task_id=[[IMPL_TASK_1]] |
84 | |
85 | // CHECK: {{^}}[[MASTER_1]]: ompt_event_implicit_task_end: |
86 | // CHECK-SAME: {{.*}} parallel_id={{[0-9]+}}, task_id=[[IMPL_TASK_1]] |
87 | // CHECK: {{^}}[[MASTER_1]]: ompt_event_parallel_end: |
88 | // CHECK-SAME: {{.*}} parallel_id=[[PAR_ID_1]], task_id=[[INIT_TASK_1]] |
89 | |
90 | // CHECK: {{^}}[[MASTER_1]]: ompt_event_initial_task_end: |
91 | // CHECK-SAME: task_id=[[INIT_TASK_1]], actual_parallelism=0, index=1 |
92 | |