Browse Source

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

Olivier Aumage 7 years ago
parent
commit
1d1d54d874

+ 4 - 0
ChangeLog

@@ -76,6 +76,10 @@ Small features:
   * Add dependency backward information in debugging mode for gdb's
     starpu-print-task
   * Add sched_data field in starpu_task structure.
+  * New starpu_fxt_tool option -label-deps to label dependencies on
+    the output graph
+  * New environment variable STARPU_GENERATE_TRACE_OPTIONS to specify
+    fxt options (to be used with STARPU_GENERATE_TRACE)
 
 Changes:
   * Vastly improve simgrid simulation time.

+ 21 - 12
doc/doxygen/chapters/501_environment_variables.doxy

@@ -66,8 +66,8 @@ which will be concurrently running on the devices. The default value is 1.
 <dd>
 \anchor STARPU_CUDA_THREAD_PER_WORKER
 \addindex __env__STARPU_CUDA_THREAD_PER_WORKER
-Specify if the cuda driver should provide a thread per stream or a single thread 
-dealing with all the streams. 0 if one thread per stream, 1 otherwise. The default 
+Specify if the cuda driver should provide a thread per stream or a single thread
+dealing with all the streams. 0 if one thread per stream, 1 otherwise. The default
 value is 0. Setting it to 1 is contradictory with setting STARPU_CUDA_THREAD_PER_DEV to 1.
 </dd>
 
@@ -75,8 +75,8 @@ value is 0. Setting it to 1 is contradictory with setting STARPU_CUDA_THREAD_PER
 <dd>
 \anchor STARPU_CUDA_THREAD_PER_DEV
 \addindex __env__STARPU_CUDA_THREAD_PER_DEV
-Specify if the cuda driver should provide a thread per device or a single thread 
-dealing with all the devices. 0 if one thread per device, 1 otherwise. The default 
+Specify if the cuda driver should provide a thread per device or a single thread
+dealing with all the devices. 0 if one thread per device, 1 otherwise. The default
 value is 1, unless STARPU_CUDA_THREAD_PER_WORKER is set to 1. Setting it to 1 is
 contradictory with setting STARPU_CUDA_THREAD_PER_WORKER to 1.
 </dd>
@@ -369,7 +369,7 @@ Disable asynchronous copies between CPU and MIC devices.
 
 <dt>STARPU_DISABLE_ASYNCHRONOUS_MPI_MS_COPY</dt>
 <dd>
-\anchor STARPU_DISABLE_ASYNCHRONOUS_MPI_MS_COPY 
+\anchor STARPU_DISABLE_ASYNCHRONOUS_MPI_MS_COPY
 \addindex __env__STARPU_DISABLE_ASYNCHRONOUS_MPI_MS_COPY
 Disable asynchronous copies between CPU and MPI Slave devices.
 </dd>
@@ -946,7 +946,7 @@ full.
 This specifies then backend to be used by StarPU to push data when the main
 memory is getting full. The default is unistd (i.e. using read/write functions),
 other values are stdio (i.e. using fread/fwrite), unistd_o_direct (i.e. using
-read/write with O_DIRECT), leveldb (i.e. using a leveldb database), and hdf5 
+read/write with O_DIRECT), leveldb (i.e. using a leveldb database), and hdf5
 (i.e. using HDF5 library).
 </dd>
 
@@ -961,7 +961,7 @@ memory is getting full. The default is unlimited.
 <dt>STARPU_LIMIT_MAX_SUBMITTED_TASKS</dt>
 <dd>
 \anchor STARPU_LIMIT_MAX_SUBMITTED_TASKS
-\addindex __env__STARPU_LIMIT_MAX_SUBMITTED_TASKS    
+\addindex __env__STARPU_LIMIT_MAX_SUBMITTED_TASKS
 This variable allows the user to control the task submission flow by specifying
 to StarPU a maximum number of submitted tasks allowed at a given time, i.e. when
 this limit is reached task submission becomes blocking until enough tasks have
@@ -972,7 +972,7 @@ Setting it enables allocation cache buffer reuse in main memory.
 <dt>STARPU_LIMIT_MIN_SUBMITTED_TASKS</dt>
 <dd>
 \anchor STARPU_LIMIT_MIN_SUBMITTED_TASKS
