Browse Source

component_random: fix pull_task

Like eager (see 91de62df6efe "component_eager: fix pull_task") we can't
just use the default pull implementation, and rather tell components
above to push.
Samuel Thibault 4 years ago
parent
commit
489adf368d
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/sched_policies/component_random.c

+ 7 - 0
src/sched_policies/component_random.c

@@ -97,6 +97,12 @@ static int random_push_task(struct starpu_sched_component * component, struct st
 	return ret_val;
 }
 
+static struct starpu_task *random_pull_task(struct starpu_sched_component * from, struct starpu_sched_component *to)
+{
+	starpu_sched_component_can_push(from, to);
+	return NULL;
+}
+
 int starpu_sched_component_is_random(struct starpu_sched_component *component)
 {
 	return component->push_task == random_push_task;
@@ -107,5 +113,6 @@ struct starpu_sched_component * starpu_sched_component_random_create(struct star
 	(void)arg;
 	struct starpu_sched_component * component = starpu_sched_component_create(tree, "random");
 	component->push_task = random_push_task;
+	component->pull_task = random_pull_task;
 	return component;
 }