[Openmp-commits] [PATCH] D14746: Add support for ompt_event_task_dependences and ompt_event_task_dependence_pair

Jonas Hahnfeld via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 27 01:57:31 PST 2016


Hahnfeld added a subscriber: Hahnfeld.
Hahnfeld added a comment.

Changes LGTM as well but compilation fails with `LIBOMP_OMPT_SUPPORT=ON` and `LIBOMP_OMP_VERSION=30` (rather theoretical combination).

(Note: `kmp_taskdeps.cpp` is only compiled if `LIBOMP_OMP_VERSION >= 40` so you don't have to guard this)


================
Comment at: runtime/src/kmp_tasking.c:466-481
@@ -465,2 +465,18 @@
 #endif
+#if OMPT_SUPPORT && OMPT_TRACE
+    /* OMPT emit all dependences if requested by the tool */
+    if (ompt_enabled && taskdata->ompt_task_info.ndeps > 0 &&
+        ompt_callbacks.ompt_callback(ompt_event_task_dependences))
+	{
+        ompt_callbacks.ompt_callback(ompt_event_task_dependences)(
+            taskdata->ompt_task_info.task_id,
+            taskdata->ompt_task_info.deps,
+            taskdata->ompt_task_info.ndeps
+        );
+		/* We can now free the allocated memory for the dependencies */
+		KMP_OMPT_DEPS_FREE (thread, taskdata->ompt_task_info.deps);
+        taskdata->ompt_task_info.deps = NULL;
+        taskdata->ompt_task_info.ndeps = 0;
+    }
+#endif /* OMPT_SUPPORT && OMPT_TRACE */
 
----------------
Please guard with `#if OMP_40_ENABLED`

================
Comment at: runtime/src/kmp_tasking.c:781-782
@@ -764,2 +780,4 @@
         task->ompt_task_info.frame.reenter_runtime_frame = NULL;
+        task->ompt_task_info.ndeps = 0;
+        task->ompt_task_info.deps = NULL;
     }
----------------
see above

================
Comment at: runtime/src/ompt-event-specific.h:144-145
@@ -143,1 +143,4 @@
 
+#define ompt_event_task_dependences_implemented         ompt_event_MAY_ALWAYS_TRACE
+#define ompt_event_task_dependence_pair_implemented     ompt_event_MAY_ALWAYS_TRACE
+
----------------
see above

================
Comment at: runtime/src/ompt-internal.h:32-33
@@ -32,1 +31,4 @@
+    ompt_task_id_t          task_id;
+    int                     ndeps;
+    ompt_task_dependence_t  *deps;
 } ompt_task_info_t;
----------------
see above

================
Comment at: runtime/src/ompt-internal.h:67-75
@@ -64,1 +66,11 @@
 
+#if OMPT_SUPPORT && OMPT_TRACE
+#if USE_FAST_MEMORY
+#  define KMP_OMPT_DEPS_ALLOC __kmp_fast_allocate
+#  define KMP_OMPT_DEPS_FREE __kmp_fast_free
+# else
+#  define KMP_OMPT_DEPS_ALLOC __kmp_thread_malloc
+#  define KMP_OMPT_DEPS_FREE __kmp_thread_free
+# endif
+#endif /* OMPT_SUPPORT && OMPT_TRACE */
+
----------------
see above


http://reviews.llvm.org/D14746





More information about the Openmp-commits mailing list