Просмотр исходного кода

Merge branch 'master' of git+ssh://scm.gforge.inria.fr/gitroot/starpu/starpu

Olivier Aumage лет назад: 7
Родитель
Сommit
f121913c8b

+ 3 - 0
ChangeLog

@@ -98,6 +98,9 @@ Small features:
    starpu_task_insert_data_process_arg,
    starpu_task_insert_data_process_array_arg,
    starpu_task_insert_data_process_mode_array_arg
+   * Do not show internal tasks in fxt dag by default. Allow to hide
+   acquisitions too.
+   * Add a way to choose the dag.dot colors.
 
 StarPU 1.2.3 (svn revision 22444)
 ==============================================

+ 14 - 0
doc/doxygen/chapters/api/codelet_and_tasks.doxy

@@ -415,6 +415,10 @@ compiler implicitly do it in e.g. static storage case.
     Optional name of the codelet. This can be useful for debugging
     purposes.
 
+\var const char *starpu_codelet::color
+    Optional color of the codelet. This can be useful for debugging
+    purposes.
+
 \var const char *starpu_codelet::flags
     Various flags for the codelet.
 
@@ -752,6 +756,16 @@ the configuration of a task allocated with starpu_task_create().
     right value. This will hence avoid submitting tasks which have not
     been properly initialised.
 
+\var unsigned starpu_task::type
+    This field allows to specify the type of task, for filtering
+    out tasks in profiling outputs, whether it is really internal
+    to StarPU (::STARPU_TASK_TYPE_INTERNAL), a data acquisition
+    synchronization task (STARPU_TASK_TYPE_DATA_ACQUIRE), or a normal task
+    (::STARPU_TASK_TYPE_NORMAL)
+
+\var int starpu_task::color
+    This field allows to specify the color of the task to be used in dag.dot.
+
 \var unsigned starpu_task::sched_ctx
     Scheduling context.
 

+ 7 - 4
examples/cholesky/cholesky_kernels.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2008-2015,2017                           Université de Bordeaux
+ * Copyright (C) 2008-2015,2017-2018                           Université de Bordeaux
  * Copyright (C) 2010-2012,2015,2017                      CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -312,7 +312,8 @@ struct starpu_codelet cl11 =
 #endif
 	.nbuffers = 1,
 	.modes = { STARPU_RW },
-	.model = &chol_model_11
+	.model = &chol_model_11,
+	.color = 0xffff00,
 };
 
 struct starpu_codelet cl21 =
@@ -328,7 +329,8 @@ struct starpu_codelet cl21 =
 	.cuda_flags = {STARPU_CUDA_ASYNC},
 	.nbuffers = 2,
 	.modes = { STARPU_R, STARPU_RW },
-	.model = &chol_model_21
+	.model = &chol_model_21,
+	.color = 0x8080ff,
 };
 
 struct starpu_codelet cl22 =
@@ -345,5 +347,6 @@ struct starpu_codelet cl22 =
 	.cuda_flags = {STARPU_CUDA_ASYNC},
 	.nbuffers = 3,
 	.modes = { STARPU_R, STARPU_R, STARPU_RW },
-	.model = &chol_model_22
+	.model = &chol_model_22,
+	.color = 0x00ff00,
 };

+ 5 - 1
examples/lu/xlu.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2011,2014-2015,2017                 Université de Bordeaux
+ * Copyright (C) 2009-2011,2014-2015,2017-2018                 Université de Bordeaux
  * Copyright (C) 2010                                     Mehdi Juhoor
  * Copyright (C) 2010-2013,2015,2017,2018                 CNRS
  * Copyright (C) 2013                                     Inria
