[PATCH] D47824: [OMPT] Add testcases for thread_begin and thread_end callbacks
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 2 02:18:23 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL336086: [OMPT] Add testcases for thread_begin and thread_end callbacks (authored by jprotze, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D47824?vs=150127&id=153683#toc
Repository:
rL LLVM
https://reviews.llvm.org/D47824
Files:
openmp/trunk/runtime/test/ompt/misc/threads.c
openmp/trunk/runtime/test/ompt/misc/threads_nested.c
Index: openmp/trunk/runtime/test/ompt/misc/threads_nested.c
===================================================================
--- openmp/trunk/runtime/test/ompt/misc/threads_nested.c
+++ openmp/trunk/runtime/test/ompt/misc/threads_nested.c
@@ -0,0 +1,38 @@
+// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
+// REQUIRES: ompt
+#include "callback.h"
+#include <omp.h>
+
+int main() {
+ int x = 0;
+ omp_set_nested(1);
+#pragma omp parallel num_threads(2)
+ {
+#pragma omp parallel num_threads(2)
+ {
+#pragma omp atomic
+ x++;
+ }
+ }
+
+ // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
+
+ // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_thread_begin:
+ // CHECK-SAME: thread_type=ompt_thread_initial=1, thread_id=[[MASTER_ID]]
+ // CHECK: {{^}}[[MASTER_ID]]: ompt_event_thread_end:
+ // CHECK-SAME: thread_id=[[MASTER_ID]]
+ // CHECK: {{^}}[[WORKER_ID1:[0-9]+]]: ompt_event_thread_begin:
+ // CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID1]]
+ // CHECK: {{^}}[[WORKER_ID1]]: ompt_event_thread_end:
+ // CHECK-SAME: thread_id=[[WORKER_ID1]]
+ // CHECK: {{^}}[[WORKER_ID2:[0-9]+]]: ompt_event_thread_begin:
+ // CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID2]]
+ // CHECK: {{^}}[[WORKER_ID2]]: ompt_event_thread_end:
+ // CHECK-SAME: thread_id=[[WORKER_ID2]]
+ // CHECK: {{^}}[[WORKER_ID3:[0-9]+]]: ompt_event_thread_begin:
+ // CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID3]]
+ // CHECK: {{^}}[[WORKER_ID3]]: ompt_event_thread_end:
+ // CHECK-SAME: thread_id=[[WORKER_ID3]]
+
+ return 0;
+}
Index: openmp/trunk/runtime/test/ompt/misc/threads.c
===================================================================
--- openmp/trunk/runtime/test/ompt/misc/threads.c
+++ openmp/trunk/runtime/test/ompt/misc/threads.c
@@ -0,0 +1,34 @@
+// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
+// REQUIRES: ompt
+#include "callback.h"
+#include <omp.h>
+
+int main() {
+ int x = 0;
+#pragma omp parallel num_threads(4)
+ {
+#pragma omp atomic
+ x++;
+ }
+
+ // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
+
+ // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_thread_begin:
+ // CHECK-SAME: thread_type=ompt_thread_initial=1, thread_id=[[MASTER_ID]]
+ // CHECK: {{^}}[[MASTER_ID]]: ompt_event_thread_end:
+ // CHECK-SAME: thread_id=[[MASTER_ID]]
+ // CHECK: {{^}}[[WORKER_ID1:[0-9]+]]: ompt_event_thread_begin:
+ // CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID1]]
+ // CHECK: {{^}}[[WORKER_ID1]]: ompt_event_thread_end:
+ // CHECK-SAME: thread_id=[[WORKER_ID1]]
+ // CHECK: {{^}}[[WORKER_ID2:[0-9]+]]: ompt_event_thread_begin:
+ // CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID2]]
+ // CHECK: {{^}}[[WORKER_ID2]]: ompt_event_thread_end:
+ // CHECK-SAME: thread_id=[[WORKER_ID2]]
+ // CHECK: {{^}}[[WORKER_ID3:[0-9]+]]: ompt_event_thread_begin:
+ // CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID3]]
+ // CHECK: {{^}}[[WORKER_ID3]]: ompt_event_thread_end:
+ // CHECK-SAME: thread_id=[[WORKER_ID3]]
+
+ return 0;
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47824.153683.patch
Type: text/x-patch
Size: 3100 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180702/241e58c4/attachment.bin>
More information about the llvm-commits
mailing list