-\addindex __env__STARPU_LIMIT_MIN_SUBMITTED_TASKS    
+\addindex __env__STARPU_LIMIT_MIN_SUBMITTED_TASKS
 This variable allows the user to control the task submission flow by specifying
 to StarPU a submitted task threshold to wait before unblocking task submission. This
 variable has to be used in conjunction with \ref STARPU_LIMIT_MAX_SUBMITTED_TASKS
@@ -997,6 +997,15 @@ When set to <c>1</c>, this variable indicates that StarPU should automatically
 generate a Paje trace when starpu_shutdown() is called.
 </dd>
 
+<dt>STARPU_GENERATE_TRACE_OPTIONS</dt>
+<dd>
+\anchor STARPU_GENERATE_TRACE_OPTIONS
+\addindex __env__STARPU_GENERATE_TRACE_OPTIONS
+When the variable \ref STARPU_GENERATE_TRACE is set to <c>1</c> to
+generate a Paje trace, this variable can be set to specify options (see
+<c>starpu_fxt_tool --help</c>).
+</dd>
+
 <dt>STARPU_ENABLE_STATS</dt>
 <dd>
 \anchor STARPU_ENABLE_STATS
@@ -1162,7 +1171,7 @@ accesses (see \ref ConcurrentDataAccess).
 
 <dt>STARPU_USE_NUMA</dt>
 <dd>
-\anchor STARPU_USE_NUMA 
+\anchor STARPU_USE_NUMA
 \addindex __env__STARPU_USE_NUMA
 When defined, NUMA nodes are taking into account by StarPU. Otherwise, memory
 is considered as only one node. This is experimental for now.
@@ -1191,7 +1200,7 @@ The file will contain the sum of the idle times of all the workers.
 <dd>
 \anchor SC_HYPERVISOR_POLICY
 \addindex __env__SC_HYPERVISOR_POLICY
-Choose between the different resizing policies proposed by StarPU for the hypervisor: 
+Choose between the different resizing policies proposed by StarPU for the hypervisor:
 idle, app_driven, feft_lp, teft_lp; ispeed_lp, throughput_lp etc.
 
 Use <c>SC_HYPERVISOR_POLICY=help</c> to get the list of available policies for the hypervisor
@@ -1221,7 +1230,7 @@ of the total time of execution of the application. The default value is the resi
 \addindex __env__SC_HYPERVISOR_MAX_SPEED_GAP
 Indicate the ratio of speed difference between contexts that should trigger the hypervisor.
 This situation may occur only when a theoretical speed could not be computed and the hypervisor
-has no value to compare the speed to. Otherwise the resizing of a context is not influenced by the 
+has no value to compare the speed to. Otherwise the resizing of a context is not influenced by the
 the speed of the other contexts, but only by the the value that a context should have.
 </dd>
 
@@ -1239,7 +1248,7 @@ is not done.
 \anchor SC_HYPERVISOR_LAZY_RESIZE
 \addindex __env__SC_HYPERVISOR_LAZY_RESIZE
 By default the hypervisor resizes the contexts in a lazy way, that is workers are firstly added to a new context
-before removing them from the previous one. Once this workers are clearly taken into account 
+before removing them from the previous one. Once this workers are clearly taken into account
 into the new context (a task was poped there) we remove them from the previous one. However if the application
 would like that the change in the distribution of workers should change right away this variable should be set to 0
 </dd>

+ 2 - 2
doc/doxygen/chapters/api/codelet_and_tasks.doxy

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2013,2015,2017                      Inria
- * Copyright (C) 2010-2017                                CNRS
+ * Copyright (C) 2010-2018                                CNRS
  * Copyright (C) 2009-2011,2013-2018                      Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -760,7 +760,7 @@ the configuration of a task allocated with starpu_task_create().
     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
+    synchronization task (::STARPU_TASK_TYPE_DATA_ACQUIRE), or a normal task
     (::STARPU_TASK_TYPE_NORMAL)
 
 \var int starpu_task::color

