Browse Source

Show worker GFlops in traces

Samuel Thibault 8 years ago
parent
commit
8d0579b8a3
3 changed files with 27 additions and 6 deletions
  1. 2 2
      src/common/fxt.h
  2. 23 4
      src/debug/traces/starpu_fxt.c
  3. 2 0
      src/debug/traces/starpu_paje.c

+ 2 - 2
src/common/fxt.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
- * Copyright (C) 2009-2016  Université de Bordeaux
+ * Copyright (C) 2009-2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2016  CNRS
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2016  CNRS
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * StarPU is free software; you can redistribute it and/or modify
@@ -488,7 +488,7 @@ do {									\
 		}							\
 		}							\
 		const size_t __job_size = _starpu_job_get_data_size((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job));	\
 		const size_t __job_size = _starpu_job_get_data_size((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job));	\
 		const uint32_t __job_hash = _starpu_compute_buffers_footprint((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job));\
 		const uint32_t __job_hash = _starpu_compute_buffers_footprint((job)->task->cl?(job)->task->cl->model:NULL, perf_arch, nimpl, (job));\
-		FUT_DO_PROBE7(_STARPU_FUT_CODELET_DETAILS, (job), ((job)->task)->sched_ctx, __job_size, __job_hash, (job)->task->tag_id, workerid, ((job)->job_id)); \
+		FUT_DO_PROBE7(_STARPU_FUT_CODELET_DETAILS, ((job)->task)->sched_ctx, __job_size, __job_hash, (job)->task->flops / 1000, (job)->task->tag_id, workerid, ((job)->job_id)); \
 	}								\
 	}								\
 } while(0);
 } while(0);
 
 

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

@@ -91,6 +91,7 @@ struct task_info {
 	double start_time;
 	double start_time;
 	double end_time;
 	double end_time;
 	unsigned long footprint;
 	unsigned long footprint;
+	unsigned long kflops;
 	char *parameters;
 	char *parameters;
 	unsigned int ndeps;
 	unsigned int ndeps;
 	unsigned long *dependencies;
 	unsigned long *dependencies;
@@ -931,12 +932,15 @@ static void handle_worker_init_start(struct fxt_ev_64 *ev, struct starpu_fxt_opt
 		if (new_thread)
 		if (new_thread)
 			poti_CreateContainer(get_event_time_stamp(ev, options), new_thread_container_alias, "T", memnode_container, new_thread_container_name);
 			poti_CreateContainer(get_event_time_stamp(ev, options), new_thread_container_alias, "T", memnode_container, new_thread_container_name);
 		poti_CreateContainer(get_event_time_stamp(ev, options), new_worker_container_alias, "W", new_thread_container_alias, new_worker_container_name);
 		poti_CreateContainer(get_event_time_stamp(ev, options), new_worker_container_alias, "W", new_thread_container_alias, new_worker_container_name);
+		poti_SetVariable(get_event_time_stamp(ev, options), new_worker_container_alias, "gf", get_event_time_stamp(ev, options));
 #else
 #else
 		if (new_thread)
 		if (new_thread)
 			fprintf(out_paje_file, "7	%.9f	%st%lu	T	%smn%d	%s%d\n",
 			fprintf(out_paje_file, "7	%.9f	%st%lu	T	%smn%d	%s%d\n",
 				get_event_time_stamp(ev, options), prefix, threadid, prefix, nodeid, prefix, bindid);
 				get_event_time_stamp(ev, options), prefix, threadid, prefix, nodeid, prefix, bindid);
 		fprintf(out_paje_file, "7	%.9f	%sw%d	W	%st%lu	%s%s%d\n",
 		fprintf(out_paje_file, "7	%.9f	%sw%d	W	%st%lu	%s%s%d\n",
 			get_event_time_stamp(ev, options), prefix, workerid, prefix, threadid, prefix, kindstr, devid);
 			get_event_time_stamp(ev, options), prefix, workerid, prefix, threadid, prefix, kindstr, devid);
+		fprintf(out_paje_file, "13	%.9f	%sw%d	gf	0.0\n",
+			get_event_time_stamp(ev, options), prefix, workerid);
 #endif
 #endif
 	}
 	}
 
 
