summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/include/40/ompt.h.var
diff options
context:
space:
mode:
authorJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>2016-01-28 10:39:52 +0000
committerJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>2016-01-28 10:39:52 +0000
commit39b686248264e7700c48d54a6e01c02563befa68 (patch)
treed5223f58665a1bffb646a1728a148831d83830b9 /openmp/runtime/src/include/40/ompt.h.var
parentdbf627dbd49bf58c94b45f5f98605b2a951f5fef (diff)
downloadbcm5719-llvm-39b686248264e7700c48d54a6e01c02563befa68.tar.gz
bcm5719-llvm-39b686248264e7700c48d54a6e01c02563befa68.zip
[OMPT] Add support for ompt_event_task_dependences and ompt_event_task_dependence_pair
The attached patch adds support for ompt_event_task_dependences and ompt_event_task_dependence_pair events from the OMPT specification [1]. These events only apply to OpenMP 4.0 and 4.1 (aka 4.5) because task dependencies were introduced in 4.0. With respect to the changes: ompt_event_task_dependences According to the specification, this event is raised after the task has been created, thefore this event needs to be raised after ompt_event_task_begin (in __kmp_task_start). However, the dependencies are known at __kmpc_omp_task_with_deps which occurs before __kmp_task_start. My modifications extend the ompt_task_info_t struct in order to store the dependencies of the task when _kmpc_omp_task_with_deps occurs and then they are emitted in __kmp_task_start just after raising the ompt_event_task_begin. The deps field is allocated and valid until the event is raised and it is freed and set to null afterwards. ompt_event_task_dependence_pair The processing of the dependences (i.e. checking whenever a dependence is already satisfied) is done within __kmp_process_deps. That function checks every dependence and calls the __kmp_track_dependence routine which gives some support for graphical output. I used that routine to emit the dependence pair but I also needed to know the sink_task. Despite the fact that the code within KMP_SUPPORT_GRAPH_OUTPUT refers to task_sink it may be null because sink->dn.task (there's a comment regarding this) and in fact it does not point to a proper pointer value because the value is set in node->dn.task = task; after the __kmp_process_deps calls in __kmp_check_deps. I have extended the __kmp_process_deps and __kmp_track_dependence parameter list to receive the sink_task. [1] https://github.com/OpenMPToolsInterface/OMPT-Technical-Report/blob/target/ompt-tr.pdf Patch by Harald Servat Differential Revision: http://reviews.llvm.org/D14746 llvm-svn: 259038
Diffstat (limited to 'openmp/runtime/src/include/40/ompt.h.var')
-rw-r--r--openmp/runtime/src/include/40/ompt.h.var29
1 files changed, 28 insertions, 1 deletions
diff --git a/openmp/runtime/src/include/40/ompt.h.var b/openmp/runtime/src/include/40/ompt.h.var
index a1387fab43b..ff1d86be859 100644
--- a/openmp/runtime/src/include/40/ompt.h.var
+++ b/openmp/runtime/src/include/40/ompt.h.var
@@ -171,7 +171,10 @@
macro (ompt_event_destroy_lock, ompt_wait_callback_t, 59) /* lock destruction */ \
macro (ompt_event_destroy_nest_lock, ompt_wait_callback_t, 60) /* nest lock destruction */ \
\
- macro (ompt_event_flush, ompt_callback_t, 61) /* after executing flush */
+ macro (ompt_event_flush, ompt_callback_t, 61) /* after executing flush */ \
+ \
+ macro (ompt_event_task_dependences, ompt_task_dependences_callback_t, 69) /* report task dependences */\
+ macro (ompt_event_task_dependence_pair, ompt_task_pair_callback_t, 70) /* report task dependence pair */
@@ -206,6 +209,23 @@ typedef struct ompt_frame_s {
} ompt_frame_t;
+/*---------------------
+ * dependences types
+ *---------------------*/
+
+typedef enum ompt_task_dependence_flag_e {
+ // a two bit field for the dependence type
+ ompt_task_dependence_type_out = 1,
+ ompt_task_dependence_type_in = 2,
+ ompt_task_dependence_type_inout = 3,
+} ompt_task_dependence_flag_t;
+
+typedef struct ompt_task_dependence_s {
+ void *variable_addr;
+ uint32_t dependence_flags;
+} ompt_task_dependence_t;
+
+
/*****************************************************************************
* enumerations for thread states and runtime events
*****************************************************************************/
@@ -325,6 +345,13 @@ typedef void (*ompt_new_task_callback_t) (
void *task_function /* pointer to outlined function */
);
+/* task dependences */
+typedef void (*ompt_task_dependences_callback_t) (
+ ompt_task_id_t task_id, /* ID of task with dependences */
+ const ompt_task_dependence_t *deps,/* vector of task dependences */
+ int ndeps /* number of dependences */
+);
+
/* program */
typedef void (*ompt_control_callback_t) (
uint64_t command, /* command of control call */
OpenPOWER on IntegriCloud