Browse Source

component_eager: fix pull_task

The default would pull from the component above, but the component above
will not know it has to filter out tasks that can't be executed by the
component below. We can instead make the component above push tasks (and
possibly fail if it can't be executed).

Fixes #6
Samuel Thibault 4 years ago
parent
commit
91de62df6e
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/sched_policies/component_eager.c

+ 10 - 0
src/sched_policies/component_eager.c

@@ -114,6 +114,15 @@ static int eager_can_push(struct starpu_sched_component * component, struct star
 	return success;
 	return success;
 }
 }
 
 
+static struct starpu_task *eager_pull_task(struct starpu_sched_component * component, struct starpu_sched_component * to)
+{
+	/* We can't directly pull (in case the obtained task does not match
+	 * the constraints of `to'), but we can try to push, and components
+	 * below will cope with it */
+	eager_can_push(component, to);
+	return NULL;
+}
+
 static void eager_deinit_data(struct starpu_sched_component *component)
 static void eager_deinit_data(struct starpu_sched_component *component)
 {
 {
 	STARPU_ASSERT(starpu_sched_component_is_eager(component));
 	STARPU_ASSERT(starpu_sched_component_is_eager(component));
@@ -138,6 +147,7 @@ struct starpu_sched_component * starpu_sched_component_eager_create(struct starp
 
 
 	component->data = data;
 	component->data = data;
 	component->push_task = eager_push_task;
 	component->push_task = eager_push_task;
+	component->pull_task = eager_pull_task;
 	component->can_push = eager_can_push;
 	component->can_push = eager_can_push;
 	component->can_pull = starpu_sched_component_can_pull_all;
 	component->can_pull = starpu_sched_component_can_pull_all;
 	component->deinit_data = eager_deinit_data;
 	component->deinit_data = eager_deinit_data;