Kaynağa Gözat

- The starpu-perfmodel tool may also give the path to the file containing the
model debug log.
- Add some information in the model log (size of the task and predicted time).

Cédric Augonnet 16 yıl önce
ebeveyn
işleme
c66ad02803

+ 3 - 0
include/starpu-perfmodel.h

@@ -99,5 +99,8 @@ struct starpu_perfmodel_t {
 /* This function is intended to be used by external tools that should read the
  * performance model files */
 int starpu_load_history_debug(const char *symbol, struct starpu_perfmodel_t *model);
+void starpu_perfmodel_debugfilepath(struct starpu_perfmodel_t *model,
+		enum starpu_perf_archtype arch, char **path, size_t maxlen);
+
 
 #endif // __STARPU_PERFMODEL_H__

+ 27 - 1
src/core/perfmodel/perfmodel_history.c

@@ -405,6 +405,32 @@ int starpu_load_history_debug(const char *symbol, struct starpu_perfmodel_t *mod
 	return 0;
 }
 
+void starpu_perfmodel_debugfilepath(struct starpu_perfmodel_t *model,
+		enum starpu_perf_archtype arch, char **path, size_t maxlen)
+{
+	char *archname;
+
+	STARPU_ASSERT(path);
+
+	switch(arch) {
+		case STARPU_CORE_DEFAULT:
+			archname = "core";
+			break;
+		case STARPU_CUDA_DEFAULT:
+			archname = "cuda";
+			break;
+		case STARPU_GORDON_DEFAULT:
+			archname = "gordon";
+			break;
+		default:
+			/* unknown architecture */
+			*path = NULL;
+			return;
+	}
+
+	get_model_debug_path(model, archname, *path, maxlen);
+}
+
 double regression_based_job_expected_length(struct starpu_perfmodel_t *model, enum starpu_perf_archtype arch, struct job_s *j)
 {
 	double exp = -1.0;
@@ -542,7 +568,7 @@ void update_perfmodel_history(job_t j, enum starpu_perf_archtype arch, unsigned
 
 		STARPU_ASSERT(j->footprint_is_computed);
 
-		fprintf(debug_file, "%x\t%lf\t%d\t\t", j->footprint, measured, cpuid);
+		fprintf(debug_file, "%x\t%d\t%lf\t%lf\t%d\t\t", j->footprint, job_get_data_size(j), measured, j->predicted, cpuid);
 		unsigned i;
 			
 		struct starpu_task *task = j->task;

+ 13 - 0
tools/perfmodel-display.c

@@ -99,6 +99,11 @@ static void display_perf_model(struct starpu_perfmodel_t *model, enum starpu_per
 			fprintf(stderr, "\t\tb = %le\n", arch_model->regression.b);
 			fprintf(stderr, "\t\tc = %le\n", arch_model->regression.c);
 		}
+
+		char *debugname = malloc(1024);
+		starpu_perfmodel_debugfilepath(model, arch, &debugname, 1024);
+		free(debugname);
+		printf("\t debug file path : %s\n", debugname);
 	}
 	else {
 		/* only display the parameter that was specifically requested */
@@ -127,6 +132,14 @@ static void display_perf_model(struct starpu_perfmodel_t *model, enum starpu_per
 			return;
 		}
 
+		if (strcmp(parameter, "path-file-debug") == 0) {
+			char *debugname = malloc(1024);
+			starpu_perfmodel_debugfilepath(model, arch, &debugname, 1024);
+			printf("%s\n", debugname);
+			free(debugname);
+			return;
+		}
+
 		/* TODO display if it's valid ? */
 
 		fprintf(stderr, "Unknown parameter requested, aborting.\n");