Commit 2de5c83f authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

avoid divide-by-zero if the cell has no hydro parts as it may have gravity parts.

parent a0106530
......@@ -210,7 +210,8 @@ static void scheduler_splittask_hydro(struct task *t, struct scheduler *s) {
if (cell_can_split_pair_task(ci) && cell_can_split_pair_task(cj)) {
/* Replace by a single sub-task? */
if (scheduler_dosub && /* Use division to avoid integer overflow. */
if (scheduler_dosub && ci->count &&
cj->count && /* Use division to avoid integer overflow. */
ci->count * sid_scale[sid] < space_subsize_pair / cj->count &&
!sort_is_corner(sid)) {
......@@ -560,6 +561,7 @@ static void scheduler_splittask_hydro(struct task *t, struct scheduler *s) {
/* Otherwise, break it up if it is too large? */
} else if (scheduler_doforcesplit && ci->split && cj->split &&
ci->count && cj->count &&
(ci->count > space_maxsize / cj->count)) {
// message( "force splitting pair with %i and %i parts." , ci->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