Browse Source

Call _starpu_worker_exists after interfaces have been filled with the home node interface, so can_execute can use them

Samuel Thibault 12 years ago
parent
commit
8ad8d54621
1 changed files with 7 additions and 7 deletions
  1. 7 7
      src/core/task.c

+ 7 - 7
src/core/task.c

@@ -370,13 +370,6 @@ int starpu_task_submit(struct starpu_task *task)
 	{
 		unsigned i;
 
-		/* Check the type of worker(s) required by the task exist */
-		if (!_starpu_worker_exists(task))
-		{
-                        _STARPU_LOG_OUT_TAG("ENODEV");
-			return -ENODEV;
-                }
-
 		/* Check buffers */
 		STARPU_ASSERT(task->cl->nbuffers <= STARPU_NMAXBUFS);
 		for (i = 0; i < task->cl->nbuffers; i++)
@@ -390,6 +383,13 @@ int starpu_task_submit(struct starpu_task *task)
 				task->interfaces[i] = starpu_data_get_interface_on_node(task->handles[i], handle->home_node);
 		}
 
+		/* Check the type of worker(s) required by the task exist */
+		if (!_starpu_worker_exists(task))
+		{
+                        _STARPU_LOG_OUT_TAG("ENODEV");
+			return -ENODEV;
+                }
+
 		/* In case we require that a task should be explicitely
 		 * executed on a specific worker, we make sure that the worker
 		 * is able to execute this task.  */