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
8int main() {
9#pragma omp target teams num_teams(1) thread_limit(2)
10#pragma omp parallel num_threads(2)
11 { printf("In teams\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-9]+]]: ompt_event_initial_task_begin:
22// CHECK-SAME: task_id=[[INIT_TASK:[0-9]+]], {{.*}}, index=1
23
24// CHECK: {{^}}[[MASTER]]: ompt_event_teams_begin:
25// CHECK-SAME: parent_task_id=[[INIT_TASK]]
26// CHECK-SAME: {{.*}} requested_num_teams=1
27// CHECK-SAME: {{.*}} invoker=[[TEAMS_FLAGS:[0-9]+]]
28
29//
30// team 0/thread 0
31//
32// initial task in the teams construct
33// CHECK: {{^}}[[MASTER]]: ompt_event_initial_task_begin:
34// CHECK-SAME: task_id=[[INIT_TASK_0:[0-9]+]], actual_parallelism=1, index=0
35
36// parallel region forked by runtime
37// CHECK: {{^}}[[MASTER]]: 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]]: 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]]: ompt_event_parallel_begin:
45// CHECK-SAME: {{.*}} parent_task_id=[[IMPL_TASK_0]]
46// CHECK-SAME: {{.*}} parallel_id=[[PAR_00:[0-9]+]]
47// CHECK-SAME: {{.*}} requested_team_size=2
48// CHECK: {{^}}[[MASTER]]: ompt_event_implicit_task_begin:
49// CHECK-SAME: {{.*}} parallel_id=[[PAR_00]], task_id=[[IMPL_TASK_00:[0-9]+]]
50// CHECK-SAME: {{.*}} team_size=2, thread_num=0
51//
52// barrier event is here
53//
54// CHECK: {{^}}[[MASTER]]: ompt_event_implicit_task_end:
55// CHECK-SAME: {{.*}} parallel_id={{[0-9]+}}, task_id=[[IMPL_TASK_00]]
56// CHECK: {{^}}[[MASTER]]: ompt_event_parallel_end:
57// CHECK-SAME: {{.*}} parallel_id=[[PAR_00]], task_id=[[IMPL_TASK_0]]
58
59// CHECK: {{^}}[[MASTER]]: ompt_event_implicit_task_end:
60// CHECK-SAME: {{.*}} parallel_id={{[0-9]+}}, task_id=[[IMPL_TASK_0]]
61// CHECK: {{^}}[[MASTER]]: ompt_event_parallel_end:
62// CHECK-SAME: {{.*}} parallel_id=[[PAR_0]], task_id=[[INIT_TASK_0]]
63
64// CHECK: {{^}}[[MASTER]]: ompt_event_initial_task_end:
65// CHECK-SAME: task_id=[[INIT_TASK_0]], actual_parallelism=0, index=0
66
67// CHECK: {{^}}[[MASTER]]: ompt_event_teams_end:
68// CHECK-SAME: {{.*}} task_id=[[INIT_TASK]], invoker=[[TEAMS_FLAGS]]
69
70// CHECK: {{^}}[[MASTER]]: ompt_event_initial_task_end:
71// CHECK-SAME: task_id=[[INIT_TASK]], {{.*}}, index=1
72
73//
74// team 0/thread 1
75//
76// CHECK: {{^}}[[WORKER:[0-9]+]]: ompt_event_implicit_task_begin:
77// CHECK-SAME: {{.*}} parallel_id=[[PAR_00]], task_id=[[IMPL_TASK_01:[0-9]+]]
78// CHECK-SAME: {{.*}} team_size=2, thread_num=1
79//
80// barrier event is here
81//
82// CHECK: {{^}}[[WORKER]]: ompt_event_implicit_task_end:
83// CHECK-SAME: {{.*}} parallel_id={{[0-9]+}}, task_id=[[IMPL_TASK_01]]
84

source code of openmp/runtime/test/ompt/teams/parallel_team.c