浏览代码

keep the original data transfer time for the beta penalty, otherwise it seems we do not take communications into account enough to achieve overlapping. Proper communication scheduling would allow to replace this heuristic

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

+ 9 - 9
src/sched_policies/helper_mct.c

@@ -21,26 +21,26 @@
 
 /* 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)
+	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;
@@ -50,7 +50,7 @@ double starpu_mct_compute_fitness(struct _starpu_mct_data * d, double exp_end, d
 {
 	/* Note: the expected end includes the data transfer duration, which we want to be able to tune separately */
 
-	return d->alpha * (exp_end - min_exp_end - transfer_len)
+	return d->alpha * (exp_end - min_exp_end)
 		+ d->beta * transfer_len
 		+ d->gamma * local_power
 		+ d->gamma * d->idle_power * (exp_end - max_exp_end);
@@ -77,7 +77,7 @@ int starpu_mct_compute_expected_times(struct starpu_sched_node *node, struct sta
 			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)