From 71c99fc6428c52e640e2d641800867b5cf0d255f Mon Sep 17 00:00:00 2001 From: Pedro Gonnet <gonnet@google.com> Date: Thu, 30 Mar 2017 22:34:57 +0200 Subject: [PATCH] formatting. --- src/engine.c | 14 +++++--------- src/scheduler.c | 25 ++++++++++++------------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/engine.c b/src/engine.c index c80048689b..8f752f7363 100644 --- a/src/engine.c +++ b/src/engine.c @@ -1726,23 +1726,19 @@ void engine_count_and_link_tasks(struct engine *e) { struct task *const t = &sched->tasks[ind]; struct cell *const ci = t->ci; struct cell *const cj = t->cj; - + /* Link sort tasks to the next-higher sort task. */ if (t->type == task_type_sort) { struct cell *finger = t->ci->parent; - while (finger != NULL && finger->sorts == NULL) - finger = finger->parent; - if (finger != NULL) - scheduler_addunlock(sched, t, finger->sorts); + while (finger != NULL && finger->sorts == NULL) finger = finger->parent; + if (finger != NULL) scheduler_addunlock(sched, t, finger->sorts); } /* Link drift tasks to the next-higher drift task. */ else if (t->type == task_type_drift) { struct cell *finger = t->ci->parent; - while (finger != NULL && finger->drift == NULL) - finger = finger->parent; - if (finger != NULL) - scheduler_addunlock(sched, t, finger->drift); + while (finger != NULL && finger->drift == NULL) finger = finger->parent; + if (finger != NULL) scheduler_addunlock(sched, t, finger->drift); } /* Link self tasks to cells. */ diff --git a/src/scheduler.c b/src/scheduler.c index 2579cf0041..2d788b9193 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -175,12 +175,12 @@ static void scheduler_splittask(struct task *t, struct scheduler *s) { /* Depend on local sorts on this cell. */ if (ci->sorts != NULL) scheduler_addunlock(s, ci->sorts, t); - + /* Add a drift task to this cell. */ lock_lock(&ci->lock); if (ci->drift == NULL) - ci->drift = scheduler_addtask(s, task_type_drift, task_subtype_none, 0, - 0, ci, NULL, 0); + ci->drift = scheduler_addtask(s, task_type_drift, task_subtype_none, + 0, 0, ci, NULL, 0); lock_unlock_blind(&ci->lock); /* Otherwise, make tasks explicitly. */ @@ -252,20 +252,19 @@ static void scheduler_splittask(struct task *t, struct scheduler *s) { /* Depend on the sort tasks of both cells. */ if (ci->sorts != NULL) scheduler_addunlock(s, ci->sorts, t); if (cj->sorts != NULL) scheduler_addunlock(s, cj->sorts, t); - + /* Add a drift task to the cells, if needed. */ lock_lock(&ci->lock); if (ci->drift == NULL) - ci->drift = scheduler_addtask(s, task_type_drift, task_subtype_none, 0, - 0, ci, NULL, 0); + ci->drift = scheduler_addtask(s, task_type_drift, task_subtype_none, + 0, 0, ci, NULL, 0); lock_unlock_blind(&ci->lock); lock_lock(&cj->lock); if (cj->drift == NULL) - cj->drift = scheduler_addtask(s, task_type_drift, task_subtype_none, 0, - 0, cj, NULL, 0); + cj->drift = scheduler_addtask(s, task_type_drift, task_subtype_none, + 0, 0, cj, NULL, 0); lock_unlock_blind(&cj->lock); - /* Otherwise, split it. */ } else { @@ -646,8 +645,8 @@ static void scheduler_splittask(struct task *t, struct scheduler *s) { /* Create the drift and sort for ci. */ lock_lock(&ci->lock); if (ci->drift == NULL) - ci->drift = scheduler_addtask(s, task_type_drift, task_subtype_none, 0, - 0, ci, NULL, 0); + ci->drift = scheduler_addtask(s, task_type_drift, task_subtype_none, + 0, 0, ci, NULL, 0); if (ci->sorts == NULL) ci->sorts = scheduler_addtask(s, task_type_sort, task_subtype_none, 1 << sid, 0, ci, NULL, 0); @@ -659,8 +658,8 @@ static void scheduler_splittask(struct task *t, struct scheduler *s) { /* Create the sort for cj. */ lock_lock(&cj->lock); if (cj->drift == NULL) - cj->drift = scheduler_addtask(s, task_type_drift, task_subtype_none, 0, - 0, cj, NULL, 0); + cj->drift = scheduler_addtask(s, task_type_drift, task_subtype_none, + 0, 0, cj, NULL, 0); if (cj->sorts == NULL) cj->sorts = scheduler_addtask(s, task_type_sort, task_subtype_none, 1 << sid, 0, cj, NULL, 0); -- GitLab