From d87df577f834f5d38b5b3769c7e352141b87c906 Mon Sep 17 00:00:00 2001 From: Pedro Gonnet <gonnet@google.com> Date: Thu, 19 Jan 2017 22:02:12 +0100 Subject: [PATCH] formatting. --- src/active.h | 4 ++-- src/cell.c | 19 +++++++++---------- src/runner.c | 2 +- src/scheduler.c | 9 ++++----- src/space.c | 4 ++-- 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/active.h b/src/active.h index 04175b43a1..8dfd063fda 100644 --- a/src/active.h +++ b/src/active.h @@ -44,7 +44,7 @@ __attribute__((always_inline)) INLINE static int cell_is_drifted( "Cell has been drifted too far forward in time! c->ti_old=%lld (t=%e) " "and e->ti_current=%lld (t=%e)", c->ti_old, c->ti_old * e->timeBase, e->ti_current, - e->ti_current * e->timeBase); + e->ti_current * e->timeBase); #endif return (c->ti_old == e->ti_current); @@ -66,7 +66,7 @@ __attribute__((always_inline)) INLINE static int cell_is_active( "cell in an impossible time-zone! c->ti_end_min=%lld (t=%e) and " "e->ti_current=%lld (t=%e)", c->ti_end_min, c->ti_end_min * e->timeBase, e->ti_current, - e->ti_current * e->timeBase); + e->ti_current * e->timeBase); #endif return (c->ti_end_min == e->ti_current); diff --git a/src/cell.c b/src/cell.c index 4b7c59527e..733bba3526 100644 --- a/src/cell.c +++ b/src/cell.c @@ -1140,19 +1140,18 @@ void cell_drift(struct cell *c, const struct engine *e) { void cell_check_timesteps(struct cell *c) { #ifdef SWIFT_DEBUG_CHECKS - if(c->ti_end_min == 0 && c->nr_tasks > 0) + if (c->ti_end_min == 0 && c->nr_tasks > 0) error("Cell without assigned time-step"); - - if(c->split) { - for(int k=0; k<8; ++k) - if(c->progeny[k] != NULL) cell_check_timesteps(c->progeny[k]); - } else { - if(c->nodeID == engine_rank) - for(int i=0; i<c->count; ++i) - if(c->parts[i].time_bin == 0) - error("Particle without assigned time-bin"); + if (c->split) { + for (int k = 0; k < 8; ++k) + if (c->progeny[k] != NULL) cell_check_timesteps(c->progeny[k]); + } else { + if (c->nodeID == engine_rank) + for (int i = 0; i < c->count; ++i) + if (c->parts[i].time_bin == 0) + error("Particle without assigned time-bin"); } #endif } diff --git a/src/runner.c b/src/runner.c index 7265c3a0a4..f39e39962d 100644 --- a/src/runner.c +++ b/src/runner.c @@ -958,7 +958,7 @@ void runner_do_kick2(struct runner *r, struct cell *c, int timer) { get_integer_time_begin(ti_current, p->time_bin); #ifdef SWIFT_DEBUG_CHECKS - if (ti_begin + ti_step != ti_current) + if (ti_begin + ti_step != ti_current) error( "Particle in wrong time-bin, ti_begin=%lld, ti_step=%lld " "time_bin=%d ti_current=%lld", diff --git a/src/scheduler.c b/src/scheduler.c index 9ce2ce4427..7650b4ffe3 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -1080,8 +1080,7 @@ void scheduler_start(struct scheduler *s) { struct cell *cj = t->cj; /* Don't check MPI stuff */ - if(t->type == task_type_send || t->type == task_type_recv) - continue; + if (t->type == task_type_send || t->type == task_type_recv) continue; if (cj == NULL) { /* self */ @@ -1108,9 +1107,9 @@ void scheduler_start(struct scheduler *s) { if (t->skip) { - /* Check that the pair is active if the local cell is active */ - if ((ci->ti_end_min == ti_current && ci->nodeID == engine_rank) - || ( cj->ti_end_min == ti_current && cj->nodeID == engine_rank) ) + /* Check that the pair is active if the local cell is active */ + if ((ci->ti_end_min == ti_current && ci->nodeID == engine_rank) || + (cj->ti_end_min == ti_current && cj->nodeID == engine_rank)) error( "Task (type='%s/%s') should not have been skipped " "ti_current=%lld " diff --git a/src/space.c b/src/space.c index c6e01f767b..8d5dc34dc7 100644 --- a/src/space.c +++ b/src/space.c @@ -2037,11 +2037,11 @@ void space_check_drift_point(struct space *s, integertime_t ti_current) { /** * @brief Checks that all particles and local cells have a non-zero time-step. - */ + */ void space_check_timesteps(struct space *s) { #ifdef SWIFT_DEBUG_CHECKS - for (int i=0; i<s->nr_cells; ++i) { + for (int i = 0; i < s->nr_cells; ++i) { cell_check_timesteps(&s->cells_top[i]); } -- GitLab