diff --git a/src/engine.c b/src/engine.c index 1ff7a7d46b7d3abe482a90875c0b8d7219ee506b..f437af521972e01126064052b28e66375a453140 100644 --- a/src/engine.c +++ b/src/engine.c @@ -2261,10 +2261,7 @@ void engine_prepare(struct engine *e, int nodrift) { TIMER_TIC; - /* Unskip active tasks and check for rebuild */ - engine_unskip(e); - - /* Run through the tasks and mark as skip or not. */ + /* Check for rebuild */ int rebuild = e->forcerebuild; /* Collect the values of rebuild from all nodes. */ @@ -2290,6 +2287,9 @@ void engine_prepare(struct engine *e, int nodrift) { engine_rebuild(e); } + /* Run through the tasks and mark as skip or not (after rebuild). */ + engine_unskip(e); + /* Re-rank the tasks every now and then. */ if (e->tasks_age % engine_tasksreweight == 1) { scheduler_reweight(&e->sched, e->verbose);