浏览代码

from Lionel: sched modular mct: take into account the non-overlapped transfer time in ending time, but count the whole transfer time in fitness.

Samuel Thibault 8 年之前
父节点
当前提交
ac9a282ebc
共有 2 个文件被更改,包括 11 次插入9 次删除
  1. 1 1
      src/sched_policies/component_mct.c
  2. 10 8
      src/sched_policies/helper_mct.c

+ 1 - 1
src/sched_policies/component_mct.c

@@ -73,7 +73,7 @@ static int mct_push_task(struct starpu_sched_component * component, struct starp
 #warning FIXME: take energy consumption into account
 #endif
 		double tmp = starpu_mct_compute_fitness(d,
-					     estimated_ends_with_task[icomponent] - estimated_transfer_length[icomponent],
+					     estimated_ends_with_task[icomponent],
 					     min_exp_end_with_task,
 					     max_exp_end_with_task,
 					     estimated_transfer_length[icomponent],

+ 10 - 8
src/sched_policies/helper_mct.c

@@ -82,26 +82,28 @@ struct _starpu_mct_data *starpu_mct_init_parameters(struct starpu_sched_componen
 
 /* compute predicted_end by taking into account the case of the predicted transfer and the predicted_end overlap
  */
-static double compute_expected_time(double now, double predicted_end, double predicted_length, double *predicted_transfer)
+static double compute_expected_time(double now, double predicted_end, double predicted_length, double predicted_transfer)
 {
-	STARPU_ASSERT(!isnan(now + predicted_end + predicted_length + *predicted_transfer));
-	STARPU_ASSERT(now >= 0.0 && predicted_end >= 0.0 && predicted_length >= 0.0 && *predicted_transfer >= 0.0);
+	STARPU_ASSERT(!isnan(now + predicted_end + predicted_length + predicted_transfer));
+	STARPU_ASSERT(now >= 0.0 && predicted_end >= 0.0 && predicted_length >= 0.0 && predicted_transfer >= 0.0);
 
 	/* TODO: actually schedule transfers */
-	if (now + *predicted_transfer < predicted_end)
+	/* Compute the transfer time which will not be overlapped */
+	/* However, no modification in calling function so that the whole transfer time is counted as a penalty */
+	if (now + predicted_transfer < predicted_end)
 	{
 		/* We may hope that the transfer will be finished by
 		 * the start of the task. */
-		*predicted_transfer = 0;
+		predicted_transfer = 0;
 	}
 	else
 	{
 		/* The transfer will not be finished by then, take the
 		 * remainder into account */
-		*predicted_transfer -= (predicted_end - now);
+		predicted_transfer -= (predicted_end - now);
 	}
 
-	predicted_end += *predicted_transfer;
+	predicted_end += predicted_transfer;
 	predicted_end += predicted_length;
 
 	return predicted_end;
@@ -143,7 +145,7 @@ int starpu_mct_compute_expected_times(struct starpu_sched_component *component,
 			estimated_ends_with_task[i] = compute_expected_time(now,
 									    estimated_end,
 									    estimated_lengths[i],
-									    &estimated_transfer_length[i]);
+									    estimated_transfer_length[i]);
 			if(estimated_ends_with_task[i] < *min_exp_end_with_task)
 				*min_exp_end_with_task = estimated_ends_with_task[i];
 			if(estimated_ends_with_task[i] > *max_exp_end_with_task)