浏览代码

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

Nathalie Furmento 12 年之前
父节点
当前提交
a978d4a180
共有 1 个文件被更改,包括 7 次插入6 次删除
  1. 7 6
      src/sched_policies/heft.c

+ 7 - 6
src/sched_policies/heft.c

@@ -322,6 +322,13 @@ static void compute_all_performance_predictions(struct starpu_task *task,
 
 
 			for (nimpl = 0; nimpl <STARPU_MAXIMPLEMENTATIONS; nimpl++) 
 			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 */
+//				worker_ctx++;
+					continue;
+				}
+
 				/* Sometimes workers didn't take the tasks as early as we expected */
 				/* Sometimes workers didn't take the tasks as early as we expected */
 				pthread_mutex_t *sched_mutex;
 				pthread_mutex_t *sched_mutex;
 				pthread_cond_t *sched_cond;
 				pthread_cond_t *sched_cond;
@@ -332,12 +339,6 @@ static void compute_all_performance_predictions(struct starpu_task *task,
 				if (exp_end[worker_ctx][nimpl] > max_exp_end)
 				if (exp_end[worker_ctx][nimpl] > max_exp_end)
 					max_exp_end = exp_end[worker_ctx][nimpl];
 					max_exp_end = exp_end[worker_ctx][nimpl];
 				_STARPU_PTHREAD_MUTEX_UNLOCK(sched_mutex);
 				_STARPU_PTHREAD_MUTEX_UNLOCK(sched_mutex);
-				if (!starpu_worker_can_execute_task(worker, task, nimpl))
-				{
-					/* no one on that queue may execute this task */
-//				worker_ctx++;
-					continue;
-				}
 				
 				
 				enum starpu_perf_archtype perf_arch = starpu_worker_get_perf_archtype(worker);
 				enum starpu_perf_archtype perf_arch = starpu_worker_get_perf_archtype(worker);
 				unsigned memory_node = starpu_worker_get_memory_node(worker);
 				unsigned memory_node = starpu_worker_get_memory_node(worker);