ソースを参照

Fix the "ready" version of the dmda policy: don't ignore tasks with the highest priority

Cédric Augonnet 14 年 前
コミット
65a3896a0c
共有1 個のファイルを変更した11 個の追加8 個の削除を含む
  1. 11 8
      src/sched_policies/deque_modeling_policy_data_aware.c

+ 11 - 8
src/sched_policies/deque_modeling_policy_data_aware.c

@@ -79,20 +79,23 @@ struct starpu_task *_starpu_fifo_pop_first_ready_task(struct starpu_fifo_taskq_s
 
 		current = task;
 
-		int non_ready_best = count_non_ready_buffers(current, node);
+		int non_ready_best = INT_MAX;
 
 		while (current)
 		{
 			int priority = current->priority;
-			int non_ready = count_non_ready_buffers(current, node);
 
-			if ((priority < first_task_priority) && (non_ready < non_ready_best))
+			if (priority <= first_task_priority)
 			{
-				non_ready_best = non_ready;
-				task = current;
-
-				if (non_ready == 0)
-					break;
+				int non_ready = count_non_ready_buffers(current, node);
+				if (non_ready < non_ready_best)
+				{
+					non_ready_best = non_ready;
+					task = current;
+
+					if (non_ready == 0)
+						break;
+				}
 			}
 
 			current = current->prev;