Browse Source

fxt: save perf_model_arch as a string, there is no need to save the struct contents

Nathalie Furmento 10 years ago
parent
commit
aa82b32a0b
4 changed files with 10 additions and 16 deletions
  1. 1 1
      include/starpu_fxt.h
  2. 3 1
      src/common/fxt.h
  3. 5 10
      src/debug/traces/starpu_fxt.c
  4. 1 4
      tools/starpu_perfmodel_plot.c

+ 1 - 1
include/starpu_fxt.h

@@ -31,7 +31,7 @@ struct starpu_fxt_codelet_event
 {
 	char symbol[256];
 	int workerid;
-	struct starpu_perfmodel_arch arch;
+	char perfmodel_archname[256];
 	uint32_t hash;
 	size_t size;
 	float time;

+ 3 - 1
src/common/fxt.h

@@ -449,7 +449,9 @@ do {									\
 do {									\
 	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));\
-	FUT_DO_PROBE7(_STARPU_FUT_END_CODELET_BODY, (job), (job_size), (job_hash), ((perf_arch)->devices[0]).type, ((perf_arch)->devices[0]).devid, ((perf_arch)->devices[0]).ncores, workerid); \
+	char _archname[32]=""; \
+	starpu_perfmodel_get_arch_name(perf_arch, _archname, 32, 0);	\
+	_STARPU_FUT_DO_PROBE4STR(_STARPU_FUT_END_CODELET_BODY, (job), (job_size), (job_hash), workerid, _archname); \
 } while(0);
 
 #define _STARPU_TRACE_START_EXECUTING()				\

+ 5 - 10
src/debug/traces/starpu_fxt.c

@@ -789,7 +789,7 @@ static struct starpu_fxt_codelet_event *dumped_codelets;
 
 static void handle_end_codelet_body(struct fxt_ev_64 *ev, struct starpu_fxt_options *options)
 {
-	int worker = ev->param[6];
+	int worker = ev->param[3];
 	if (worker < 0) return;
 
 	char *prefix = options->file_prefix;
@@ -800,15 +800,15 @@ static void handle_end_codelet_body(struct fxt_ev_64 *ev, struct starpu_fxt_opti
 	uint32_t codelet_hash = ev->param[2];
 
 	if (out_paje_file)
-		worker_set_state(end_codelet_time, prefix, ev->param[6], "I");
+		worker_set_state(end_codelet_time, prefix, worker, "I");
 
 	double codelet_length = (end_codelet_time - last_codelet_start[worker]);
 
 	update_accumulated_time(worker, 0.0, codelet_length, end_codelet_time, 0);
 
 	if (distrib_time)
-	fprintf(distrib_time, "%s\t%s%d\t%ld\t%"PRIx32"\t%.9f\n", last_codelet_symbol[worker],
-			prefix, worker, (unsigned long) codelet_size, codelet_hash, codelet_length);
+	     fprintf(distrib_time, "%s\t%s%d\t%ld\t%"PRIx32"\t%.9f\n", last_codelet_symbol[worker],
+		     prefix, worker, (unsigned long) codelet_size, codelet_hash, codelet_length);
 
 	if (options->dumped_codelets)
 	{
@@ -817,12 +817,7 @@ static void handle_end_codelet_body(struct fxt_ev_64 *ev, struct starpu_fxt_opti
 
 		snprintf(dumped_codelets[dumped_codelets_count - 1].symbol, 256, "%s", last_codelet_symbol[worker]);
 		dumped_codelets[dumped_codelets_count - 1].workerid = worker;
-		dumped_codelets[dumped_codelets_count - 1].arch.ndevices = 1;
-		dumped_codelets[dumped_codelets_count - 1].arch.devices = (struct starpu_perfmodel_device *)malloc(sizeof(struct starpu_perfmodel_device));
-		dumped_codelets[dumped_codelets_count - 1].arch.devices[0].type = ev->param[3];
-		dumped_codelets[dumped_codelets_count - 1].arch.devices[0].devid = ev->param[4];
-		dumped_codelets[dumped_codelets_count - 1].arch.devices[0].ncores = ev->param[5];
-
+		snprintf(dumped_codelets[dumped_codelets_count - 1].perfmodel_archname, 256, "%s", (char *)&ev->param[4]);
 		dumped_codelets[dumped_codelets_count - 1].size = codelet_size;
 		dumped_codelets[dumped_codelets_count - 1].hash = codelet_hash;
 		dumped_codelets[dumped_codelets_count - 1].time = codelet_length;

+ 1 - 4
tools/starpu_perfmodel_plot.c

@@ -378,13 +378,10 @@ static void dump_data_file(FILE *data_file, struct _perfmodel_plot_options *opti
 		/* Dump only if the symbol matches user's request */
 		if (strncmp(options->dumped_codelets[i].symbol, options->symbol, (FXT_MAX_PARAMS - 4)*sizeof(unsigned long)-1) == 0)
 		{
-			struct starpu_perfmodel_arch* arch = &options->dumped_codelets[i].arch;
-			char archname[32];
-
+			char *archname = options->dumped_codelets[i].perfmodel_archname;
 			size_t size = options->dumped_codelets[i].size;
 			float time = options->dumped_codelets[i].time;
 
-			starpu_perfmodel_get_arch_name(arch, archname, 32, 0);
 			fprintf(data_file, "%s	%f	%f\n", archname, (float)size, time);
 		}
 	}