浏览代码

Include the worker identifier in the performance model debug logs.

Cédric Augonnet 16 年之前
父节点
当前提交
91bc53fb3e

+ 2 - 1
src/core/perfmodel/perfmodel.h

@@ -88,7 +88,8 @@ void dump_registered_models(void);
 double job_expected_length(uint32_t who, struct job_s *j, enum starpu_perf_archtype arch);
 double regression_based_job_expected_length(struct starpu_perfmodel_t *model,
 		uint32_t who, struct job_s *j);
-void update_perfmodel_history(struct job_s *j, enum starpu_perf_archtype arch, double measured);
+void update_perfmodel_history(struct job_s *j, enum starpu_perf_archtype arch,
+				unsigned cpuid, double measured);
 
 double data_expected_penalty(struct jobq_s *q, struct job_s *j);
 

+ 2 - 2
src/core/perfmodel/perfmodel_history.c

@@ -424,7 +424,7 @@ double history_based_job_expected_length(struct starpu_perfmodel_t *model, enum
 	return exp;
 }
 
-void update_perfmodel_history(job_t j, enum starpu_perf_archtype arch, double measured)
+void update_perfmodel_history(job_t j, enum starpu_perf_archtype arch, unsigned cpuid, double measured)
 {
 	struct starpu_perfmodel_t *model = j->task->cl->model;
 
@@ -514,7 +514,7 @@ void update_perfmodel_history(job_t j, enum starpu_perf_archtype arch, double me
 
 		STARPU_ASSERT(j->footprint_is_computed);
 
-		fprintf(debug_file, "%x\t%lf\t\t", j->footprint, measured);
+		fprintf(debug_file, "%x\t%lf\t%d\t\t", j->footprint, measured, cpuid);
 		unsigned i;
 			
 		struct starpu_task *task = j->task;

+ 1 - 1
src/drivers/core/driver_core.c

@@ -73,7 +73,7 @@ int execute_job_on_core(job_t j, struct worker_s *core_args)
 		core_args->jobq->total_communication_time += measured_comm;
 
 		if (calibrate_model)
-			update_perfmodel_history(j, core_args->arch, measured);
+			update_perfmodel_history(j, core_args->arch, core_args->id, measured);
 	}
 //#endif
 

+ 1 - 1
src/drivers/cuda/driver_cuda.c

@@ -308,7 +308,7 @@ int execute_job_on_cuda(job_t j, struct worker_s *args, unsigned use_cublas)
 		args->jobq->total_communication_time += measured_comm;
 
 		if (calibrate_model)
-			update_perfmodel_history(j, args->arch, measured);
+			update_perfmodel_history(j, args->arch, args->id, measured);
 	}
 //#endif
 

+ 2 - 1
src/drivers/gordon/driver_gordon.c

@@ -246,7 +246,8 @@ static void gordon_callback_list_func(void *arg)
 		struct starpu_perfmodel_t *model = j->task->cl->model;
 		if (model && model->benchmarking)
 		{
-			update_perfmodel_history(j, STARPU_GORDON_DEFAULT, gordon_task->measured);
+			/* XXX we do not retrieve the SPU id yet */
+			update_perfmodel_history(j, STARPU_GORDON_DEFAULT, 0, gordon_task->measured);
 		}
 
 		job_list_push_back(terminated_list, j);

+ 4 - 2
tools/model_distrib.sh

@@ -26,11 +26,13 @@ hashlist=`cut -f 1 $inputfile | sort | uniq | xargs`
 for h in $hashlist
 do
 	echo "Handling tasks with hash = $h"
-	grep "^$h" $inputfile| cut -f 2 > $inputfile.$h
+	grep "^$h" $inputfile| cut -f 2- > $inputfile.$h
 
 R --no-save > /dev/null << EOF
 
-x <- scan("$inputfile.$h")
+table <- read.table("$inputfile.$h")
+
+x <- table[,1]
 hist(x[x > quantile(x,0.01) & x<quantile(x,0.99)], col="red", breaks=50, density=10)
 
 EOF