+ 2 - 1
include/starpu_fxt.h

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2012-2013,2016                           Inria
  * Copyright (C) 2013                                     Joris Pablo
- * Copyright (C) 2010-2015,2017                           CNRS
+ * Copyright (C) 2010-2015,2017,2018                      CNRS
  * Copyright (C) 2010-2011,2013-2018                      Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -50,6 +50,7 @@ struct starpu_fxt_options
 	unsigned no_smooth;
 	unsigned no_acquire;
 	unsigned internal;
+	unsigned label_deps;
 	char *filenames[STARPU_FXT_MAX_FILES];
 	char *out_paje_path;
 	char *distrib_time_path;

+ 55 - 2
src/common/fxt.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2012-2013,2015                           Inria
  * Copyright (C) 2008-2017                                Université de Bordeaux
- * Copyright (C) 2010-2017                                CNRS
+ * Copyright (C) 2010-2018                                CNRS
  *
  * 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
@@ -180,13 +180,66 @@ void _starpu_fxt_init_profiling(unsigned trace_buffer_size)
 	return;
 }
 
+static void _starpu_generate_paje_trace_read_option(const char *option, struct starpu_fxt_options *options)
+{
+	if (strcmp(option, "-c") == 0)
+	{
+		options->per_task_colour = 1;
+	}
+	else if (strcmp(option, "-no-events") == 0)
+	{
+		options->no_events = 1;
+	}
+	else if (strcmp(option, "-no-counter") == 0)
+	{
+		options->no_counter = 1;
+	}
+	else if (strcmp(option, "-no-bus") == 0)
+	{
+		options->no_bus = 1;
+	}
+	else if (strcmp(option, "-no-flops") == 0)
+	{
+		options->no_flops = 1;
+	}
+	else if (strcmp(option, "-no-smooth") == 0)
+	{
+		options->no_smooth = 1;
+	}
+	else if (strcmp(option, "-no-acquire") == 0)
+	{
+		options->no_acquire = 1;
+	}
+	else if (strcmp(option, "-internal") == 0)
+	{
+		options->internal = 1;
+	}
+	else if (strcmp(option, "-label-deps") == 0)
+	{
+		options->label_deps = 1;
+	}
+	else
+	{
+		_STARPU_MSG("Option <%s> is not a valid option for starpu_fxt_tool\n", option);
+	}
+}
+
 static void _starpu_generate_paje_trace(char *input_fxt_filename, char *output_paje_filename)
 {
 	/* We take default options */
 	struct starpu_fxt_options options;
 	starpu_fxt_options_init(&options);
 
-	/* TODO parse some STARPU_GENERATE_TRACE_OPTIONS env variable */
+	char *trace_options = starpu_getenv("STARPU_GENERATE_TRACE_OPTIONS");
+	if (trace_options)
+	{
+		char *option = strtok(trace_options, " ");
+		while (option)
+		{
+			_starpu_generate_paje_trace_read_option(option, &options);
+			option = strtok(NULL, " ");
+		}
+	}
 
 	options.ninputfiles = 1;
 	options.filenames[0] = input_fxt_filename;

+ 3 - 3
src/common/fxt.h

@@ -3,7 +3,7 @@
  * Copyright (C) 2012-2017                                Inria
  * Copyright (C) 2008-2018                                Université de Bordeaux
  * Copyright (C) 2013                                     Joris Pablo
- * Copyright (C) 2010-2017                                CNRS
+ * Copyright (C) 2010-2018                                CNRS
  *
  * 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
@@ -679,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_PROBE3(_STARPU_FUT_TASK_DEPS, (job_prev)->job_id, (job_succ)->job_id, (job_succ)->task->type)
+	_STARPU_FUT_DO_PROBE4STR(_STARPU_FUT_TASK_DEPS, (job_prev)->job_id, (job_succ)->job_id, (job_succ)->task->type, 1, "task")
 
 #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)
+	_STARPU_FUT_DO_PROBE4STR(_STARPU_FUT_TASK_DEPS, (ghost_prev_id), (job_succ)->job_id, (job_succ)->task->type, 1, "ghost")
 
 #define _STARPU_TRACE_TASK_NAME(job)						\
 do {										\

+ 14 - 4
src/debug/traces/starpu_fxt.c

@@ -2557,7 +2557,10 @@ static void handle_tag(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 	tag = ev->param[0];
 	job = ev->param[1];
 
-	_starpu_fxt_dag_add_tag(options->file_prefix, tag, job);
+	if (options->label_deps)
+		_starpu_fxt_dag_add_tag(options->file_prefix, tag, job, "tag");
+	else
+		_starpu_fxt_dag_add_tag(options->file_prefix, tag, job, NULL);
 }
 
 static void handle_tag_deps(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
@@ -2568,7 +2571,10 @@ static void handle_tag_deps(struct fxt_ev_64 *ev, struct starpu_fxt_options *opt
 	child = ev->param[0];
 	father = ev->param[1];
 
-	_starpu_fxt_dag_add_tag_deps(options->file_prefix, child, father);
+	if (options->label_deps)
+		_starpu_fxt_dag_add_tag_deps(options->file_prefix, child, father, "tag");
+	else
+		_starpu_fxt_dag_add_tag_deps(options->file_prefix, child, father, NULL);
 }
 
 static void handle_task_deps(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
@@ -2576,6 +2582,7 @@ 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];
+	char *name = get_fxt_string(ev,4);
 
 	struct task_info *task = get_task(dep_succ, options->file_rank);
 	struct task_info *prev_task = get_task(dep_prev, options->file_rank);
@@ -2602,10 +2609,12 @@ 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 */
-	if (show_task(task, options)) {
+	if (show_task(task, options))
+	{
+		if (!options->label_deps) name = NULL;
 		/* 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);
+		_starpu_fxt_dag_add_task_deps(options->file_prefix, dep_prev, dep_succ, name);
 	}
 }
 
@@ -3870,6 +3879,7 @@ void starpu_fxt_options_init(struct starpu_fxt_options *options)
 	options->no_smooth = 0;
 	options->no_acquire = 0;
 	options->internal = 0;
+	options->label_deps = 0;
 	options->ninputfiles = 0;
 	options->out_paje_path = "paje.trace";
 	options->dag_path = "dag.dot";

+ 4 - 4
src/debug/traces/starpu_fxt.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012                                Inria
- * Copyright (C) 2012,2017                                CNRS
+ * Copyright (C) 2012,2017,2018                           CNRS
  * Copyright (C) 2009-2012,2014-2017                      Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -44,10 +44,10 @@ extern char _starpu_last_codelet_symbol[STARPU_NMAXWORKERS][(FXT_MAX_PARAMS-5)*s
 
 void _starpu_fxt_dag_init(char *dag_filename);
 void _starpu_fxt_dag_terminate(void);
-void _starpu_fxt_dag_add_tag(const char *prefix, uint64_t tag, unsigned long job_id);
-void _starpu_fxt_dag_add_tag_deps(const char *prefix, uint64_t child, uint64_t father);
+void _starpu_fxt_dag_add_tag(const char *prefix, uint64_t tag, unsigned long job_id, const char *label);
+void _starpu_fxt_dag_add_tag_deps(const char *prefix, uint64_t child, uint64_t father, const char *label);
 void _starpu_fxt_dag_set_tag_done(const char *prefix, uint64_t tag, const char *color);
-void _starpu_fxt_dag_add_task_deps(const char *prefix, unsigned long dep_prev, unsigned long dep_succ);
+void _starpu_fxt_dag_add_task_deps(const char *prefix, unsigned long dep_prev, unsigned long dep_succ, const char *label);
 void _starpu_fxt_dag_set_task_name(const char *prefix, unsigned long job_id, const char *label, const char *color);
 void _starpu_fxt_dag_add_send(int src, unsigned long dep_prev, unsigned long tag, unsigned long id);
 void _starpu_fxt_dag_add_receive(int dst, unsigned long dep_prev, unsigned long tag, unsigned long id);

+ 22 - 9
src/debug/traces/starpu_fxt_dag.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012                                Inria
- * Copyright (C) 2012,2015,2017                           CNRS
+ * Copyright (C) 2012,2015,2017,2018                      CNRS
  * Copyright (C) 2010-2015,2017                           Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -66,24 +66,37 @@ void _starpu_fxt_dag_terminate(void)
 	fclose(out_file);
 }
 
-void _starpu_fxt_dag_add_tag(const char *prefix, uint64_t tag, unsigned long job_id)
+void _starpu_fxt_dag_add_tag(const char *prefix, uint64_t tag, unsigned long job_id, const char *label)
 {
 	if (out_file)
-		fprintf(out_file, "\t \"tag_%s%llx\"->\"task_%s%lu\"->\"tag_%s%llx\" [style=dashed]\n",
-			prefix, (unsigned long long)tag, prefix, (unsigned long)job_id, prefix, (unsigned long long) tag);
+	{
+		if (label)
+			fprintf(out_file, "\t \"tag_%s%llx\"->\"task_%s%lu\"->\"tag_%s%llx\" [style=dashed] [label=\"%s\"]\n", prefix, (unsigned long long)tag, prefix, (unsigned long)job_id, prefix, (unsigned long long) tag, label);
+		else
+			fprintf(out_file, "\t \"tag_%s%llx\"->\"task_%s%lu\"->\"tag_%s%llx\" [style=dashed]\n", prefix, (unsigned long long)tag, prefix, (unsigned long)job_id, prefix, (unsigned long long) tag);
+	}
 }
 
-void _starpu_fxt_dag_add_tag_deps(const char *prefix, uint64_t child, uint64_t father)
+void _starpu_fxt_dag_add_tag_deps(const char *prefix, uint64_t child, uint64_t father, const char *label)
 {
 	if (out_file)
-		fprintf(out_file, "\t \"tag_%s%llx\"->\"tag_%s%llx\"\n",
-			prefix, (unsigned long long)father, prefix, (unsigned long long)child);
+	{
+		if (label)
+			fprintf(out_file, "\t \"tag_%s%llx\"->\"tag_%s%llx\" [label=\"%s\"]\n", prefix, (unsigned long long)father, prefix, (unsigned long long)child, label);
+		else
+			fprintf(out_file, "\t \"tag_%s%llx\"->\"tag_%s%llx\"\n", prefix, (unsigned long long)father, prefix, (unsigned long long)child);
+	}
 }
 
-void _starpu_fxt_dag_add_task_deps(const char *prefix, unsigned long dep_prev, unsigned long dep_succ)
+void _starpu_fxt_dag_add_task_deps(const char *prefix, unsigned long dep_prev, unsigned long dep_succ, const char *label)
 {
 	if (out_file)
-		fprintf(out_file, "\t \"task_%s%lu\"->\"task_%s%lu\"\n", prefix, dep_prev, prefix, dep_succ);
+	{
+		if (label)
+			fprintf(out_file, "\t \"task_%s%lu\"->\"task_%s%lu\" [label=\"%s\"]\n", prefix, dep_prev, prefix, dep_succ, label);
+		else
+			fprintf(out_file, "\t \"task_%s%lu\"->\"task_%s%lu\"\n", prefix, dep_prev, prefix, dep_succ);
+	}
 }
 
 void _starpu_fxt_dag_set_tag_done(const char *prefix, uint64_t tag, const char *color)

+ 10 - 2
tools/starpu_fxt_tool.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2008-2014,2016-2018                      Université de Bordeaux
- * Copyright (C) 2010-2015,2017                           CNRS
+ * Copyright (C) 2010-2015,2017,2018                      CNRS
  *
  * 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
@@ -16,7 +16,7 @@
  */
 
 /*
- * This program should be used to parse the log generated by FxT 
+ * This program should be used to parse the log generated by FxT
  */
 
 #include <starpu.h>
@@ -41,6 +41,7 @@ static void usage()
 	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, "   -label-deps         add label on dependencies.\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");
@@ -131,6 +132,13 @@ static int parse_args(int argc, char **argv)
 			continue;
 		}
 
+		if (strcmp(argv[i], "-label-deps") == 0)
+		{
+			options.label_deps = 1;
+			reading_input_filenames = 0;
+			continue;
+		}
+
 		if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0)
 		{
 			usage();