Commit bb68a8b3 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

don't clear the active list in marktasks, as it may be called more than once.

parent 036cf356
......@@ -1381,7 +1381,6 @@ void engine_count_and_link_tasks(struct engine *e) {
if (t->type == task_type_sort && t->ci->split)
for (int j = 0; j < 8; j++)
if (t->ci->progeny[j] != NULL && t->ci->progeny[j]->sorts != NULL) {
t->ci->progeny[j]->sorts->skip = 0;
scheduler_addunlock(sched, t->ci->progeny[j]->sorts, t);
}
......@@ -2151,13 +2150,13 @@ int engine_marktasks(struct engine *e) {
/* Multiple-timestep case */
} else {
/* Run through the tasks and mark as skip or not. */
size_t extra_data[3] = {e->ti_current, rebuild_space, (size_t)&e->sched};
scheduler_clear_active(&e->sched);
threadpool_map(&e->threadpool, engine_marktasks_mapper, s->tasks,
s->nr_tasks, sizeof(struct task), 10000, extra_data);
rebuild_space = extra_data[1];
message("scheduler active tasks: %i", e->sched.active_count);
}
if (e->verbose)
......
......@@ -1119,6 +1119,9 @@ void scheduler_start(struct scheduler *s, unsigned int mask,
pthread_cond_signal(&s->sleep_cond);
}
}
/* Clear the list of active tasks. */
s->active_count = 0;
/* To be safe, fire of one last sleep_cond in a safe way. */
pthread_mutex_lock(&s->sleep_mutex);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment