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

Do not count the particles in the leaves when looking for the number of...

Do not count the particles in the leaves when looking for the number of foreign particles to allocate.
parent 71c42df2
......@@ -224,9 +224,10 @@ int cell_link_foreign_parts(struct cell *c, struct part *parts) {
count += cell_link_foreign_parts(c->progeny[k], &parts[count]);
}
}
return count;
} else {
return 0;
}
return c->hydro.count;
}
/**
......@@ -249,7 +250,7 @@ int cell_link_foreign_gparts(struct cell *c, struct gpart *gparts) {
/* Do we have a hydro task at this level? */
if (c->grav.grav != NULL) {
/* Recursively attach the parts */
/* Recursively attach the gparts */
const int counts = cell_link_gparts(c, gparts);
#ifdef SWIFT_DEBUG_CHECKS
if (counts != c->grav.count)
......@@ -266,9 +267,10 @@ int cell_link_foreign_gparts(struct cell *c, struct gpart *gparts) {
count += cell_link_foreign_gparts(c->progeny[k], &gparts[count]);
}
}
return count;
} else {
return 0;
}
return c->grav.count;
}
/**
......@@ -298,9 +300,10 @@ int cell_count_parts_for_tasks(const struct cell *c) {
count += cell_count_parts_for_tasks(c->progeny[k]);
}
}
return count;
} else {
return 0;
}
return c->hydro.count;
}
/**
......@@ -330,9 +333,10 @@ int cell_count_gparts_for_tasks(const struct cell *c) {
count += cell_count_gparts_for_tasks(c->progeny[k]);
}
}
return count;
} else {
return 0;
}
return c->grav.count;
}
/**
......
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