LLVM OpenMP 22.0.0git
taskloop_dispatch.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// UNSUPPORTED: gnu, intel-16.0
5// clang-format on
6
7#include "callback.h"
8#include <omp.h>
9
10int main() {
11 unsigned int i, x;
12
13#pragma omp parallel num_threads(2)
14 {
15#pragma omp barrier
16
17#pragma omp master
18#pragma omp taskloop grainsize(4)
19 for (i = 0; i < 16; i++) {
20 // Make every iteration takes at least 1ms
21 delay(1000);
22 }
23 }
24 // clang-format off
25 // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
26
27 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin:
28 // CHECK-SAME: parent_task_id={{[0-f]+}}
29 // CHECK-SAME: parallel_id=[[PARALLEL_ID:[0-f]+]]
30 // CHECK-SAME: requested_team_size=2
31 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin:
32 // CHECK-SAME: parallel_id=[[PARALLEL_ID]]
33 // CHECK-SAME: task_id=[[IMPLICIT_TASK_ID1:[0-9]+]]
34 // CHECK-SAME: team_size=2, thread_num=0
35
36 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_taskloop_begin:
37 // CHECK-SAME: parallel_id=[[PARALLEL_ID]]
38 // CHECK-SAME: task_id=[[IMPLICIT_TASK_ID1]]
39 // CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:(0x)?[0-f]+]], count=16
40
41 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create:
42 // CHECK-SAME: new_task_id=[[TASK_ID0:[0-9]+]]
43 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create:
44 // CHECK-SAME: new_task_id=[[TASK_ID1:[0-9]+]]
45 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create:
46 // CHECK-SAME: new_task_id=[[TASK_ID2:[0-9]+]]
47 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create:
48 // CHECK-SAME: new_task_id=[[TASK_ID3:[0-9]+]]
49
50 // CHECK-DAG: {{.*}}: ompt_event_taskloop_chunk_begin:{{.*}}task_id=[[TASK_ID0]]{{.*}}chunk_iterations=4
51 // CHECK-DAG: {{.*}}: ompt_event_taskloop_chunk_begin:{{.*}}task_id=[[TASK_ID1]]{{.*}}chunk_iterations=4
52 // CHECK-DAG: {{.*}}: ompt_event_taskloop_chunk_begin:{{.*}}task_id=[[TASK_ID2]]{{.*}}chunk_iterations=4
53 // CHECK-DAG: {{.*}}: ompt_event_taskloop_chunk_begin:{{.*}}task_id=[[TASK_ID3]]{{.*}}chunk_iterations=4
54 // clang-format on
55
56 return 0;
57}
#define i
Definition kmp_stub.cpp:87
#define delay(t)
Definition ompt-signal.h:6
int main()