LLVM OpenMP
22.0.0git
runtime
test
ompt
misc
threads_nested.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
#include "
callback.h
"
6
#include <omp.h>
7
8
int
main
() {
9
10
int
condition
= 0;
11
int
x = 0;
12
omp_set_nested
(1);
13
#pragma omp parallel num_threads(2)
14
{
15
#pragma omp parallel num_threads(2)
16
{
17
OMPT_SIGNAL
(
condition
);
18
OMPT_WAIT
(
condition
, 4);
19
}
20
}
21
22
// clang-format off
23
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
24
25
// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_thread_begin:
26
// CHECK-SAME: thread_type=ompt_thread_initial=1, thread_id=[[MASTER_ID]]
27
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_thread_end:
28
// CHECK-SAME: thread_id=[[MASTER_ID]]
29
// CHECK: {{^}}[[WORKER_ID1:[0-9]+]]: ompt_event_thread_begin:
30
// CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID1]]
31
// CHECK: {{^}}[[WORKER_ID1]]: ompt_event_thread_end:
32
// CHECK-SAME: thread_id=[[WORKER_ID1]]
33
// CHECK: {{^}}[[WORKER_ID2:[0-9]+]]: ompt_event_thread_begin:
34
// CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID2]]
35
// CHECK: {{^}}[[WORKER_ID2]]: ompt_event_thread_end:
36
// CHECK-SAME: thread_id=[[WORKER_ID2]]
37
// CHECK: {{^}}[[WORKER_ID3:[0-9]+]]: ompt_event_thread_begin:
38
// CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID3]]
39
// CHECK: {{^}}[[WORKER_ID3]]: ompt_event_thread_end:
40
// CHECK-SAME: thread_id=[[WORKER_ID3]]
41
// clang-format on
42
43
return
0;
44
}
callback.h
condition
int condition
Definition
interoperability.cpp:17
omp_set_nested
#define omp_set_nested
Definition
kmp_stub.cpp:36
OMPT_WAIT
#define OMPT_WAIT(s, v)
Definition
ompt-signal.h:20
OMPT_SIGNAL
#define OMPT_SIGNAL(s)
Definition
ompt-signal.h:13
main
int main()
Definition
threads_nested.c:8
Generated on
for LLVM OpenMP by
1.14.0