@@ -43,6 +43,7 @@ static struct starpu_task *create_task_11(starpu_data_handle_t dataA, unsigned k
 	struct starpu_task *task = create_task(TAG11(k));
 
 	task->cl = &cl11;
+	task->color = 0xffff00;
 
 	/* which sub-data is manipulated ? */
 	task->handles[0] = starpu_data_get_sub_data(dataA, 2, k, k);
@@ -69,6 +70,7 @@ static int create_task_12(starpu_data_handle_t dataA, unsigned k, unsigned j, un
 	struct starpu_task *task = create_task(TAG12(k, j));
 
 	task->cl = &cl12;
+	task->color = 0x8080ff;
 
 	/* which sub-data is manipulated ? */
 	task->handles[0] = starpu_data_get_sub_data(dataA, 2, k, k);
@@ -100,6 +102,7 @@ static int create_task_21(starpu_data_handle_t dataA, unsigned k, unsigned i, un
 	struct starpu_task *task = create_task(TAG21(k, i));
 
 	task->cl = &cl21;
+	task->color = 0x8080c0;
 
 	/* which sub-data is manipulated ? */
 	task->handles[0] = starpu_data_get_sub_data(dataA, 2, k, k);
@@ -134,6 +137,7 @@ static int create_task_22(starpu_data_handle_t dataA, unsigned k, unsigned i, un
 	struct starpu_task *task = create_task(TAG22(k, i, j));
 
 	task->cl = &cl22;
+	task->color = 0x00ff00;
 
 	/* which sub-data is manipulated ? */
 	task->handles[0] = starpu_data_get_sub_data(dataA, 2, k, i); /* produced by TAG21(k, i) */

+ 5 - 1
examples/lu/xlu_implicit.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2011,2014-2015,2017                 Université de Bordeaux
+ * Copyright (C) 2010-2011,2014-2015,2017-2018            Université de Bordeaux
  * Copyright (C) 2010                                     Mehdi Juhoor
  * Copyright (C) 2010-2013,2015-2018                      CNRS
  * Copyright (C) 2013                                     Inria
@@ -32,6 +32,7 @@ static int create_task_11(starpu_data_handle_t dataA, unsigned k, unsigned no_pr
 	task->handles[0] = starpu_data_get_sub_data(dataA, 2, k, k);
 
 	task->tag_id = TAG11(k);
+	task->color = 0xffff00;
 
 	/* this is an important task */
 	if (!no_prio)
@@ -53,6 +54,7 @@ static int create_task_12(starpu_data_handle_t dataA, unsigned k, unsigned j, un
 	task->handles[1] = starpu_data_get_sub_data(dataA, 2, j, k);
 
 	task->tag_id = TAG12(k,j);
+	task->color = 0x8080ff;
 
 	if (!no_prio && (j == k+1))
 		task->priority = STARPU_MAX_PRIO;
@@ -74,6 +76,7 @@ static int create_task_21(starpu_data_handle_t dataA, unsigned k, unsigned i, un
 	task->handles[1] = starpu_data_get_sub_data(dataA, 2, k, i);
 
 	task->tag_id = TAG21(k,i);
+	task->color = 0x8080c0;
 
 	if (!no_prio && (i == k+1))
 		task->priority = STARPU_MAX_PRIO;
@@ -89,6 +92,7 @@ static int create_task_22(starpu_data_handle_t dataA, unsigned k, unsigned i, un
 	struct starpu_task *task = starpu_task_create();
 
 	task->cl = &cl22;
+	task->color = 0x00ff00;
 
 	/* which sub-data is manipulated ? */
 	task->handles[0] = starpu_data_get_sub_data(dataA, 2, k, i);

+ 6 - 1
examples/lu/xlu_implicit_pivot.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2015,2017                           Université de Bordeaux
+ * Copyright (C) 2010-2015,2017-2018                           Université de Bordeaux
  * Copyright (C) 2010                                     Mehdi Juhoor
  * Copyright (C) 2010-2013,2015-2018                      CNRS
  * Copyright (C) 2013                                     Inria
@@ -37,6 +37,7 @@ static int create_task_pivot(starpu_data_handle_t *dataAp, unsigned nblocks,
 	struct starpu_task *task = starpu_task_create();
 
 	task->cl = &cl_pivot;
+	task->color = 0xc0c000;
 
 	/* which sub-data is manipulated ? */
 	task->handles[0] = get_block(dataAp, nblocks, k, i);
@@ -63,6 +64,7 @@ static int create_task_11_pivot(starpu_data_handle_t *dataAp, unsigned nblocks,
 	struct starpu_task *task = starpu_task_create();
 
 	task->cl = &cl11_pivot;
+	task->color = 0xffff00;
 
 	task->cl_arg = &piv_description[k];
 
@@ -87,6 +89,7 @@ static int create_task_12(starpu_data_handle_t *dataAp, unsigned nblocks, unsign
 	struct starpu_task *task = starpu_task_create();
 
 	task->cl = &cl12;
+	task->color = 0x8080ff;
 
 	/* which sub-data is manipulated ? */
 	task->handles[0] = get_block(dataAp, nblocks, k, k);
@@ -109,6 +112,7 @@ static int create_task_21(starpu_data_handle_t *dataAp, unsigned nblocks, unsign
 	struct starpu_task *task = starpu_task_create();
 
 	task->cl = &cl21;
+	task->color = 0x8080c0;
 
 	/* which sub-data is manipulated ? */
 	task->handles[0] = get_block(dataAp, nblocks, k, k);
@@ -131,6 +135,7 @@ static int create_task_22(starpu_data_handle_t *dataAp, unsigned nblocks, unsign
 	struct starpu_task *task = starpu_task_create();
 
 	task->cl = &cl22;
+	task->color = 0x00ff00;
 
 	/* which sub-data is manipulated ? */
 	task->handles[0] = get_block(dataAp, nblocks, k, i);

+ 6 - 1
examples/lu/xlu_pivot.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2015,2017                           Université de Bordeaux
+ * Copyright (C) 2009-2015,2017-2018                           Université de Bordeaux
  * Copyright (C) 2010-2013,2015,2017,2018                 CNRS
  * Copyright (C) 2011,2013                                Inria
  *
@@ -46,6 +46,7 @@ static int create_task_pivot(starpu_data_handle_t *dataAp, unsigned nblocks,
 	struct starpu_task *task = create_task(PIVOT(k, i));
 
 	task->cl = &cl_pivot;
+	task->color = 0xc0c000;
 
 	/* which sub-data is manipulated ? */
 	task->handles[0] = get_block(dataAp, nblocks, k, i);
@@ -96,6 +97,7 @@ static struct starpu_task *create_task_11_pivot(starpu_data_handle_t *dataAp, un
 	struct starpu_task *task = create_task(TAG11(k));
 
 	task->cl = &cl11_pivot;
+	task->color = 0xffff00;
 
 	task->cl_arg = &piv_description[k];
 
@@ -125,6 +127,7 @@ static int create_task_12(starpu_data_handle_t *dataAp, unsigned nblocks, unsign
 	struct starpu_task *task = create_task(TAG12(k, j));
 
 	task->cl = &cl12;
+	task->color = 0x8080ff;
 
 	task->cl_arg = (void *)(task->tag_id);
 
@@ -163,6 +166,7 @@ static int create_task_21(starpu_data_handle_t *dataAp, unsigned nblocks, unsign
 	struct starpu_task *task = create_task(TAG21(k, i));
 
 	task->cl = &cl21;
+	task->color = 0x8080c0;
 
 	/* which sub-data is manipulated ? */
 	task->handles[0] = get_block(dataAp, nblocks, k, k);
@@ -193,6 +197,7 @@ static int create_task_22(starpu_data_handle_t *dataAp, unsigned nblocks, unsign
 	struct starpu_task *task = create_task(TAG22(k, i, j));
 
 	task->cl = &cl22;
+	task->color = 0x00ff00;
 
 	task->cl_arg = (void *)(task->tag_id);
 

+ 3 - 1
include/starpu_fxt.h

@@ -3,7 +3,7 @@
  * Copyright (C) 2012-2013,2016                           Inria
  * Copyright (C) 2013                                     Joris Pablo
  * Copyright (C) 2010-2015,2017                           CNRS
- * Copyright (C) 2010-2011,2013-2017                      Université de Bordeaux
+ * Copyright (C) 2010-2011,2013-2018                      Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -48,6 +48,8 @@ struct starpu_fxt_options
 	unsigned no_flops;
 	unsigned ninputfiles;
 	unsigned no_smooth;
+	unsigned no_acquire;
+	unsigned internal;
 	char *filenames[STARPU_FXT_MAX_FILES];
 	char *out_paje_path;
 	char *distrib_time_path;

+ 1 - 1
include/starpu_perfmodel.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2013,2016                           Inria
- * Copyright (C) 2009-2017                                Université de Bordeaux
+ * Copyright (C) 2009-2018                                Université de Bordeaux
  * Copyright (C) 2010-2017                                CNRS
  * Copyright (C) 2013                                     Thibaut Lambert
  * Copyright (C) 2011                                     Télécom-SudParis

+ 12 - 2
include/starpu_task.h

@@ -128,6 +128,7 @@ struct starpu_codelet
 	unsigned long per_worker_stats[STARPU_NMAXWORKERS];
 
 	const char *name;
+	unsigned color;
 
 	int flags;
 };
@@ -187,6 +188,9 @@ struct starpu_task
 
 	unsigned no_submitorder:1; /* do not allocate a submitorder id for this task */
 
+	unsigned scheduled:1;
+	unsigned prefetched:1;
+
 	unsigned workerid;
 	unsigned workerorder;
 	uint32_t *workerids;
@@ -195,9 +199,10 @@ struct starpu_task
 	int priority;
 
 	enum starpu_task_status status;
-	unsigned char scheduled:1;
 
 	int magic;
+	unsigned type;
+	unsigned color;
 
 	unsigned sched_ctx;
 	int hypervisor_tag;
@@ -215,7 +220,6 @@ struct starpu_task
 	struct starpu_task *prev;
 	struct starpu_task *next;
 	void *starpu_private;
-	unsigned prefetched;
 #ifdef STARPU_OPENMP
 	struct starpu_omp_task *omp_task;
 #else
@@ -224,6 +228,10 @@ struct starpu_task
 	void *sched_data;
 };
 
+#define STARPU_TASK_TYPE_NORMAL		0
+#define STARPU_TASK_TYPE_INTERNAL	(1<<0)
+#define STARPU_TASK_TYPE_DATA_ACQUIRE	(1<<1)
+
 /* Note: remember to update starpu_task_init as well */
 #define STARPU_TASK_INITIALIZER 			\
 {							\
@@ -250,6 +258,8 @@ struct starpu_task
 	.predicted_start = NAN,				\
 	.starpu_private = NULL,				\
 	.magic = 42,                  			\
+	.type = 0,					\
+	.color = 0,					\
 	.sched_ctx = STARPU_NMAX_SCHED_CTXS,		\
 	.hypervisor_tag = 0,				\
 	.flops = 0.0,					\

+ 16 - 5
src/common/fxt.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2012-2017                                Inria
- * Copyright (C) 2008-2017                                Université de Bordeaux
+ * Copyright (C) 2008-2018                                Université de Bordeaux
  * Copyright (C) 2013                                     Joris Pablo
  * Copyright (C) 2010-2017                                CNRS
  *
@@ -106,6 +106,8 @@
 
 #define _STARPU_FUT_DATA_WONT_USE	0x512c
 
+#define _STARPU_FUT_TASK_COLOR	0x512d
+
 #define	_STARPU_FUT_START_MEMRECLAIM	0x5131
 #define	_STARPU_FUT_END_MEMRECLAIM	0x5132
 
@@ -677,10 +679,10 @@ do {									\
 	FUT_DO_PROBE2(_STARPU_FUT_TAG_DEPS, tag_child, tag_father)
 
 #define _STARPU_TRACE_TASK_DEPS(job_prev, job_succ)	\
-	FUT_DO_PROBE2(_STARPU_FUT_TASK_DEPS, (job_prev)->job_id, (job_succ)->job_id)
+	FUT_DO_PROBE3(_STARPU_FUT_TASK_DEPS, (job_prev)->job_id, (job_succ)->job_id, (job_succ)->task->type)
 
-#define _STARPU_TRACE_GHOST_TASK_DEPS(ghost_prev_id, job_succ_id)		\
-	FUT_DO_PROBE2(_STARPU_FUT_TASK_DEPS, (ghost_prev_id), (job_succ_id))
+#define _STARPU_TRACE_GHOST_TASK_DEPS(ghost_prev_id, job_succ)		\
+	FUT_DO_PROBE3(_STARPU_FUT_TASK_DEPS, (ghost_prev_id), (job_succ)->job_id, (job_succ)->task->type)
 
 #define _STARPU_TRACE_TASK_NAME(job)						\
 do {										\
@@ -695,6 +697,14 @@ do {										\
 	}									\
 } while(0);
 
+#define _STARPU_TRACE_TASK_COLOR(job)						\
+do { \
+	if ((job)->task->color != 0) \
+		FUT_DO_PROBE3(_STARPU_FUT_TASK_COLOR, (job)->job_id, (job)->task->color, _starpu_gettid()); \
+	else if ((job)->task->cl && (job)->task->cl->color != 0) \
+		FUT_DO_PROBE3(_STARPU_FUT_TASK_COLOR, (job)->job_id, (job)->task->cl->color, _starpu_gettid()); \
+} while(0)
+
 #define _STARPU_TRACE_TASK_DONE(job)						\
 	FUT_DO_PROBE2(_STARPU_FUT_TASK_DONE, (job)->job_id, _starpu_gettid())
 
@@ -771,7 +781,7 @@ do {										\
 	FUT_DO_PROBE1(_STARPU_FUT_WORKER_SLEEP_END, _starpu_gettid());
 
 #define _STARPU_TRACE_TASK_SUBMIT(job, iter, subiter)	\
-	FUT_DO_PROBE6(_STARPU_FUT_TASK_SUBMIT, (job)->job_id, iter, subiter, (job)->task->no_submitorder?0:_starpu_fxt_get_submit_order(), (job)->task->priority, _starpu_gettid());
+	FUT_DO_PROBE7(_STARPU_FUT_TASK_SUBMIT, (job)->job_id, iter, subiter, (job)->task->no_submitorder?0:_starpu_fxt_get_submit_order(), (job)->task->priority, (job)->task->type, _starpu_gettid());
 
 #define _STARPU_TRACE_TASK_SUBMIT_START()	\
 	FUT_DO_PROBE1(_STARPU_FUT_TASK_SUBMIT_START, _starpu_gettid());
@@ -1129,6 +1139,7 @@ do {										\
 #define _STARPU_TRACE_TASK_DEPS(a, b)		do {(void)(a); (void)(b);} while(0)
 #define _STARPU_TRACE_GHOST_TASK_DEPS(a, b)	do {(void)(a); (void)(b);} while(0)
 #define _STARPU_TRACE_TASK_NAME(a)		do {(void)(a);} while(0)
+#define _STARPU_TRACE_TASK_COLOR(a)		do {(void)(a);} while(0)
 #define _STARPU_TRACE_TASK_DONE(a)		do {(void)(a);} while(0)
 #define _STARPU_TRACE_TAG_DONE(a)		do {(void)(a);} while(0)
 #define _STARPU_TRACE_DATA_NAME(a, b)		do {(void)(a); (void)(b);} while(0)

+ 5 - 3
src/core/dependencies/implicit_data_deps.c

@@ -88,7 +88,7 @@ static void _starpu_add_accessor(starpu_data_handle_t handle, struct starpu_task
 		) && handle->last_submitted_ghost_sync_id_is_valid)
 	{
 		_STARPU_TRACE_GHOST_TASK_DEPS(handle->last_submitted_ghost_sync_id,
-			_starpu_get_job_associated_to_task(pre_sync_task)->job_id);
+			_starpu_get_job_associated_to_task(pre_sync_task));
 		_starpu_add_ghost_dependency(handle, handle->last_submitted_ghost_sync_id, pre_sync_task);
 		_STARPU_DEP_DEBUG("dep ID%lu -> %p\n", handle->last_submitted_ghost_sync_id, pre_sync_task);
 	}
@@ -168,7 +168,7 @@ static void _starpu_add_sync_task(starpu_data_handle_t handle, struct starpu_tas
 		{
 			unsigned long id = ghost_accessors_id->id;
 			_STARPU_TRACE_GHOST_TASK_DEPS(id,
-				_starpu_get_job_associated_to_task(pre_sync_task)->job_id);
+				_starpu_get_job_associated_to_task(pre_sync_task));
 			_starpu_add_ghost_dependency(handle, id, pre_sync_task);
 			_STARPU_DEP_DEBUG("dep ID%lu -> %p\n", id, pre_sync_task);
 
@@ -240,7 +240,7 @@ struct starpu_task *_starpu_detect_implicit_data_deps_with_handle(struct starpu_
 #endif
 		)
 		{
-			_STARPU_TRACE_GHOST_TASK_DEPS(pre_sync_job->job_id, post_sync_job->job_id);
+			_STARPU_TRACE_GHOST_TASK_DEPS(pre_sync_job->job_id, post_sync_job);
 			_starpu_bound_task_dep(post_sync_job, pre_sync_job);
 		}
 
@@ -302,6 +302,7 @@ struct starpu_task *_starpu_detect_implicit_data_deps_with_handle(struct starpu_
 					else
 						sync_task->name = "sync_task";
 					sync_task->cl = NULL;
+					sync_task->type = post_sync_task->type;
 
 					/* Make this task wait for the previous ones */
 					_starpu_add_sync_task(handle, sync_task, sync_task, post_sync_task);
@@ -596,6 +597,7 @@ int _starpu_data_wait_until_available(starpu_data_handle_t handle, enum starpu_d
 		sync_task->name = sync_name;
 		sync_task->detach = 0;
 		sync_task->destroy = 1;
+		sync_task->type = STARPU_TASK_TYPE_INTERNAL;
 
 		/* It is not really a RW access, but we want to make sure that
 		 * all previous accesses are done */

+ 4 - 0
src/datawizard/malloc.c

@@ -200,6 +200,7 @@ int _starpu_malloc_flags_on_node(unsigned dst_node, void **A, size_t dim, int fl
 			task->callback_func = NULL;
 			task->cl = &malloc_pinned_cl;
 			task->cl_arg = &s;
+			task->type = STARPU_TASK_TYPE_INTERNAL;
 
 			task->synchronous = 1;
 
@@ -231,6 +232,7 @@ int _starpu_malloc_flags_on_node(unsigned dst_node, void **A, size_t dim, int fl
 //			task->cl = &malloc_pinned_cl;
 //			task->cl_arg = &s;
 //			task->synchronous = 1;
+//			task->type = STARPU_TASK_TYPE_INTERNAL;
 //
 //			_starpu_exclude_task_from_dag(task);
 //
@@ -456,6 +458,7 @@ int _starpu_free_flags_on_node(unsigned dst_node, void *A, size_t dim, int flags
 				task->cl = &free_pinned_cl;
 				task->cl_arg = A;
 				task->synchronous = 1;
+				task->type = STARPU_TASK_TYPE_INTERNAL;
 
 				_starpu_exclude_task_from_dag(task);
 
@@ -481,6 +484,7 @@ int _starpu_free_flags_on_node(unsigned dst_node, void *A, size_t dim, int flags
 //		task->cl = &free_pinned_cl;
 //		task->cl_arg = A;
 //		task->synchronous = 1;
+//		task->type = STARPU_TASK_TYPE_INTERNAL;
 //
 //		_starpu_exclude_task_from_dag(task);
 //

+ 5 - 1
src/datawizard/user_interactions.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2013,2017                           Inria
- * Copyright (C) 2009-2017                                Université de Bordeaux
+ * Copyright (C) 2009-2018                                Université de Bordeaux
  * Copyright (C) 2010-2013,2015-2017                      CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -220,12 +220,14 @@ int starpu_data_acquire_on_node_cb_sequential_consistency_sync_jobids(starpu_dat
 		wrapper->pre_sync_task->detach = 1;
 		wrapper->pre_sync_task->callback_func = starpu_data_acquire_cb_pre_sync_callback;
 		wrapper->pre_sync_task->callback_arg = wrapper;
+		wrapper->pre_sync_task->type = STARPU_TASK_TYPE_DATA_ACQUIRE;
 		if (pre_sync_jobid)
 			*pre_sync_jobid = _starpu_get_job_associated_to_task(wrapper->pre_sync_task)->job_id;
 
 		wrapper->post_sync_task = starpu_task_create();
 		wrapper->post_sync_task->name = "_starpu_data_acquire_cb_post";
 		wrapper->post_sync_task->detach = 1;
+		wrapper->post_sync_task->type = STARPU_TASK_TYPE_DATA_ACQUIRE;
 		if (post_sync_jobid)
 			*post_sync_jobid = _starpu_get_job_associated_to_task(wrapper->post_sync_task)->job_id;
 
@@ -348,10 +350,12 @@ int starpu_data_acquire_on_node(starpu_data_handle_t handle, int node, enum star
 		wrapper.pre_sync_task = starpu_task_create();
 		wrapper.pre_sync_task->name = "_starpu_data_acquire_pre";
 		wrapper.pre_sync_task->detach = 0;
+		wrapper.pre_sync_task->type = STARPU_TASK_TYPE_DATA_ACQUIRE;
 
 		wrapper.post_sync_task = starpu_task_create();
 		wrapper.post_sync_task->name = "_starpu_data_acquire_post";
 		wrapper.post_sync_task->detach = 1;
+		wrapper.post_sync_task->type = STARPU_TASK_TYPE_DATA_ACQUIRE;
 
 		new_task = _starpu_detect_implicit_data_deps_with_handle(wrapper.pre_sync_task, wrapper.post_sync_task, &_starpu_get_job_associated_to_task(wrapper.post_sync_task)->implicit_dep_slot, handle, mode);
 		STARPU_PTHREAD_MUTEX_UNLOCK(&handle->sequential_consistency_mutex);

+ 64 - 11
src/debug/traces/starpu_fxt.c

@@ -4,7 +4,7 @@
  * Copyright (C) 2013                                     Joris Pablo
  * Copyright (C) 2012-2018                                CNRS
  * Copyright (C) 2017                                     Universidade Federal do Rio Grande do Sul (UFRGS)
- * Copyright (C) 2009-2017                                Université de Bordeaux
+ * Copyright (C) 2009-2018                                Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -98,9 +98,12 @@ struct task_info
 	char *model_name;
 	char *name;
 	int exclude_from_dag;
+	int show;
+	unsigned type;
 	unsigned long job_id;
 	unsigned long submit_order;
 	long priority;
+	int color;
 	uint64_t tag;
 	int workerid;
 	int node;
@@ -132,9 +135,12 @@ static struct task_info *get_task(unsigned long job_id, int mpi_rank)
 		task->model_name = NULL;
 		task->name = NULL;
 		task->exclude_from_dag = 0;
+		task->show = 0;
+		task->type = 0;
 		task->job_id = job_id;
 		task->submit_order = 0;
 		task->priority = 0;
+		task->color = 0;
 		task->tag = 0;
 		task->workerid = -1;
 		task->node = -1;
@@ -159,6 +165,18 @@ static struct task_info *get_task(unsigned long job_id, int mpi_rank)
 	return task;
 }
 
+/* Return whether to show this task in the DAG or not */
+static int show_task(struct task_info *task, struct starpu_fxt_options *options)
+{
+	if (task->show)
+		return 1;
+	if (task->type & STARPU_TASK_TYPE_INTERNAL && !options->internal)
+		return 0;
+	if (task->type & STARPU_TASK_TYPE_DATA_ACQUIRE && options->no_acquire)
+		return 0;
+	return 1;
+}
+
 static void task_dump(struct task_info *task, struct starpu_fxt_options *options)
 {
 	char *prefix = options->file_prefix;
@@ -1309,7 +1327,7 @@ static void create_paje_state_color(char *name, char *type, int ctx, float red,
 }
 #endif
 
-static void create_paje_state_if_not_found(char *name, struct starpu_fxt_options *options)
+static void create_paje_state_if_not_found(char *name, unsigned color, struct starpu_fxt_options *options)
 {
 	struct _starpu_symbol_name *itor;
 	for (itor = _starpu_symbol_name_list_begin(&symbol_list);
@@ -1338,7 +1356,13 @@ static void create_paje_state_if_not_found(char *name, struct starpu_fxt_options
 	uint32_t hash_sum = hash_symbol_red + hash_symbol_green + hash_symbol_blue;
 
 	float red, green, blue;
-	if (options->per_task_colour)
+	if (color != 0)
+	{
+		red = color / 0x100 / 0x100;
+		green = (color / 0x100) & 0xff;
+		blue = color & 0xff;
+	}
+	else if (options->per_task_colour)
 	{
 		red = (1.0f * hash_symbol_red) / hash_sum;
 		green = (1.0f * hash_symbol_green) / hash_sum;
@@ -1456,9 +1480,9 @@ static void handle_start_codelet_body(struct fxt_ev_64 *ev, struct starpu_fxt_op
 	double last_start_codelet_time = last_codelet_start[worker];
 	last_codelet_start[worker] = start_codelet_time;
 
-	create_paje_state_if_not_found(name, options);
-
 	struct task_info *task = get_task(ev->param[0], options->file_rank);
+	create_paje_state_if_not_found(name, task->color, options);
+
 	task->start_time = start_codelet_time;
 	task->workerid = worker;
 	task->name = strdup(name);
@@ -2551,10 +2575,14 @@ static void handle_task_deps(struct fxt_ev_64 *ev, struct starpu_fxt_options *op
 {
 	unsigned long dep_prev = ev->param[0];
 	unsigned long dep_succ = ev->param[1];
+	unsigned dep_succ_type = ev->param[2];
 
 	struct task_info *task = get_task(dep_succ, options->file_rank);
+	struct task_info *prev_task = get_task(dep_prev, options->file_rank);
 	unsigned alloc = 0;
 
+	task->type = dep_succ_type;
+
 	if (task->ndeps == 0)
 		/* Start with 8=2^3, should be plenty in most cases */
 		alloc = 8;
@@ -2574,7 +2602,11 @@ static void handle_task_deps(struct fxt_ev_64 *ev, struct starpu_fxt_options *op
 	task->dependencies[task->ndeps++] = dep_prev;
 
 	/* There is a dependency between both job id : dep_prev -> dep_succ */
-	_starpu_fxt_dag_add_task_deps(options->file_prefix, dep_prev, dep_succ);
+	if (show_task(task, options)) {
+		/* We should show the name of the predecessor, then. */
+		prev_task->show = 1;
+		_starpu_fxt_dag_add_task_deps(options->file_prefix, dep_prev, dep_succ);
+	}
 }
 
 static void handle_task_submit(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
@@ -2584,6 +2616,7 @@ static void handle_task_submit(struct fxt_ev_64 *ev, struct starpu_fxt_options *
 	unsigned long subiteration = ev->param[2];
 	unsigned long submit_order = ev->param[3];
 	long priority = (long) ev->param[4];
+	unsigned type = ev->param[5];
 
 	struct task_info *task = get_task(job_id, options->file_rank);
 	task->submit_time = get_event_time_stamp(ev, options);
@@ -2591,14 +2624,24 @@ static void handle_task_submit(struct fxt_ev_64 *ev, struct starpu_fxt_options *
 	task->priority = priority;
 	task->iterations[0] = iteration;
 	task->iterations[1] = subiteration;
+	task->type = type;
+}
+
+static void handle_task_color(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
+{
+	unsigned long job_id = ev->param[0];
+	struct task_info *task = get_task(job_id, options->file_rank);
+	int color = (long) ev->param[1];
+
+	task->color = color;
 }
 
 static void handle_task_name(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
 	char *prefix = options->file_prefix;
 
-	unsigned long job_id;
-	job_id = ev->param[0];
+	unsigned long job_id = ev->param[0];
+	struct task_info *task = get_task(job_id, options->file_rank);
 
 	unsigned long has_name = ev->param[3];
 	char *name = has_name?get_fxt_string(ev,4):"unknown";
@@ -2608,7 +2651,12 @@ static void handle_task_name(struct fxt_ev_64 *ev, struct starpu_fxt_options *op
 
 	const char *colour;
 	char buffer[32];
-	if (options->per_task_colour)
+	if (task->color != 0)
+	{
+		snprintf(buffer, sizeof(buffer), "#%06x", task->color);
+		colour = &buffer[0];
+	}
+	else if (options->per_task_colour)
 	{
 		snprintf(buffer, sizeof(buffer), "#%x%x%x",
 			 get_colour_symbol_red(name)/4,
@@ -2622,10 +2670,9 @@ static void handle_task_name(struct fxt_ev_64 *ev, struct starpu_fxt_options *op
 	}
 
 	unsigned exclude_from_dag = ev->param[2];
-	struct task_info *task = get_task(job_id, options->file_rank);
 	task->exclude_from_dag = exclude_from_dag;
 
-	if (!exclude_from_dag)
+	if (!exclude_from_dag && show_task(task, options))
 		_starpu_fxt_dag_set_task_name(options->file_prefix, job_id, name, colour);
 }
 
@@ -3379,6 +3426,10 @@ void _starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *op
 				handle_task_name(&ev, options);
 				break;
 
+			case _STARPU_FUT_TASK_COLOR:
+				handle_task_color(&ev, options);
+				break;
+
 			case _STARPU_FUT_TASK_DONE:
 				handle_task_done(&ev, options);
 				break;
@@ -3817,6 +3868,8 @@ void starpu_fxt_options_init(struct starpu_fxt_options *options)
 	options->no_bus = 0;
 	options->no_flops = 0;
 	options->no_smooth = 0;
+	options->no_acquire = 0;
+	options->internal = 0;
 	options->ninputfiles = 0;
 	options->out_paje_path = "paje.trace";
 	options->dag_path = "dag.dot";

+ 5 - 1
src/drivers/driver_common/driver_common.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2017                                Inria
- * Copyright (C) 2010-2017                                Université de Bordeaux
+ * Copyright (C) 2010-2018                                Université de Bordeaux
  * Copyright (C) 2010-2017                                CNRS
  * Copyright (C) 2013                                     Thibaut Lambert
  * Copyright (C) 2011                                     Télécom-SudParis
@@ -99,10 +99,14 @@ void _starpu_driver_start_job(struct _starpu_worker *worker, struct _starpu_job
 				}
 			}
 		}
+		_STARPU_TRACE_TASK_COLOR(j);
 		_STARPU_TRACE_START_CODELET_BODY(j, j->nimpl, &sched_ctx->perf_arch, workerid);
 	}
 	else
+	{
+		_STARPU_TRACE_TASK_COLOR(j);
 		_STARPU_TRACE_START_CODELET_BODY(j, j->nimpl, perf_arch, workerid);
+	}
 	_starpu_sched_ctx_unlock_read(sched_ctx->id);
 	_STARPU_TASK_BREAK_ON(task, exec);
 }

+ 17 - 1
tools/starpu_fxt_tool.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2008-2014,2016-2017                      Université de Bordeaux
+ * Copyright (C) 2008-2014,2016-2018                      Université de Bordeaux
  * Copyright (C) 2010-2015,2017                           CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -40,6 +40,8 @@ static void usage()
 	fprintf(stderr, "   -no-bus             do not show PCI bus transfers\n");
 	fprintf(stderr, "   -no-flops           do not show flops\n");
 	fprintf(stderr, "   -no-smooth          avoid smoothing values for gflops etc.\n");
+	fprintf(stderr, "   -no-acquire         do not show application data acquisitions tasks in DAG\n");
+	fprintf(stderr, "   -internal           show StarPU-internal tasks in DAG\n");
 	fprintf(stderr, "   -h, --help          display this help and exit\n");
 	fprintf(stderr, "   -v, --version       output version information and exit\n\n");
         fprintf(stderr, "Report bugs to <%s>.", PACKAGE_BUGREPORT);
@@ -115,6 +117,20 @@ static int parse_args(int argc, char **argv)
 			continue;
 		}
 
+		if (strcmp(argv[i], "-no-acquire") == 0)
+		{
+			options.no_acquire = 1;
+			reading_input_filenames = 0;
+			continue;
+		}
+
+		if (strcmp(argv[i], "-internal") == 0)
+		{
+			options.internal = 1;
+			reading_input_filenames = 0;
+			continue;
+		}
+
 		if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0)
 		{
 			usage();