Commit 7dd2354a authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Better check in place to avoid invalid tasks after splittasks has been called.

parent 10e7b958
......@@ -2976,6 +2976,14 @@ void engine_maketasks(struct engine *e) {
/* Split the tasks. */
scheduler_splittasks(sched);
#ifdef SWIFT_DEBUG_CHECKS
/* Verify that we are not left with invalid tasks */
for (int i = 0; i < e->sched.nr_tasks; ++i) {
const struct task *t = &e->sched.tasks[i];
if (t->ci == NULL && t->cj != NULL && !t->skip) error("Invalid task");
}
#endif
/* Free the old list of cell-task links. */
if (e->links != NULL) free(e->links);
e->size_links = 0;
......
......@@ -935,12 +935,6 @@ struct task *scheduler_addtask(struct scheduler *s, enum task_types type,
enum task_subtypes subtype, int flags,
int implicit, struct cell *ci, struct cell *cj) {
#ifdef SWIFT_DEBUG_CHECKS
if (ci == NULL && cj != NULL)
error("Added a task with ci==NULL and cj!=NULL type=%s/%s",
taskID_names[type], subtaskID_names[subtype]);
#endif
/* Get the next free task. */
const int ind = atomic_inc(&s->tasks_next);
......
Markdown is supported
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