Преглед изворни кода

Remove the "execution" Paje state: even if we don't generate colors, we use a
different paje state for each symbol, so that we automatically get the name of
the codelet even without the "-c" option of starpu_fxt_tool. The drawback is
that we cannot directly check the statistics to get the % of time spent in
execution mode.

Cédric Augonnet пре 14 година
родитељ
комит
c97c172d55
2 измењених фајлова са 16 додато и 15 уклоњено
  1. 16 14
      src/debug/traces/starpu_fxt.c
  2. 0 1
      src/debug/traces/starpu_paje.c

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

@@ -274,7 +274,7 @@ static void handle_worker_deinit_end(struct fxt_ev_64 *ev, struct starpu_fxt_opt
 			get_event_time_stamp(ev, options), prefix, ev->param[1]);
 }
 
-static void create_paje_state_if_not_found(char *name)
+static void create_paje_state_if_not_found(char *name, struct starpu_fxt_options *options)
 {
 	symbol_name_itor_t itor;
 	for (itor = symbol_name_list_begin(symbol_list);
@@ -300,13 +300,21 @@ static void create_paje_state_if_not_found(char *name)
 	unsigned hash_symbol_green = get_colour_symbol_green(name);
 	unsigned hash_symbol_blue = get_colour_symbol_blue(name);
 
-	fprintf(stderr, "name %s hash red %u green %u blue %u \n", name, hash_symbol_red, hash_symbol_green, hash_symbol_blue);
-
 	uint32_t hash_sum = hash_symbol_red + hash_symbol_green + hash_symbol_blue;
 
-	float red = (1.0f * hash_symbol_red) / hash_sum;
-	float green = (1.0f * hash_symbol_green) / hash_sum;
-	float blue = (1.0f * hash_symbol_blue) / hash_sum;
+	float red, green, blue;
+	if (options->per_task_colour)
+	{
+		red = (1.0f * hash_symbol_red) / hash_sum;
+		green = (1.0f * hash_symbol_green) / hash_sum;
+		blue = (1.0f * hash_symbol_blue) / hash_sum;
+	}
+	else {
+		/* Use the hardcoded value for execution mode */
+		red = 0.0f;
+		green = 0.6f;
+		blue = 0.4f;
+	}
 
 	/* create the Paje state */
 	fprintf(out_paje_file, "6       %s       S       %s \"%f %f %f\" \n", name, name, red, green, blue);
@@ -333,15 +341,9 @@ static void handle_start_codelet_body(struct fxt_ev_64 *ev, struct starpu_fxt_op
 	float start_codelet_time = get_event_time_stamp(ev, options);
 	last_codelet_start[worker] = start_codelet_time;
 
-	if (options->per_task_colour)
-	{
-		create_paje_state_if_not_found(name);
+	create_paje_state_if_not_found(name, options);
 
-		fprintf(out_paje_file, "10       %f	S      %s%"PRIu64"      %s\n", start_codelet_time, prefix, ev->param[1], name);
-	}
-	else {
-		fprintf(out_paje_file, "10       %f	S      %s%"PRIu64"      E\n", start_codelet_time, prefix, ev->param[1]);
-	}
+	fprintf(out_paje_file, "10       %f	S      %s%"PRIu64"      %s\n", start_codelet_time, prefix, ev->param[1], name);
 }
 
 static void handle_end_codelet_body(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)

+ 0 - 1
src/debug/traces/starpu_paje.c

@@ -139,7 +139,6 @@ void starpu_fxt_write_paje_header(FILE *file)
 	6       D       S      Deinitializing       \"0.0 .1 .7\"            \n \
 	6       Fi       S      FetchingInput       \"1.0 .1 1.0\"            \n \
 	6       Po       S      PushingOutput       \"0.1 1.0 1.0\"            \n \
-	6       E       S       Executing       \".0 .6 .4\"            \n \
 	6       C       S       Callback       \".0 .3 .8\"            \n \
 	6       B       S       Blocked         \".9 .1 .0\"		\n \
 	6       Sl       S      Sleeping         \".9 .1 .0\"		\n \