From c57d8f397d0201fb776f078e1db09cd72380a615 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <schaller@strw.leidenuniv.nl> Date: Fri, 29 Mar 2019 12:07:52 +0100 Subject: [PATCH] Allow the creation of hydro self-tasks in a cell that has only stars as they will be needed to set the super pointer and the corresponding drift/feedback tasks. --- src/engine_maketasks.c | 3 ++- src/scheduler.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/engine_maketasks.c b/src/engine_maketasks.c index d1858f87ff..5339e2c582 100644 --- a/src/engine_maketasks.c +++ b/src/engine_maketasks.c @@ -2044,6 +2044,7 @@ void engine_make_hydroloop_tasks_mapper(void *map_data, int num_elements, struct engine *e = (struct engine *)extra_data; const int periodic = e->s->periodic; const int with_feedback = (e->policy & engine_policy_feedback); + const int with_stars = (e->policy & engine_policy_stars); struct space *s = e->s; struct scheduler *sched = &e->sched; @@ -2066,7 +2067,7 @@ void engine_make_hydroloop_tasks_mapper(void *map_data, int num_elements, struct cell *ci = &cells[cid]; /* Skip cells without hydro or star particles */ - if ((ci->hydro.count == 0) && (!with_feedback || ci->stars.count == 0)) + if ((ci->hydro.count == 0) && (!with_stars || ci->stars.count == 0)) continue; /* If the cell is local build a self-interaction */ diff --git a/src/scheduler.c b/src/scheduler.c index 729b566e3b..f7fbd578a4 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -545,6 +545,7 @@ static void scheduler_splittask_hydro(struct task *t, struct scheduler *s) { /* Note this is not very clean as the scheduler should not really access the engine... */ const int with_feedback = (s->space->e->policy & engine_policy_feedback); + const int with_stars = (s->space->e->policy & engine_policy_stars); /* Iterate on this task until we're done with it. */ int redo = 1; @@ -556,7 +557,7 @@ static void scheduler_splittask_hydro(struct task *t, struct scheduler *s) { /* Is this a non-empty self-task? */ const int is_self = (t->type == task_type_self) && (t->ci != NULL) && - ((t->ci->hydro.count > 0) || (with_feedback && t->ci->stars.count > 0)); + ((t->ci->hydro.count > 0) || (with_stars && t->ci->stars.count > 0)); /* Is this a non-empty pair-task? */ const int is_pair = -- GitLab