diff --git a/src/cell_unskip.c b/src/cell_unskip.c index fc6fe1889220f9887492d14d88b478ad58e6d090..c4a52110a0caf6927e86f2efe771879462ca124b 100644 --- a/src/cell_unskip.c +++ b/src/cell_unskip.c @@ -1625,10 +1625,11 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) { const int with_feedback = e->policy & engine_policy_feedback; const int with_timestep_limiter = (e->policy & engine_policy_timestep_limiter); + const int with_sinks = e->policy & engine_policy_sinks; #ifdef WITH_MPI const int with_star_formation = e->policy & engine_policy_star_formation; - if (e->policy & engine_policy_sinks) error("TODO"); + if (with_sinks) error("Cannot use sink tasks and MPI"); #endif int rebuild = 0; @@ -1929,7 +1930,7 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) { cell_activate_star_formation_tasks(c->top, s, with_feedback); cell_activate_super_spart_drifts(c->top, s); } - if (c->top->sinks.star_formation_sink != NULL) { + if (with_sinks && c->top->sinks.star_formation_sink != NULL) { cell_activate_star_formation_sink_tasks(c->top, s, with_feedback); } } diff --git a/src/scheduler.c b/src/scheduler.c index 352f4704847c61ebc53a3f260a2a0a8aaf2cea5d..c210b9f20705b94acd1d8d130ea166c48aa74787 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -2504,8 +2504,9 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) { case task_type_sub_pair: qid = t->ci->super->owner; owner = &t->ci->super->owner; - if (qid < 0 || - s->queues[qid].count > s->queues[t->cj->super->owner].count) { + if ((qid < 0) || + ((t->cj->super->owner > -1) && + (s->queues[qid].count > s->queues[t->cj->super->owner].count))) { qid = t->cj->super->owner; owner = &t->cj->super->owner; }