diff --git a/src/cell.c b/src/cell.c index 00c106efcf5d1af0f4eb9dbf081e1b624a716d4c..480bad5681d09ab143b4f878016ef80dc772eb30 100644 --- a/src/cell.c +++ b/src/cell.c @@ -2120,13 +2120,9 @@ void cell_activate_stars_sorts(struct cell *c, int sid, struct scheduler *s) { } } - // message("c->stars.sorted=%d", c->stars.sorted); - /* Has this cell been sorted at all for the given sid? */ if (!(c->stars.sorted & (1 << sid)) || c->nodeID != engine_rank) { - // message("bbb"); - atomic_or(&c->stars.do_sort, (1 << sid)); cell_activate_stars_sorts_up(c, s); } @@ -3410,8 +3406,7 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s) { const int nodeID = e->nodeID; int rebuild = 0; - if (!with_feedback && c->stars.drift != NULL && cell_is_active_stars(c, e) && - c->nodeID == nodeID) { + if (!with_feedback && c->stars.drift != NULL && cell_is_active_stars(c, e)) { cell_activate_drift_spart(c, s); } diff --git a/src/engine_maketasks.c b/src/engine_maketasks.c index 233ebdd48dc0ce21c52f3f6dd8377ae66c5f5af2..b97244e42610b8596efe733415d4a69536d474ac 100644 --- a/src/engine_maketasks.c +++ b/src/engine_maketasks.c @@ -848,7 +848,10 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c) { if (with_stars) { c->stars.drift = scheduler_addtask(s, task_type_drift_spart, task_subtype_none, 0, 0, c, NULL); - scheduler_addunlock(s, c->stars.drift, c->super->kick2); + + if (!with_feedback) { + scheduler_addunlock(s, c->stars.drift, c->super->kick2); + } } /* Subgrid tasks: cooling */ @@ -891,8 +894,9 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c) { scheduler_addunlock(s, c->super->kick2, c->stars.stars_in); scheduler_addunlock(s, c->stars.stars_out, c->super->timestep); - if (with_star_formation) + if (with_star_formation) { scheduler_addunlock(s, c->hydro.star_formation, c->stars.stars_in); + } } } } else { /* We are above the super-cell so need to go deeper */ @@ -2286,7 +2290,7 @@ void engine_maketasks(struct engine *e) { /* Free the old list of cell-task links. */ if (e->links != NULL) free(e->links); - e->size_links = e->sched.nr_tasks * e->links_per_tasks * 2; + e->size_links = e->sched.nr_tasks * e->links_per_tasks; /* Make sure that we have space for more links than last time. */ if (e->size_links < e->nr_links * engine_rebuild_link_alloc_margin) diff --git a/src/runner.c b/src/runner.c index ab92147c5564ce42dd38fb462e84df30fe16550c..cfe3398684bef7b5a04cbfcefce1ebfe7729e24b 100644 --- a/src/runner.c +++ b/src/runner.c @@ -1817,6 +1817,7 @@ void runner_do_unskip_mapper(void *map_data, int num_elements, } } } + /** * @brief Drift all part in a cell. * diff --git a/src/runner_doiact_stars.h b/src/runner_doiact_stars.h index 98113db916f01a3300453b5a6c0a9ee0c4297804..f208f14ac98a31a55df6741a2cc5f9cb0a829762 100644 --- a/src/runner_doiact_stars.h +++ b/src/runner_doiact_stars.h @@ -1013,6 +1013,9 @@ void DOSELF1_BRANCH_STARS(struct runner *r, struct cell *c) { const struct engine *restrict e = r->e; + /* Anything to do here? */ + if (c->stars.count == 0) return; + /* Anything to do here? */ if (!cell_is_active_stars(c, e)) return;