From 577a9022de88f895ae00d67f76033a6bdf97409e Mon Sep 17 00:00:00 2001
From: Pedro Gonnet <gonnet@google.com>
Date: Wed, 24 May 2017 22:15:28 +0200
Subject: [PATCH] replace 'wait' with 'implicit' in scheduler_addtask, as we
 weren't using the former and could use the latter.

---
 src/scheduler.c | 9 +++++----
 src/scheduler.h | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/scheduler.c b/src/scheduler.c
index 41ed245d62..8c273372b4 100644
--- a/src/scheduler.c
+++ b/src/scheduler.c
@@ -751,12 +751,13 @@ void scheduler_splittasks(struct scheduler *s) {
  * @param type The type of the task.
  * @param subtype The sub-type of the task.
  * @param flags The flags of the task.
- * @param wait The number of unsatisfied dependencies of this task.
+ * @param implicit If true, only use this task to unlock dependencies, i.e.
+ *        this task is never enqueued.
  * @param ci The first cell to interact.
  * @param cj The second cell to interact.
  */
 struct task *scheduler_addtask(struct scheduler *s, enum task_types type,
-                               enum task_subtypes subtype, int flags, int wait,
+                               enum task_subtypes subtype, int flags, int implicit,
                                struct cell *ci, struct cell *cj) {
 
 #ifdef SWIFT_DEBUG_CHECKS
@@ -778,11 +779,11 @@ struct task *scheduler_addtask(struct scheduler *s, enum task_types type,
   t->type = type;
   t->subtype = subtype;
   t->flags = flags;
-  t->wait = wait;
+  t->wait = 0;
   t->ci = ci;
   t->cj = cj;
   t->skip = 1; /* Mark tasks as skip by default. */
-  t->implicit = 0;
+  t->implicit = implicit;
   t->weight = 0;
   t->rank = 0;
   t->nr_unlock_tasks = 0;
diff --git a/src/scheduler.h b/src/scheduler.h
index 7bf9a40e7c..b5d2346ebf 100644
--- a/src/scheduler.h
+++ b/src/scheduler.h
@@ -133,7 +133,7 @@ void scheduler_reset(struct scheduler *s, int nr_tasks);
 void scheduler_ranktasks(struct scheduler *s);
 void scheduler_reweight(struct scheduler *s, int verbose);
 struct task *scheduler_addtask(struct scheduler *s, enum task_types type,
-                               enum task_subtypes subtype, int flags, int wait,
+                               enum task_subtypes subtype, int flags, int implicit,
                                struct cell *ci, struct cell *cj);
 void scheduler_splittasks(struct scheduler *s);
 struct task *scheduler_done(struct scheduler *s, struct task *t);
-- 
GitLab