소스 검색

Measure the overall prediction error (still a TODO on Cell).

Cédric Augonnet 16 년 전
부모
커밋
751a44cbec
3개의 변경된 파일22개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 0
      src/core/mechanisms/queues.h
  2. 10 1
      src/drivers/core/driver_core.c
  3. 11 1
      src/drivers/cuda/driver_cuda.c

+ 1 - 0
src/core/mechanisms/queues.h

@@ -53,6 +53,7 @@ struct jobq_s {
 	double total_computation_time;
 	double total_communication_time;
 	double total_computation_time_error;
+	unsigned total_job_performed;
 
 	/* in case workers are blocked on the queue, signaling on that 
 	  condition must unblock them, even if there is no available task */

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

@@ -85,6 +85,8 @@ int execute_job_on_core(job_t j, struct worker_s *core_args)
 	}
 //#endif
 
+	core_args->jobq->total_job_performed++;
+
 	return STARPU_SUCCESS;
 }
 
@@ -114,6 +116,7 @@ void *core_worker(void *arg)
 	core_arg->jobq->total_computation_time = 0.0;
 	core_arg->jobq->total_communication_time = 0.0;
 	core_arg->jobq->total_computation_time_error = 0.0;
+	core_arg->jobq->total_job_performed = 0;
 	
         /* tell the main thread that we are ready */
 	pthread_mutex_lock(&core_arg->mutex);
@@ -158,7 +161,13 @@ void *core_worker(void *arg)
 #endif
 
 #ifdef VERBOSE
-	print_to_logfile("MODEL ERROR: CORE %d ERROR %le EXEC %le RATIO %le\n", core_arg->id, core_arg->jobq->total_computation_time_error, core_arg->jobq->total_computation_time, core_arg->jobq->total_computation_time_error/core_arg->jobq->total_computation_time);
+	double ratio = 0;
+	if (core_arg->jobq->total_job_performed != 0)
+	{
+		ratio = core_arg->jobq->total_computation_time_error/core_arg->jobq->total_computation_time;
+	}
+
+	print_to_logfile("MODEL ERROR: CORE %d ERROR %lf EXEC %lf RATIO %lf NTASKS %d\n", core_arg->id, core_arg->jobq->total_computation_time_error, core_arg->jobq->total_computation_time, ratio, core_arg->jobq->total_job_performed);
 #endif
 
 	TRACE_WORKER_TERMINATED(FUT_CORE_KEY);

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

@@ -316,6 +316,8 @@ int execute_job_on_cuda(job_t j, struct worker_s *args, unsigned use_cublas)
 	}
 //#endif
 
+	args->jobq->total_job_performed++;
+
 	push_codelet_output(task->buffers, cl->nbuffers, mask);
 
 	return STARPU_SUCCESS;
@@ -346,6 +348,7 @@ void *cuda_worker(void *arg)
 	args->jobq->total_computation_time = 0.0;
 	args->jobq->total_communication_time = 0.0;
 	args->jobq->total_computation_time_error = 0.0;
+	args->jobq->total_job_performed = 0;
 
 	init_context(devid);
 #ifdef VERBOSE
@@ -417,7 +420,14 @@ void *cuda_worker(void *arg)
 #endif
 
 #ifdef VERBOSE
-	print_to_logfile("MODEL ERROR: CUDA %d ERROR %le EXEC %le RATIO %le\n", args->id, args->jobq->total_computation_time_error, args->jobq->total_computation_time, args->jobq->total_computation_time_error/args->jobq->total_computation_time);
+	double ratio = 0;
+	if (args->jobq->total_job_performed != 0)
+	{
+		ratio = args->jobq->total_computation_time_error/args->jobq->total_computation_time;
+	}
+
+
+	print_to_logfile("MODEL ERROR: CUDA %d ERROR %lf EXEC %lf RATIO %lf NTASKS %d\n", args->id, args->jobq->total_computation_time_error, args->jobq->total_computation_time, ratio, args->jobq->total_job_performed);
 #endif
 
 	TRACE_WORKER_TERMINATED(FUT_CUDA_KEY);