Commit dd072659 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Added a check preventing the addition of tasks with ci==NULL and cj!=NULL

parent c8be4935
......@@ -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!");
......
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