[Openmp-commits] [openmp] r349457 - [OMPT] Add testcase for thread_num provided by implicit task events

Joachim Protze via Openmp-commits openmp-commits at lists.llvm.org
Tue Dec 18 00:52:12 PST 2018


Author: jprotze
Date: Tue Dec 18 00:52:12 2018
New Revision: 349457

URL: http://llvm.org/viewvc/llvm-project?rev=349457&view=rev
Log:
[OMPT] Add testcase for thread_num provided by implicit task events

Added:
    openmp/trunk/runtime/test/ompt/parallel/nested_threadnum.c

Added: openmp/trunk/runtime/test/ompt/parallel/nested_threadnum.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/ompt/parallel/nested_threadnum.c?rev=349457&view=auto
==============================================================================
--- openmp/trunk/runtime/test/ompt/parallel/nested_threadnum.c (added)
+++ openmp/trunk/runtime/test/ompt/parallel/nested_threadnum.c Tue Dec 18 00:52:12 2018
@@ -0,0 +1,61 @@
+// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
+// REQUIRES: ompt
+#include <omp.h>
+#include "callback.h"
+
+int main() {
+  omp_set_nested(1);
+#pragma omp parallel num_threads(2)
+  {
+#pragma omp parallel num_threads(2)
+    { print_frame(0); }
+  }
+
+  // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
+
+  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin:
+  // CHECK-SAME: parallel_id=[[PARALLEL_ID:[0-9]+]]
+  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin:
+  // CHECK-SAME: parallel_id=[[PARALLEL_ID]]
+  // CHECK-SAME: thread_num=[[OUTER_THREAD_NUM1:[0-9]+]]
+  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_parallel_begin:
+  // CHECK-SAME: parallel_id=[[INNER_PARALLEL_ID1:[0-9]+]]
+  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin:
+  // CHECK-SAME: parallel_id=[[INNER_PARALLEL_ID1]]
+  // CHECK-SAME: thread_num=[[INNER_THREAD_NUM1:[0-9]+]]
+  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_end
+  // CHECK-SAME: thread_num=[[INNER_THREAD_NUM1]]
+  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_parallel_end:
+  // CHECK-SAME: parallel_id=[[INNER_PARALLEL_ID1]]
+  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_end
+  // CHECK-SAME: thread_num=[[OUTER_THREAD_NUM1]]
+  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_parallel_end:
+  // CHECK-SAME: parallel_id=[[PARALLEL_ID]]
+
+  // CHECK: {{^}}[[WORKER_ID1:[0-9]+]]: ompt_event_implicit_task_begin:
+  // CHECK-SAME: parallel_id=[[PARALLEL_ID]]
+  // CHECK-SAME: thread_num=[[OUTER_THREAD_NUM2:[0-9]+]]
+  // CHECK: {{^}}[[WORKER_ID1]]: ompt_event_parallel_begin:
+  // CHECK-SAME: parallel_id=[[INNER_PARALLEL_ID2:[0-9]+]]
+  // CHECK: {{^}}[[WORKER_ID1]]: ompt_event_implicit_task_begin:
+  // CHECK-SAME: parallel_id=[[INNER_PARALLEL_ID2]]
+  // CHECK-SAME: thread_num=[[INNER_THREAD_NUM2:[0-9]+]]
+  // CHECK: {{^}}[[WORKER_ID1]]: ompt_event_implicit_task_end
+  // CHECK-SAME: thread_num=[[INNER_THREAD_NUM2]]
+  // CHECK: {{^}}[[WORKER_ID1]]: ompt_event_parallel_end:
+  // CHECK-SAME: parallel_id=[[INNER_PARALLEL_ID2]]
+  // CHECK: {{^}}[[WORKER_ID1]]: ompt_event_implicit_task_end
+  // CHECK-SAME: thread_num=[[OUTER_THREAD_NUM2]]
+
+  // CHECK: {{^}}[[WORKER_ID2:[0-9]+]]: ompt_event_implicit_task_begin:
+  // CHECK-SAME: thread_num=[[INNER_THREAD_NUM3:[0-9]+]]
+  // CHECK: {{^}}[[WORKER_ID2]]: ompt_event_implicit_task_end
+  // CHECK-SAME: thread_num=[[INNER_THREAD_NUM3]]
+
+  // CHECK: {{^}}[[WORKER_ID3:[0-9]+]]: ompt_event_implicit_task_begin:
+  // CHECK-SAME: thread_num=[[INNER_THREAD_NUM4:[0-9]+]]
+  // CHECK: {{^}}[[WORKER_ID3]]: ompt_event_implicit_task_end
+  // CHECK-SAME: thread_num=[[INNER_THREAD_NUM4]]
+
+  return 0;
+}




More information about the Openmp-commits mailing list