[rtsan] Add fork/execve interceptors (#117198)
[llvm-project.git] / openmp / runtime / test / ompt / teams / serial_teams.c
blobd436facbbe5ac970e52b7de43d19a89b3915d3a1
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"
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;
15 // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
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
21 // CHECK: {{^}}[[MASTER_0:[0-9]+]]: ompt_event_initial_task_begin:
22 // CHECK-SAME: task_id=[[INIT_TASK:[0-9]+]], {{.*}}, index=1
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]+]]
30 // team 0
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
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]+]]
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]]
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]]
55 // CHECK: {{^}}[[MASTER_0]]: ompt_event_initial_task_end:
56 // CHECK-SAME: task_id=[[INIT_TASK_0]], actual_parallelism=0, index=0
58 // CHECK: {{^}}[[MASTER_0]]: ompt_event_teams_end:
59 // CHECK-SAME: {{.*}} task_id=[[INIT_TASK]], invoker=[[TEAMS_FLAGS]]
61 // CHECK: {{^}}[[MASTER_0]]: ompt_event_initial_task_end:
62 // CHECK-SAME: task_id=[[INIT_TASK]], {{.*}}, index=1
65 // team 1
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
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]+]]
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]]
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]]
90 // CHECK: {{^}}[[MASTER_1]]: ompt_event_initial_task_end:
91 // CHECK-SAME: task_id=[[INIT_TASK_1]], actual_parallelism=0, index=1