Przeglądaj źródła

src/sched_policies/component_heft.c: bug fix: initialize max_benefit to max_exp_end_with_task[0] - min_exp_end_with_task[0]

Nathalie Furmento 7 lat temu
rodzic
commit
5f7f82cb8e
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      src/sched_policies/component_heft.c

+ 2 - 2
src/sched_policies/component_heft.c

@@ -105,10 +105,10 @@ static int heft_progress_one(struct starpu_sched_component *component)
 		}
 
 		int best_task = 0;
-		double max_benefit = 0;
+		double max_benefit =  max_exp_end_with_task[0] - min_exp_end_with_task[0];
 
 		/* Find the task which provides the most computation time benefit */
-		for (n = 1; n < ntasks; n++)
+		for (n = 0; n < ntasks; n++)
 		{
 			double benefit = max_exp_end_with_task[n] - min_exp_end_with_task[n];
 			if (max_benefit < benefit)