diff --git a/src/cell.c b/src/cell.c index fcbbfe4ae1107e5297f719bd43ad98be2dbc78bc..23e5e5781bdc07448684a037a4389630b84aad59 100644 --- a/src/cell.c +++ b/src/cell.c @@ -880,10 +880,14 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) { /* Activate the drift on both sides */ if (t->type == task_type_pair || t->type == task_type_sub_pair) { - scheduler_activate(s, ci->drift); - scheduler_activate(s, cj->drift); + if (ci->drift != NULL) scheduler_activate(s, ci->drift); + if (cj->drift != NULL) scheduler_activate(s, cj->drift); } + if (t->type == task_type_self || t->type == task_type_sub_self) { + if (ci->drift != NULL) scheduler_activate(s, ci->drift); + } + /* Check whether there was too much particle motion */ if (t->type == task_type_pair || t->type == task_type_sub_pair) { if (t->tight && @@ -962,7 +966,6 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) { if (c->ghost != NULL) scheduler_activate(s, c->ghost); if (c->init != NULL) scheduler_activate(s, c->init); if (c->kick != NULL) scheduler_activate(s, c->kick); - if (c->drift != NULL) scheduler_activate(s, c->drift); if (c->cooling != NULL) scheduler_activate(s, c->cooling); if (c->sourceterms != NULL) scheduler_activate(s, c->sourceterms); diff --git a/src/engine.c b/src/engine.c index 111f0a230ae553aa87585042d69f7ac3b11da6a6..879fbc28bf7827501acf2116ff814fca6c3bb202 100644 --- a/src/engine.c +++ b/src/engine.c @@ -1986,6 +1986,16 @@ void engine_marktasks_mapper(void *map_data, int num_elements, if (t->ci->ti_end_min <= ti_end) scheduler_activate(s, t); } + /* Self? */ + else if (t->type == task_type_self || t->type == task_type_sub_self) { + + /* Local pointers. */ + const struct cell *ci = t->ci; + + /* Activate the drift */ + if(ci->drift) scheduler_activate(s, ci->drift); + } + /* Pair? */ else if (t->type == task_type_pair || t->type == task_type_sub_pair) { @@ -1995,7 +2005,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements, /* Activate the drift on both sides */ if(ci->drift) scheduler_activate(s, ci->drift); - if(ci->drift) scheduler_activate(s, cj->drift); + if(cj->drift) scheduler_activate(s, cj->drift); /* Too much particle movement? */ if (t->tight &&