LLVM OpenMP
22.0.0git
runtime
test
ompt
parallel
nested_serialized_task_frames.c
Go to the documentation of this file.
1
// clang-format off
2
// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
3
// REQUIRES: ompt
4
// clang-format on
5
6
#include "
callback.h
"
7
#include <omp.h>
8
9
int
main
() {
10
#pragma omp parallel num_threads(1)
11
{
12
// region 0
13
#pragma omp parallel num_threads(1)
14
{
15
// region 1
16
#pragma omp parallel num_threads(1)
17
{
18
// region 2
19
// region 2's implicit task
20
print_ids
(0);
21
// region 1's implicit task
22
print_ids
(1);
23
// region 0's implicit task
24
print_ids
(2);
25
// initial task
26
print_ids
(3);
27
}
28
}
29
}
30
31
// clang-format off
32
// Check if libomp supports the callbacks for this test.
33
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_create'
34
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_implicit_task'
35
36
37
// CHECK: {{^}}0: NULL_POINTER=[[NULL:.*$]]
38
// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_initial_task_begin: parallel_id=[[INITIAL_PARALLEL_ID:[0-f]+]], task_id=[[INITIAL_TASK_ID:[0-f]+]], actual_parallelism=1, index=1, flags=1
39
40
// region 0
41
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_parallel_begin
42
// CHECK-SAME: parent_task_frame.exit=[[NULL]], parent_task_frame.reenter=[[INITIAL_TASK_FRAME_ENTER:(0x)?[0-f]+]],
43
// CHECK-SAME: parallel_id=[[PARALLEL_ID_0:[0-9]+]]
44
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID_0]], task_id=[[TASK_ID_0:[0-9]+]]
45
46
// region 1
47
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_parallel_begin
48
// CHECK-SAME: parent_task_frame.exit=[[REGION_0_FRAME_EXIT:(0x)?[0-f]+]], parent_task_frame.reenter=[[REGION_0_FRAME_ENTER:(0x)?[0-f]+]],
49
// CHECK-SAME: parallel_id=[[PARALLEL_ID_1:[0-9]+]]
50
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID_1]], task_id=[[TASK_ID_1:[0-9]+]]
51
52
// region 2
53
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_parallel_begin
54
// CHECK-SAME: parent_task_frame.exit=[[REGION_1_FRAME_EXIT:(0x)?[0-f]+]], parent_task_frame.reenter=[[REGION_1_FRAME_ENTER:(0x)?[0-f]+]],
55
// CHECK-SAME: parallel_id=[[PARALLEL_ID_2:[0-9]+]]
56
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID_2]], task_id=[[TASK_ID_2:[0-9]+]]
57
58
// region 2's implicit task information (exit frame should be set, while enter should be NULL)
59
// CHECK: {{^}}[[MASTER_ID]]: task level 0: parallel_id=[[PARALLEL_ID_2]], task_id=[[TASK_ID_2]]
60
// CHECK-SAME: exit_frame={{(0x)?[0-f]+}}
61
// CHECK-SAME: reenter_frame=[[NULL]]
62
// CHECK-SAME: task_type=ompt_task_implicit
63
64
// region 1's implicit task information (both exit and enter frames should be set)
65
// CHECK: {{^}}[[MASTER_ID]]: task level 1: parallel_id=[[PARALLEL_ID_1]], task_id=[[TASK_ID_1]]
66
// CHECK-SAME: exit_frame=[[REGION_1_FRAME_EXIT]]
67
// CHECK-SAME: reenter_frame=[[REGION_1_FRAME_ENTER]]
68
// CHECK-SAME: task_type=ompt_task_implicit
69
70
// region 0's implicit task information (both exit and enter frames should be set)
71
// CHECK: {{^}}[[MASTER_ID]]: task level 2: parallel_id=[[PARALLEL_ID_0]], task_id=[[TASK_ID_0]]
72
// CHECK-SAME: exit_frame=[[REGION_0_FRAME_EXIT]]
73
// CHECK-SAME: reenter_frame=[[REGION_0_FRAME_ENTER]]
74
// CHECK-SAME: task_type=ompt_task_implicit
75
76
// region 0's initial task information (both exit and enter frames should be set)
77
// CHECK: {{^}}[[MASTER_ID]]: task level 3: parallel_id=[[INITIAL_PARALLEL_ID]], task_id=[[INITIAL_TASK_ID]]
78
// CHECK-SAME: exit_frame=[[NULL]]
79
// CHECK-SAME: reenter_frame=[[INITIAL_TASK_FRAME_ENTER]]
80
// CHECK-SAME: task_type=ompt_task_initial
81
// clang-format on
82
83
return
0;
84
}
callback.h
print_ids
static void print_ids(int level)
Definition
callback.h:187
main
int main()
Definition
nested_serialized_task_frames.c:9
Generated on
for LLVM OpenMP by
1.14.0