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

call update_job_feedback with the good perf_arch

Andra Hugo пре 10 година
родитељ
комит
65bfaeb626

+ 7 - 0
src/drivers/cpu/driver_cpu.c

@@ -238,6 +238,13 @@ int _starpu_cpu_driver_run_once(struct _starpu_worker *cpu_worker)
 			cpu_worker->current_rank = rank;
 			perf_arch = &combined_worker->perf_arch;
 		}
+		else
+		{
+			struct _starpu_sched_ctx *sched_ctx = _starpu_sched_ctx_get_sched_ctx_for_worker_and_job(cpu_worker, j);
+			STARPU_ASSERT_MSG(sched_ctx != NULL, "there should be a worker %d in the ctx of this job \n", cpu_worker->workerid);
+
+			perf_arch = &sched_ctx->perf_arch;
+		}
 	}
 	else
 	{

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

@@ -431,7 +431,13 @@ static void finish_job_on_cuda(struct _starpu_job *j, struct _starpu_worker *wor
 
 	_starpu_driver_end_job(worker, j, &worker->perf_arch, &codelet_end, 0, profiling);
 
-	_starpu_driver_update_job_feedback(j, worker, &worker->perf_arch, &j->cl_start, &codelet_end, profiling);
+	struct _starpu_sched_ctx *sched_ctx = _starpu_sched_ctx_get_sched_ctx_for_worker_and_job(worker, j);
+	STARPU_ASSERT_MSG(sched_ctx != NULL, "there should be a worker %d in the ctx of this job \n", worker->workerid);
+
+	if(!sched_ctx->sched_policy)
+		_starpu_driver_update_job_feedback(j, worker, &sched_ctx->perf_arch, &j->cl_start, &codelet_end, profiling);
+	else
+		_starpu_driver_update_job_feedback(j, worker, &worker->perf_arch, &j->cl_start, &codelet_end, profiling);
 
 	_starpu_push_task_output(j);
 

+ 0 - 11
src/drivers/driver_common/driver_common.c

@@ -166,17 +166,6 @@ void _starpu_driver_update_job_feedback(struct _starpu_job *j, struct _starpu_wo
 					struct starpu_perfmodel_arch* perf_arch,
 					struct timespec *codelet_start, struct timespec *codelet_end, int profiling)
 {
-	struct _starpu_sched_ctx *sched_ctx = _starpu_sched_ctx_get_sched_ctx_for_worker_and_job(worker, j);
-	STARPU_ASSERT_MSG(sched_ctx != NULL, "there should be a worker %d in the ctx of this job \n", worker->workerid);
-
-	if (!sched_ctx->sched_policy)
-	{
-       		if(sched_ctx->main_master == worker->workerid)
-			*perf_arch = sched_ctx->perf_arch;
-		else
-			return;
-	}
-
 	struct starpu_profiling_task_info *profiling_info = j->task->profiling_info;
 	struct timespec measured_ts;
 	double measured;

+ 6 - 1
src/drivers/opencl/driver_opencl.c

@@ -869,7 +869,12 @@ static void _starpu_opencl_stop_job(struct _starpu_job *j, struct _starpu_worker
 
 	_starpu_driver_end_job(worker, j, &worker->perf_arch, &codelet_end, 0, profiling);
 
-	_starpu_driver_update_job_feedback(j, worker, &worker->perf_arch, &j->cl_start, &codelet_end, profiling);
+	struct _starpu_sched_ctx *sched_ctx = _starpu_sched_ctx_get_sched_ctx_for_worker_and_job(worker, j);
+	STARPU_ASSERT_MSG(sched_ctx != NULL, "there should be a worker %d in the ctx of this job \n", worker->workerid);
+	if(!sched_ctx->policy)
+		_starpu_driver_update_job_feedback(j, worker, &sched_ctx->perf_arch, &j->cl_start, &codelet_end, profiling);
+	else
+		_starpu_driver_update_job_feedback(j, worker, &worker->perf_arch, &j->cl_start, &codelet_end, profiling);
 
 	_starpu_push_task_output(j);