Kaynağa Gözat

In 'compute_all_performance_predictions', it's better to avoid invalid implementations directly than executing pointless instructions.

Nicolas Collin 13 yıl önce
ebeveyn
işleme
9a8afecaf6
1 değiştirilmiş dosya ile 6 ekleme ve 6 silme
  1. 6 6
      src/sched_policies/heft.c

+ 6 - 6
src/sched_policies/heft.c

@@ -258,6 +258,12 @@ static void compute_all_performance_predictions(struct starpu_task *task,
 	{
 		for (nimpl = 0; nimpl < STARPU_MAXIMPLEMENTATIONS; nimpl++)
 		{
+			if (!starpu_worker_can_execute_task(worker, task, nimpl))
+			{
+				/* no one on that queue may execute this task */
+				continue;
+			}
+
 			/* Sometimes workers didn't take the tasks as early as we expected */
 			_STARPU_PTHREAD_MUTEX_LOCK(&sched_mutex[worker]);
 			exp_start[worker] = STARPU_MAX(exp_start[worker], starpu_timing_now());
@@ -266,12 +272,6 @@ static void compute_all_performance_predictions(struct starpu_task *task,
 				max_exp_end = exp_end[worker][nimpl];
 			_STARPU_PTHREAD_MUTEX_UNLOCK(&sched_mutex[worker]);
 
-			if (!starpu_worker_can_execute_task(worker, task, nimpl))
-			{
-				/* no one on that queue may execute this task */
-				continue;
-			}
-
 			enum starpu_perf_archtype perf_arch = starpu_worker_get_perf_archtype(worker);
 			unsigned memory_node = starpu_worker_get_memory_node(worker);