@@ -1271,7 +1275,8 @@ static void handle_codelet_details(struct fxt_ev_64 *ev, struct starpu_fxt_optio
 
 
 	struct task_info *task = get_task(job_id, options->file_rank);
 	struct task_info *task = get_task(job_id, options->file_rank);
 	task->parameters = strdup(parameters);
 	task->parameters = strdup(parameters);
-	task->footprint = ev->param[3];
+	task->footprint = ev->param[2];
+	task->kflops = ev->param[3];
 	task->tag = ev->param[4];
 	task->tag = ev->param[4];
 
 
 	if (out_paje_file)
 	if (out_paje_file)
@@ -1279,9 +1284,9 @@ static void handle_codelet_details(struct fxt_ev_64 *ev, struct starpu_fxt_optio
 
 
 #ifdef STARPU_ENABLE_PAJE_CODELET_DETAILS
 #ifdef STARPU_ENABLE_PAJE_CODELET_DETAILS
 		char *prefix = options->file_prefix;
 		char *prefix = options->file_prefix;
-		unsigned sched_ctx = ev->param[1];
+		unsigned sched_ctx = ev->param[0];
 
 
-		worker_set_detailed_state(last_codelet_start[worker], prefix, worker, _starpu_last_codelet_symbol[worker], ev->param[2], parameters, ev->param[3], ev->param[4], job_id);
+		worker_set_detailed_state(last_codelet_start[worker], prefix, worker, _starpu_last_codelet_symbol[worker], ev->param[1], parameters, ev->param[2], ev->param[4], job_id);
 		if (sched_ctx != 0)
 		if (sched_ctx != 0)
 		{
 		{
 #ifdef STARPU_HAVE_POTI
 #ifdef STARPU_HAVE_POTI
@@ -1291,7 +1296,7 @@ static void handle_codelet_details(struct fxt_ev_64 *ev, struct starpu_fxt_optio
 			worker_container_alias(container, STARPU_POTI_STR_LEN, prefix, worker);
 			worker_container_alias(container, STARPU_POTI_STR_LEN, prefix, worker);
 			poti_SetState(last_codelet_start[worker], container, ctx, _starpu_last_codelet_symbol[worker]);
 			poti_SetState(last_codelet_start[worker], container, ctx, _starpu_last_codelet_symbol[worker]);
 #else
 #else
-			fprintf(out_paje_file, "20	%.9f	%sw%d	Ctx%u	%s	%ld	%s	%08lx	%016lx	%lu\n", last_codelet_start[worker], prefix, worker, sched_ctx, _starpu_last_codelet_symbol[worker], ev->param[2], parameters,  ev->param[3], ev->param[4], job_id);
+			fprintf(out_paje_file, "20	%.9f	%sw%d	Ctx%u	%s	%ld	%s	%08lx	%016lx	%lu\n", last_codelet_start[worker], prefix, worker, sched_ctx, _starpu_last_codelet_symbol[worker], ev->param[1], parameters,  ev->param[2], ev->param[4], job_id);
 #endif
 #endif
 		}
 		}
 #endif /* STARPU_ENABLE_PAJE_CODELET_DETAILS */
 #endif /* STARPU_ENABLE_PAJE_CODELET_DETAILS */
@@ -1320,11 +1325,25 @@ static void handle_end_codelet_body(struct fxt_ev_64 *ev, struct starpu_fxt_opti
 		recfmt_worker_set_state(end_codelet_time, worker, "I", "Other");
 		recfmt_worker_set_state(end_codelet_time, worker, "I", "Other");
 
 
 	double codelet_length = (end_codelet_time - last_codelet_start[worker]);
 	double codelet_length = (end_codelet_time - last_codelet_start[worker]);
+	struct task_info *task = get_task(ev->param[0], options->file_rank);
+	double gflops = (((double)task->kflops) / 1000000) / (codelet_length / 1000);
 
 
 	get_task(ev->param[0], options->file_rank)->end_time = end_codelet_time;
 	get_task(ev->param[0], options->file_rank)->end_time = end_codelet_time;
 
 
 	update_accumulated_time(worker, 0.0, codelet_length, end_codelet_time, 0);
 	update_accumulated_time(worker, 0.0, codelet_length, end_codelet_time, 0);
 
 
+#ifdef STARPU_HAVE_POTI
+	char container[STARPU_POTI_STR_LEN];
+	worker_container_alias(container, STARPU_POTI_STR_LEN, prefix, worker);
+	poti_SetVariable(task->start_time, container, "gf", gflops);
+	poti_SetVariable(end_codelet_time, container, "gf", 0);
+#else
+	fprintf(out_paje_file, "13	%.9f	%sw%u	gf	%f\n",
+			task->start_time, prefix, worker, gflops);
+	fprintf(out_paje_file, "13	%.9f	%sw%u	gf	%f\n",
+			end_codelet_time, prefix, worker, 0.);
+#endif
+
 	if (distrib_time)
 	if (distrib_time)
 	     fprintf(distrib_time, "%s\t%s%d\t%ld\t%"PRIx32"\t%.9f\n", _starpu_last_codelet_symbol[worker],
 	     fprintf(distrib_time, "%s\t%s%d\t%ld\t%"PRIx32"\t%.9f\n", _starpu_last_codelet_symbol[worker],
 		     prefix, worker, (unsigned long) codelet_size, codelet_hash, codelet_length);
 		     prefix, worker, (unsigned long) codelet_size, codelet_hash, codelet_length);

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

@@ -176,6 +176,7 @@ void _starpu_fxt_write_paje_header(FILE *file STARPU_ATTRIBUTE_UNUSED)
 	/* Types for the Worker of the Memory Node */
 	/* Types for the Worker of the Memory Node */
 	poti_DefineEventType("user_event", "T", "user event type");
 	poti_DefineEventType("user_event", "T", "user event type");
 	poti_DefineEventType("thread_event", "T", "thread event type");
 	poti_DefineEventType("thread_event", "T", "thread event type");
+	poti_DefineVariableType("gf", "T", "GFlops", "0 0 0");
 	poti_DefineStateType("S", "T", "Thread State");
 	poti_DefineStateType("S", "T", "Thread State");
 	poti_DefineEntityValue("I", "S", "Idle", ".9 .1 0");
 	poti_DefineEntityValue("I", "S", "Idle", ".9 .1 0");
 	poti_DefineEntityValue("In", "S", "Initializing", "0.0 .7 1.0");
 	poti_DefineEntityValue("In", "S", "Initializing", "0.0 .7 1.0");
@@ -302,6 +303,7 @@ void _starpu_fxt_write_paje_header(FILE *file STARPU_ATTRIBUTE_UNUSED)
 4       nready    Sc       \"Number of Ready Tasks\"                        \n\
 4       nready    Sc       \"Number of Ready Tasks\"                        \n\
 4       bwi     Mm       \"Bandwidth In\"                        \n\
 4       bwi     Mm       \"Bandwidth In\"                        \n\
 4       bwo     Mm       \"Bandwidth Out\"                        \n\
 4       bwo     Mm       \"Bandwidth Out\"                        \n\
+4       gf      T       \"GFlops\"                        \n\
 6       I       S       Idle         \".9 .1 .0\"		\n\
 6       I       S       Idle         \".9 .1 .0\"		\n\
 6       In       S      Initializing       \"0.0 .7 1.0\"            \n\
 6       In       S      Initializing       \"0.0 .7 1.0\"            \n\
 6       D       S      Deinitializing       \"0.0 .1 .7\"            \n\
 6       D       S      Deinitializing       \"0.0 .1 .7\"            \n\