From 3fedde4085214d7e03602b8c20305eed37e0b010 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <schaller@strw.leidenuniv.nl> Date: Tue, 18 Dec 2018 11:01:14 +0100 Subject: [PATCH] Code formatting. --- src/engine_maketasks.c | 106 ++++++++++++++++++++++++++++------------- src/runner.c | 2 +- src/space.c | 2 +- 3 files changed, 74 insertions(+), 36 deletions(-) diff --git a/src/engine_maketasks.c b/src/engine_maketasks.c index 630486710c..38e9a0275f 100644 --- a/src/engine_maketasks.c +++ b/src/engine_maketasks.c @@ -1436,8 +1436,10 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, t_limiter, t->ci, with_cooling, with_limiter); scheduler_addunlock(sched, t_force, t->ci->super->end_force); - if (with_limiter) scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); + if (with_limiter) + scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); #else /* Start by constructing the task for the second hydro loop */ @@ -1457,8 +1459,10 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, engine_make_hydro_loops_dependencies(sched, t, t_force, t_limiter, t->ci, with_cooling, with_limiter); scheduler_addunlock(sched, t_force, t->ci->super->end_force); - if (with_limiter) scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); + if (with_limiter) + scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); #endif } @@ -1502,9 +1506,12 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, t_limiter, t->ci, with_cooling, with_limiter); scheduler_addunlock(sched, t_force, t->ci->super->end_force); - if (with_limiter) scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep_limiter); + if (with_limiter) + scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep_limiter); } if (t->cj->nodeID == nodeID) { if (t->ci->hydro.super != t->cj->hydro.super) { @@ -1515,9 +1522,13 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, if (t->ci->super != t->cj->super) { scheduler_addunlock(sched, t_force, t->cj->super->end_force); - if (with_limiter) scheduler_addunlock(sched, t->cj->super->kick2, t_limiter); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->cj->super->timestep); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->cj->super->timestep_limiter); + if (with_limiter) + scheduler_addunlock(sched, t->cj->super->kick2, t_limiter); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->cj->super->timestep); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, + t->cj->super->timestep_limiter); } } @@ -1544,9 +1555,12 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, engine_make_hydro_loops_dependencies(sched, t, t_force, t_limiter, t->ci, with_cooling, with_limiter); scheduler_addunlock(sched, t_force, t->ci->super->end_force); - if (with_limiter) scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep_limiter); + if (with_limiter) + scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep_limiter); } if (t->cj->nodeID == nodeID) { if (t->ci->hydro.super != t->cj->hydro.super) { @@ -1556,9 +1570,13 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, if (t->ci->super != t->cj->super) { scheduler_addunlock(sched, t_force, t->cj->super->end_force); - if (with_limiter) scheduler_addunlock(sched, t->cj->super->kick2, t_limiter); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->cj->super->timestep); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->cj->super->timestep_limiter); + if (with_limiter) + scheduler_addunlock(sched, t->cj->super->kick2, t_limiter); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->cj->super->timestep); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, + t->cj->super->timestep_limiter); } } @@ -1601,9 +1619,12 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, t_limiter, t->ci, with_cooling, with_limiter); scheduler_addunlock(sched, t_force, t->ci->super->end_force); - if (with_limiter) scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep_limiter); + if (with_limiter) + scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep_limiter); } #else @@ -1627,9 +1648,12 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, engine_make_hydro_loops_dependencies(sched, t, t_force, t_limiter, t->ci, with_cooling, with_limiter); scheduler_addunlock(sched, t_force, t->ci->super->end_force); - if (with_limiter) scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep_limiter); + if (with_limiter) + scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep_limiter); } #endif } @@ -1678,9 +1702,12 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, t_limiter, t->ci, with_cooling, with_limiter); scheduler_addunlock(sched, t_force, t->ci->super->end_force); - if (with_limiter) scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep_limiter); + if (with_limiter) + scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep_limiter); } if (t->cj->nodeID == nodeID) { if (t->ci->hydro.super != t->cj->hydro.super) { @@ -1691,9 +1718,13 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, if (t->ci->super != t->cj->super) { scheduler_addunlock(sched, t_force, t->cj->super->end_force); - if (with_limiter) scheduler_addunlock(sched, t->cj->super->kick2, t_limiter); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->cj->super->timestep); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->cj->super->timestep_limiter); + if (with_limiter) + scheduler_addunlock(sched, t->cj->super->kick2, t_limiter); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->cj->super->timestep); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, + t->cj->super->timestep_limiter); } } @@ -1721,9 +1752,12 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, t->ci, with_cooling, with_limiter); scheduler_addunlock(sched, t_force, t->ci->super->end_force); - if (with_limiter) scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->ci->super->timestep_limiter); + if (with_limiter) + scheduler_addunlock(sched, t->ci->super->kick2, t_limiter); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->ci->super->timestep_limiter); } if (t->cj->nodeID == nodeID) { if (t->ci->hydro.super != t->cj->hydro.super) { @@ -1733,9 +1767,13 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, if (t->ci->super != t->cj->super) { scheduler_addunlock(sched, t_force, t->cj->super->end_force); - if (with_limiter) scheduler_addunlock(sched, t->cj->super->kick2, t_limiter); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->cj->super->timestep); - if (with_limiter) scheduler_addunlock(sched, t_limiter, t->cj->super->timestep_limiter); + if (with_limiter) + scheduler_addunlock(sched, t->cj->super->kick2, t_limiter); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, t->cj->super->timestep); + if (with_limiter) + scheduler_addunlock(sched, t_limiter, + t->cj->super->timestep_limiter); } } #endif diff --git a/src/runner.c b/src/runner.c index 8bd8fa3252..1fb616bc8f 100644 --- a/src/runner.c +++ b/src/runner.c @@ -2403,7 +2403,7 @@ void runner_do_limiter(struct runner *r, struct cell *c, int force, int timer) { /* Avoid inhibited particles */ if (part_is_inhibited(p, e)) continue; - + /* If the particle will be active no need to wake it up */ if (part_is_active(p, e) && p->wakeup != time_bin_not_awake) p->wakeup = time_bin_not_awake; diff --git a/src/space.c b/src/space.c index 8b2b9b5008..69d8fe95bd 100644 --- a/src/space.c +++ b/src/space.c @@ -4288,7 +4288,7 @@ void space_check_limiter_mapper(void *map_data, int nr_parts, for (int k = 0; k < nr_parts; k++) { if (parts[k].time_bin == time_bin_inhibited) continue; - + if (parts[k].wakeup == time_bin_awake) error("Particle still woken up! id=%lld", parts[k].id); -- GitLab