Commit 2fa19375 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

In the task_overlap function, escape early if the union is 0

parent cd058167
...@@ -35,7 +35,7 @@ Statistics: ...@@ -35,7 +35,7 @@ Statistics:
# Parameters related to the initial conditions # Parameters related to the initial conditions
InitialConditions: InitialConditions:
file_name: fid.hdf5 # The file to read file_name: lowres8.hdf5 # The file to read
periodic: 0 # Are we running with periodic ICs? periodic: 0 # Are we running with periodic ICs?
stars_smoothing_length: 0.5 stars_smoothing_length: 0.5
......
...@@ -283,7 +283,6 @@ float task_overlap(const struct task *restrict ta, ...@@ -283,7 +283,6 @@ float task_overlap(const struct task *restrict ta,
if (tb->ci != NULL) size_union += tb->ci->hydro.count; if (tb->ci != NULL) size_union += tb->ci->hydro.count;
if (tb->cj != NULL) size_union += tb->cj->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; if (size_union == 0) return 0.f;
/* Compute the intersection of the cell data. */ /* Compute the intersection of the cell data. */
...@@ -305,6 +304,8 @@ float task_overlap(const struct task *restrict ta, ...@@ -305,6 +304,8 @@ float task_overlap(const struct task *restrict ta,
if (tb->ci != NULL) size_union += tb->ci->grav.count; if (tb->ci != NULL) size_union += tb->ci->grav.count;
if (tb->cj != NULL) size_union += tb->cj->grav.count; if (tb->cj != NULL) size_union += tb->cj->grav.count;
if (size_union == 0) return 0.f;
/* Compute the intersection of the cell data. */ /* Compute the intersection of the cell data. */
const size_t size_intersect = task_cell_overlap_gpart(ta->ci, tb->ci) + const size_t size_intersect = task_cell_overlap_gpart(ta->ci, tb->ci) +
task_cell_overlap_gpart(ta->ci, tb->cj) + task_cell_overlap_gpart(ta->ci, tb->cj) +
......
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