diff --git a/src/engine.c b/src/engine.c index e90bc321e9be681c65361e74c2801ae0d0cc77a5..fadaffd32c3eaf0a4165ad47cf5e2cc99e6059db 100644 --- a/src/engine.c +++ b/src/engine.c @@ -2359,6 +2359,10 @@ void engine_collect_kick(struct cell *c) { ti_end_min = min(ti_end_min, cp->ti_end_min); updated += cp->updated; g_updated += cp->g_updated; + + /* Collected, so clear for next time. */ + cp->updated = 0; + cp->g_updated = 0; } } } @@ -2394,6 +2398,10 @@ void engine_collect_timestep(struct engine *e) { ti_end_min = min(ti_end_min, c->ti_end_min); updates += c->updated; g_updates += c->g_updated; + + /* Collected, so clear for next time. */ + c->updated = 0; + c->g_updated = 0; } /* Aggregate the data from the different nodes. */ diff --git a/src/runner.c b/src/runner.c index cfc9250314897ef2afe0470a662d936b23476108..bef07aadcbee64aa9a93dc1c62027d866c666575 100644 --- a/src/runner.c +++ b/src/runner.c @@ -756,10 +756,6 @@ static void runner_do_drift(struct cell *c, struct engine *e, int drift) { const int ti_current = e->ti_current; - /* Clear the active particle counters. */ - c->updated = 0; - c->g_updated = 0; - /* Unskip any active tasks. */ if (c->ti_end_min == e->ti_current) { const int forcerebuild = cell_unskip_tasks(c);