瀏覽代碼

Bug perf model fixed

Andra Hugo 14 年之前
父節點
當前提交
96e1e48c3f

+ 4 - 5
examples/cholesky_and_lu/cholesky_and_lu.c

@@ -49,13 +49,12 @@ void cholesky_vs_cholesky(params *p1, params *p2, params *p3){
 		 48, 49, 50, 51, 52, 53, 54,
 		 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
 		 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,  78,
-		 79, 80, 81, 82, 83, 84, 85};
-  unsigned id = starpu_create_sched_ctx("heft", NULL, -1, "cholesky");
-  p1->ctx = id;
+		 79, 80, 81};
+  p1->ctx = starpu_create_sched_ctx("heft", procs, 82, "cholesky1");
 
-  int procs2[] =  {86, 87, 88, 89, 90,
+  int procs2[] =  { 82, 83, 84, 85, 86, 87, 88, 89, 90,
 		   91, 92, 93, 94, 95};
-  p2->ctx = id ;//= starpu_create_sched_ctx("heft", procs2, 10, "cholesky2");
+  p2->ctx = starpu_create_sched_ctx("heft", procs2, 14, "cholesky2");
 
   pthread_t tid[2];
   pthread_barrier_init(&barrier, NULL, 2);

+ 1 - 1
src/core/jobs.c

@@ -186,7 +186,7 @@ void _starpu_handle_job_termination(starpu_job_t j, unsigned job_is_already_lock
 			starpu_clock_gettime(&task->profiling_info->callback_end_time);
 	}
 
-	//	_starpu_sched_post_exec_hook(task);
+	_starpu_sched_post_exec_hook(task);
 
 	STARPU_TRACE_TASK_DONE(j);
 

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

@@ -146,8 +146,8 @@ static double starpu_model_expected_perf(struct starpu_task *task, struct starpu
 				return common_task_expected_perf(model, arch, task);
 
 			case STARPU_HISTORY_BASED:
-				return _starpu_history_based_job_expected_perf(model, arch, j);
-
+			    return _starpu_history_based_job_expected_perf(model, arch, j);
+			  
 			case STARPU_REGRESSION_BASED:
 				return _starpu_regression_based_job_expected_perf(model, arch, j);
 

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

@@ -653,6 +653,7 @@ double _starpu_history_based_job_expected_perf(struct starpu_perfmodel_t *model,
 	history = per_arch_model->history;
 	if (!history)
 		return -1.0;
+    
 
 	PTHREAD_RWLOCK_RDLOCK(&model->model_rwlock);
 	entry = _starpu_htbl_search_32(history, key);
@@ -665,7 +666,7 @@ double _starpu_history_based_job_expected_perf(struct starpu_perfmodel_t *model,
 		 * of that task and the scheduler should perhaps put it aside */
 		/* Not calibrated enough */
 		return -1.0;
-
+	  
 	return exp;
 }
 

+ 1 - 1
src/sched_policies/heft.c

@@ -211,7 +211,7 @@ static void compute_all_performance_predictions(struct starpu_task *task,
 	local_power[worker_in_ctx] = starpu_task_expected_power(task, perf_arch);
       }
 
-/*       printf("%d(in ctx%d): local task len = %2.2f locald data penalty = %2.2f local_power = %2.2f\n", worker, worker_in_ctx, local_task_length[worker_in_ctx], local_data_penalty[worker_in_ctx], local_power[worker_in_ctx]); */
+      //      printf("%d: local task len = %2.2f perf model %d\n", worker, local_task_length[worker_in_ctx], task->cl->model->type);
 
       double ntasks_end = hd->ntasks[worker_in_ctx] / starpu_worker_get_relative_speedup(perf_arch);