Skip to content

Commit 077040a

Browse files
committed
Merging r338580:
------------------------------------------------------------------------ r338580 | jprotze | 2018-08-01 18:15:18 +0200 (Wed, 01 Aug 2018) | 15 lines [OMPT,tests] Fix taskloop testcase scheduling effects The taskloop testcase had scheduling effects. Tasks of the taskloop would sometimes be scheduled before all task were created. The testing is now split into two phases. First, the task creation on the master is tested, than the scheduling events of the tasks are tested. Thus, the order of creation and scheduling events is irrelavant. Patch by Simon Convent Reviewed by: protze.joachim, Hahnfeld Subscribers: openmp-commits Differential Revision: https://reviews.llvm.org/D50140 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_70@338704 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent a86d025 commit 077040a

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

runtime/test/ompt/tasks/taskloop.c

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
// RUN: %libomp-compile && %libomp-run | FileCheck %s
1+
// RUN: %libomp-compile-and-run | FileCheck %s
2+
// RUN: %libomp-compile-and-run | FileCheck --check-prefix=TASKS %s
23
// REQUIRES: ompt
34
#include "callback.h"
45
#include <omp.h>
56

67
int main() {
7-
unsigned int i, j, x;
8+
unsigned int i, x;
89

910
#pragma omp parallel num_threads(2)
11+
{
12+
#pragma omp barrier
13+
1014
#pragma omp master
1115
#pragma omp taskloop
12-
for (j = 0; j < 5; j += 3) {
13-
x++;
16+
for (i = 0; i < 5; i += 3) {
17+
x++;
18+
}
1419
}
15-
1620
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
1721

1822
// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin:
@@ -39,16 +43,12 @@ int main() {
3943
// CHECK-SAME: new_task_id=[[TASK_ID2:[0-9]+]]
4044
// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS]]
4145
// CHECK-SAME: task_type=ompt_task_explicit=4
46+
// CHECK-NOT: {{^}}[[MASTER_ID]]: ompt_event_task_create:
4247
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_taskloop_end:
4348
// CHECK-SAME: parallel_id=[[PARALLEL_ID]]
4449
// CHECK-SAME: parent_task_id=[[IMPLICIT_TASK_ID1]]
4550
// CHECK-SAME: count=2
4651
// CHECK-DAG: {{^}}[[MASTER_ID]]: ompt_event_wait_taskgroup_begin:
47-
// Schedule events:
48-
// CHECK-DAG: {{^.*}}first_task_id={{[0-9]+}}, second_task_id=[[TASK_ID1]]
49-
// CHECK-DAG: {{^.*}}first_task_id=[[TASK_ID1]], second_task_id={{[0-9]+}}
50-
// CHECK-DAG: {{^.*}}first_task_id={{[0-9]+}}, second_task_id=[[TASK_ID2]]
51-
// CHECK-DAG: {{^.*}}first_task_id=[[TASK_ID2]], second_task_id={{[0-9]+}}
5252
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_wait_taskgroup_end:
5353
// CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID1]]
5454
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_taskgroup_end:
@@ -58,5 +58,18 @@ int main() {
5858
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_parallel_end:
5959
// CHECK-SAME: parallel_id=[[PARALLEL_ID]]
6060

61+
// TASKS: ompt_event_task_create:{{.*}} new_task_id={{[0-9]+}}
62+
// TASKS-SAME: task_type=ompt_task_initial
63+
// TASKS: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_taskloop_begin:
64+
// TASKS: ompt_event_task_create:{{.*}} new_task_id=[[TASK_ID1:[0-9]+]]
65+
// TASKS-SAME: task_type=ompt_task_explicit
66+
// TASKS-DAG: ompt_event_task_create:{{.*}} new_task_id=[[TASK_ID2:[0-9]+]]
67+
// Schedule events:
68+
// TASKS-DAG: {{^.*}}first_task_id={{[0-9]+}}, second_task_id=[[TASK_ID1]]
69+
// TASKS-DAG: {{^.*}}first_task_id=[[TASK_ID1]], second_task_id={{[0-9]+}}
70+
// TASKS-DAG: {{^.*}}first_task_id={{[0-9]+}}, second_task_id=[[TASK_ID2]]
71+
// TASKS-DAG: {{^.*}}first_task_id=[[TASK_ID2]], second_task_id={{[0-9]+}}
72+
// TASKS-NOT: ompt_event_task_schedule
73+
6174
return 0;
6275
}

0 commit comments

Comments
 (0)