浏览代码

workaround on graph_test bug when calling set_priority on tasks that have already been queued in priority queues

Olivier Aumage 8 年之前
父节点
当前提交
3cb712851d
共有 1 个文件被更改,包括 9 次插入2 次删除
  1. 9 2
      src/sched_policies/graph_test_policy.c

+ 9 - 2
src/sched_policies/graph_test_policy.c

@@ -185,8 +185,15 @@ static void do_schedule_graph_test_policy(unsigned sched_ctx_id)
 		_starpu_graph_compute_descendants();
 	else
 		_starpu_graph_compute_depths();
-	data->computed = 1;
-	_starpu_graph_foreach(set_priority, data);
+	if (data->computed == 0)
+	{
+		data->computed = 1;
+
+		/* FIXME: if data->computed already == 1, some tasks may already have been pushed to priority stage '0' in
+		 * push_task_graph_test_policy, then if we change the priority here, the stage lookup to remove the task
+		 * will get the wrong stage */
+		_starpu_graph_foreach(set_priority, data);
+	}
 
 	/* Now that we have priorities, move tasks from bag to priority queue */
 	while(!_starpu_fifo_empty(data->fifo))