diff --git a/src/task.c b/src/task.c index 036e816715e561340d438359e78b2ff159fb781a..12c13b97008cffead2f100ad009f78bb1ea65229 100644 --- a/src/task.c +++ b/src/task.c @@ -266,6 +266,9 @@ float task_overlap(const struct task *restrict ta, if (tb->ci != NULL) size_union += tb->ci->hydro.count; if (tb->cj != NULL) size_union += tb->cj->hydro.count; + // MATTHIEU: This should not be necessary + if (size_union == 0) return 0.f; + /* Compute the intersection of the cell data. */ const size_t size_intersect = task_cell_overlap_part(ta->ci, tb->ci) + task_cell_overlap_part(ta->ci, tb->cj) +