From dd072659a9e6a0ae1baaf95b45909e81d2cecfa4 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Tue, 24 Jan 2017 21:58:14 +0000 Subject: [PATCH] Added a check preventing the addition of tasks with ci==NULL and cj!=NULL --- src/scheduler.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/scheduler.c b/src/scheduler.c index f9e0533b25..6d721f96d8 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -693,6 +693,12 @@ struct task *scheduler_addtask(struct scheduler *s, enum task_types type, enum task_subtypes subtype, int flags, int wait, struct cell *ci, struct cell *cj, int tight) { +#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); @@ -1080,7 +1086,7 @@ void scheduler_start(struct scheduler *s) { /* Don't check MPI stuff */ if (t->type == task_type_send || t->type == task_type_recv) continue; - if (ci == NULL && cj == NULL) { + if (ci == NULL && cj == NULL) { if (t->type != task_type_grav_gather_m && t->type != task_type_grav_fft) error("Task not associated with cells!"); -- GitLab