summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/test
diff options
context:
space:
mode:
authorJoachim Protze <protze@itc.rwth-aachen.de>2019-01-15 15:36:53 +0000
committerJoachim Protze <protze@itc.rwth-aachen.de>2019-01-15 15:36:53 +0000
commit2b46d30fc7049fc5cc5b9f98df654509bb4d61a2 (patch)
treee7fd23a7f6aa013b96787936e4785fb8e4f2bc5f /openmp/runtime/test
parentabdc13a08af81d2f6f196e4ecee88b0f1c1303c3 (diff)
downloadbcm5719-llvm-2b46d30fc7049fc5cc5b9f98df654509bb4d61a2.tar.gz
bcm5719-llvm-2b46d30fc7049fc5cc5b9f98df654509bb4d61a2.zip
[OMPT] Second chunk of final OMPT 5.0 interface updates
The omp-tools.h file is generated from the OpenMP spec to ensure that the interface is implemented as specified. The other changes are necessary to update the interface implementation to the final version as published in 5.0. The omp-tools.h header was previously called ompt.h, currently a copy under this name is installed for legacy tools. Patch partially perpared by @sconvent Reviewers: AndreyChurbanov, hbae, Hahnfeld Reviewed By: hbae Tags: #openmp, #ompt Differential Revision: https://reviews.llvm.org/D55579 llvm-svn: 351197
Diffstat (limited to 'openmp/runtime/test')
-rw-r--r--openmp/runtime/test/lit.cfg2
-rwxr-xr-xopenmp/runtime/test/ompt/callback.h29
-rw-r--r--openmp/runtime/test/ompt/cancel/cancel_taskgroup.c2
-rw-r--r--openmp/runtime/test/ompt/loadtool/tool_available/tool_available.c2
-rw-r--r--openmp/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c4
-rw-r--r--openmp/runtime/test/ompt/loadtool/tool_not_available/tool_not_available.c4
-rw-r--r--openmp/runtime/test/ompt/parallel/parallel_if0.c2
-rw-r--r--openmp/runtime/test/ompt/parallel/serialized.c2
-rw-r--r--openmp/runtime/test/ompt/synchronization/barrier/implicit_task_data.c2
-rw-r--r--openmp/runtime/test/ompt/tasks/explicit_task.c2
-rw-r--r--openmp/runtime/test/ompt/tasks/taskyield.c2
11 files changed, 32 insertions, 21 deletions
diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg
index 02abba03d4f..3c6b57d8ed9 100644
--- a/openmp/runtime/test/lit.cfg
+++ b/openmp/runtime/test/lit.cfg
@@ -127,7 +127,7 @@ config.substitutions.append(("%flags", config.test_flags))
config.substitutions.append(("%python", '"%s"' % (sys.executable)))
if config.has_ompt:
- config.substitutions.append(("FileCheck", config.test_filecheck))
+ config.substitutions.append(("FileCheck", "tee %%s.out | %s" % config.test_filecheck))
config.substitutions.append(("%sort-threads", "sort -n -s"))
if config.operating_system == 'Windows':
# No such environment variable on Windows.
diff --git a/openmp/runtime/test/ompt/callback.h b/openmp/runtime/test/ompt/callback.h
index 0304cff6f1a..a7bd7fe7a0b 100755
--- a/openmp/runtime/test/ompt/callback.h
+++ b/openmp/runtime/test/ompt/callback.h
@@ -8,7 +8,7 @@
#endif
#include <inttypes.h>
#include <omp.h>
-#include <ompt.h>
+#include <omp-tools.h>
#include "ompt-signal.h"
// Used to detect architecture
@@ -23,10 +23,13 @@ static const char* ompt_thread_t_values[] = {
static const char* ompt_task_status_t_values[] = {
NULL,
- "ompt_task_complete",
- "ompt_task_yield",
- "ompt_task_cancel",
- "ompt_task_others"
+ "ompt_task_complete", // 1
+ "ompt_task_yield", // 2
+ "ompt_task_cancel", // 3
+ "ompt_task_detach", // 4
+ "ompt_task_early_fulfill", // 5
+ "ompt_task_late_fulfill", // 6
+ "ompt_task_switch" // 7
};
static const char* ompt_cancel_flag_t_values[] = {
"ompt_cancel_parallel",
@@ -439,7 +442,8 @@ on_ompt_callback_implicit_task(
ompt_data_t *parallel_data,
ompt_data_t *task_data,
unsigned int team_size,
- unsigned int thread_num)
+ unsigned int thread_num,
+ int flags)
{
switch(endpoint)
{
@@ -651,9 +655,9 @@ on_ompt_callback_task_schedule(
}
static void
-on_ompt_callback_task_dependences(
+on_ompt_callback_dependences(
ompt_data_t *task_data,
- const ompt_task_dependence_t *deps,
+ const ompt_dependence_t *deps,
int ndeps)
{
printf("%" PRIu64 ": ompt_event_task_dependences: task_id=%" PRIu64 ", deps=%p, ndeps=%d\n", ompt_get_thread_data()->value, task_data->value, (void *)deps, ndeps);
@@ -710,6 +714,7 @@ do{ \
int ompt_initialize(
ompt_function_lookup_t lookup,
+ int initial_device_num,
ompt_data_t *tool_data)
{
ompt_set_callback = (ompt_set_callback_t) lookup("ompt_set_callback");
@@ -747,7 +752,7 @@ int ompt_initialize(
register_callback(ompt_callback_parallel_end);
register_callback(ompt_callback_task_create);
register_callback(ompt_callback_task_schedule);
- register_callback(ompt_callback_task_dependences);
+ register_callback(ompt_callback_dependences);
register_callback(ompt_callback_task_dependence);
register_callback(ompt_callback_thread_begin);
register_callback(ompt_callback_thread_end);
@@ -760,6 +765,9 @@ void ompt_finalize(ompt_data_t *tool_data)
printf("0: ompt_event_runtime_shutdown\n");
}
+#ifdef __cplusplus
+extern "C" {
+#endif
ompt_start_tool_result_t* ompt_start_tool(
unsigned int omp_version,
const char *runtime_version)
@@ -767,3 +775,6 @@ ompt_start_tool_result_t* ompt_start_tool(
static ompt_start_tool_result_t ompt_start_tool_result = {&ompt_initialize,&ompt_finalize, 0};
return &ompt_start_tool_result;
}
+#ifdef __cplusplus
+}
+#endif
diff --git a/openmp/runtime/test/ompt/cancel/cancel_taskgroup.c b/openmp/runtime/test/ompt/cancel/cancel_taskgroup.c
index 803fa9739bd..fce39c91f70 100644
--- a/openmp/runtime/test/ompt/cancel/cancel_taskgroup.c
+++ b/openmp/runtime/test/ompt/cancel/cancel_taskgroup.c
@@ -75,7 +75,7 @@ int main()
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create: parent_task_id=[[PARENT_TASK_ID]], parent_task_frame.exit={{0x[0-f]*}}, parent_task_frame.reenter={{0x[0-f]*}}, new_task_id=[[THIRD_TASK_ID:[0-9]+]], codeptr_ra={{0x[0-f]*}}, task_type=ompt_task_explicit=4, has_dependences=no
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create: parent_task_id=[[PARENT_TASK_ID]], parent_task_frame.exit={{0x[0-f]*}}, parent_task_frame.reenter={{0x[0-f]*}}, new_task_id=[[CANCEL_TASK_ID:[0-9]+]], codeptr_ra={{0x[0-f]*}}, task_type=ompt_task_explicit|ompt_task_undeferred=134217732, has_dependences=no
- // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_schedule: first_task_id=[[PARENT_TASK_ID]], second_task_id=[[CANCEL_TASK_ID]], prior_task_status=ompt_task_others=4
+ // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_schedule: first_task_id=[[PARENT_TASK_ID]], second_task_id=[[CANCEL_TASK_ID]], prior_task_status=ompt_task_switch=7
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_cancel: task_data=[[CANCEL_TASK_ID]], flags=ompt_cancel_taskgroup|ompt_cancel_activated=24, codeptr_ra={{0x[0-f]*}}
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_schedule: first_task_id=[[CANCEL_TASK_ID]], second_task_id=[[PARENT_TASK_ID]], prior_task_status=ompt_task_cancel=3
diff --git a/openmp/runtime/test/ompt/loadtool/tool_available/tool_available.c b/openmp/runtime/test/ompt/loadtool/tool_available/tool_available.c
index fbbdadd5c42..25187fdb06d 100644
--- a/openmp/runtime/test/ompt/loadtool/tool_available/tool_available.c
+++ b/openmp/runtime/test/ompt/loadtool/tool_available/tool_available.c
@@ -49,7 +49,7 @@ int main()
#ifdef TOOL
#include <stdio.h>
-#include <ompt.h>
+#include <omp-tools.h>
int ompt_initialize(
ompt_function_lookup_t lookup,
diff --git a/openmp/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c b/openmp/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c
index 0f664888b72..fedfebe39f0 100644
--- a/openmp/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c
+++ b/openmp/runtime/test/ompt/loadtool/tool_available_search/tool_available_search.c
@@ -18,7 +18,7 @@
#ifdef CODE
#include "stdio.h"
#include "omp.h"
-#include "ompt.h"
+#include "omp-tools.h"
int main()
{
@@ -52,7 +52,7 @@ int main()
#ifdef TOOL
-#include <ompt.h>
+#include <omp-tools.h>
#include "stdio.h"
#ifdef SECOND_TOOL
diff --git a/openmp/runtime/test/ompt/loadtool/tool_not_available/tool_not_available.c b/openmp/runtime/test/ompt/loadtool/tool_not_available/tool_not_available.c
index b0d3f2bcf5b..ea4046831be 100644
--- a/openmp/runtime/test/ompt/loadtool/tool_not_available/tool_not_available.c
+++ b/openmp/runtime/test/ompt/loadtool/tool_not_available/tool_not_available.c
@@ -28,7 +28,7 @@
#ifdef CODE
#include "stdio.h"
#include "omp.h"
-#include "ompt.h"
+#include "omp-tools.h"
int main()
{
@@ -56,7 +56,7 @@ int main()
#ifdef TOOL
-#include <ompt.h>
+#include <omp-tools.h>
#include "stdio.h"
ompt_start_tool_result_t* ompt_start_tool(
diff --git a/openmp/runtime/test/ompt/parallel/parallel_if0.c b/openmp/runtime/test/ompt/parallel/parallel_if0.c
index f5c44542efc..63d670107f8 100644
--- a/openmp/runtime/test/ompt/parallel/parallel_if0.c
+++ b/openmp/runtime/test/ompt/parallel/parallel_if0.c
@@ -57,7 +57,7 @@ int main()
// CHECK: {{^}}[[MASTER_ID]]: task level 2: parallel_id=[[IMPLICIT_PARALLEL_ID]], task_id=[[PARENT_TASK_ID]], exit_frame=[[NULL]], reenter_frame={{0x[0-f]+}}
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create: parent_task_id=[[NESTED_IMPLICIT_TASK_ID]], parent_task_frame.exit={{0x[0-f]+}}, parent_task_frame.reenter={{0x[0-f]+}}, new_task_id=[[EXPLICIT_TASK_ID:[0-9]+]]
- // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_schedule: first_task_id=[[NESTED_IMPLICIT_TASK_ID]], second_task_id=[[EXPLICIT_TASK_ID]], prior_task_status=ompt_task_others=4
+ // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_schedule: first_task_id=[[NESTED_IMPLICIT_TASK_ID]], second_task_id=[[EXPLICIT_TASK_ID]], prior_task_status=ompt_task_switch=7
// CHECK: {{^}}[[MASTER_ID]]: task level 0: parallel_id=[[NESTED_PARALLEL_ID]], task_id=[[EXPLICIT_TASK_ID]], exit_frame={{0x[0-f]+}}, reenter_frame=[[NULL]]
// CHECK: {{^}}[[MASTER_ID]]: task level 1: parallel_id=[[NESTED_PARALLEL_ID]], task_id=[[NESTED_IMPLICIT_TASK_ID]], exit_frame={{0x[0-f]+}}, reenter_frame={{0x[0-f]+}}
// CHECK: {{^}}[[MASTER_ID]]: task level 2: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]], exit_frame={{0x[0-f]+}}, reenter_frame={{0x[0-f]+}}
diff --git a/openmp/runtime/test/ompt/parallel/serialized.c b/openmp/runtime/test/ompt/parallel/serialized.c
index e7a9207170b..2be17dcafb0 100644
--- a/openmp/runtime/test/ompt/parallel/serialized.c
+++ b/openmp/runtime/test/ompt/parallel/serialized.c
@@ -57,7 +57,7 @@ int main()
// CHECK: {{^}}[[MASTER_ID]]: task level 2: parallel_id=[[IMPLICIT_PARALLEL_ID]], task_id=[[PARENT_TASK_ID]], exit_frame=[[NULL]], reenter_frame={{0x[0-f]+}}
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create: parent_task_id=[[NESTED_IMPLICIT_TASK_ID]], parent_task_frame.exit={{0x[0-f]+}}, parent_task_frame.reenter={{0x[0-f]+}}, new_task_id=[[EXPLICIT_TASK_ID:[0-9]+]]
- // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_schedule: first_task_id=[[NESTED_IMPLICIT_TASK_ID]], second_task_id=[[EXPLICIT_TASK_ID]], prior_task_status=ompt_task_others=4
+ // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_schedule: first_task_id=[[NESTED_IMPLICIT_TASK_ID]], second_task_id=[[EXPLICIT_TASK_ID]], prior_task_status=ompt_task_switch=7
// CHECK: {{^}}[[MASTER_ID]]: task level 0: parallel_id=[[NESTED_PARALLEL_ID]], task_id=[[EXPLICIT_TASK_ID]], exit_frame={{0x[0-f]+}}, reenter_frame=[[NULL]]
// CHECK: {{^}}[[MASTER_ID]]: task level 1: parallel_id=[[NESTED_PARALLEL_ID]], task_id=[[NESTED_IMPLICIT_TASK_ID]], exit_frame={{0x[0-f]+}}, reenter_frame={{0x[0-f]+}}
// CHECK: {{^}}[[MASTER_ID]]: task level 2: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]], exit_frame={{0x[0-f]+}}, reenter_frame={{0x[0-f]+}}
diff --git a/openmp/runtime/test/ompt/synchronization/barrier/implicit_task_data.c b/openmp/runtime/test/ompt/synchronization/barrier/implicit_task_data.c
index 5cfbe006eec..c933e8925d5 100644
--- a/openmp/runtime/test/ompt/synchronization/barrier/implicit_task_data.c
+++ b/openmp/runtime/test/ompt/synchronization/barrier/implicit_task_data.c
@@ -12,7 +12,7 @@
#include <unistd.h>
#include <inttypes.h>
#include <omp.h>
-#include <ompt.h>
+#include <omp-tools.h>
static const char* ompt_thread_t_values[] = {
NULL,
diff --git a/openmp/runtime/test/ompt/tasks/explicit_task.c b/openmp/runtime/test/ompt/tasks/explicit_task.c
index a986c48ee89..65bc1b2ddfd 100644
--- a/openmp/runtime/test/ompt/tasks/explicit_task.c
+++ b/openmp/runtime/test/ompt/tasks/explicit_task.c
@@ -1,4 +1,4 @@
-// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
+// RUN: %libomp-compile-and-run | %sort-threads | tee %s.out | FileCheck %s
// REQUIRES: ompt
// UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
#define TEST_NEED_PRINT_FRAME_FROM_OUTLINED_FN
diff --git a/openmp/runtime/test/ompt/tasks/taskyield.c b/openmp/runtime/test/ompt/tasks/taskyield.c
index 56a46970cf3..2dd0fa1ae49 100644
--- a/openmp/runtime/test/ompt/tasks/taskyield.c
+++ b/openmp/runtime/test/ompt/tasks/taskyield.c
@@ -51,7 +51,7 @@ int main()
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_schedule: first_task_id=[[IMPLICIT_TASK_ID]], second_task_id=[[MAIN_TASK]], prior_task_status=ompt_task_yield=2
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_schedule: first_task_id=[[MAIN_TASK]], second_task_id=[[IMPLICIT_TASK_ID]], prior_task_status=ompt_task_complete=1
- // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_task_schedule: first_task_id={{[0-9]+}}, second_task_id=[[WORKER_TASK]], prior_task_status=ompt_task_others=4
+ // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_task_schedule: first_task_id={{[0-9]+}}, second_task_id=[[WORKER_TASK]], prior_task_status=ompt_task_switch=7
// CHECK: {{^}}[[THREAD_ID]]: ompt_event_task_schedule: first_task_id=[[WORKER_TASK]], second_task_id={{[0-9]+}}, prior_task_status=ompt_task_complete=1
OpenPOWER on IntegriCloud