Skip to content
Snippets Groups Projects
Commit c0a5abd4 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

use the new variables when splitting tasks.

parent cd5f3868
No related branches found
No related tags found
1 merge request!365Subsize
......@@ -151,8 +151,7 @@ static void scheduler_splittask_hydro(struct task *t, struct scheduler *s) {
if (cell_can_split_self_task(ci)) {
/* Make a sub? */
if (scheduler_dosub && /* Note division here to avoid overflow */
(ci->count > 0 && ci->count < space_subsize / ci->count)) {
if (scheduler_dosub && ci->count < space_subsize_self) {
/* convert to a self-subtask. */
t->type = task_type_sub_self;
......@@ -211,8 +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 &&
ci->count * sid_scale[sid] < space_subsize / cj->count &&
if (scheduler_dosub && /* Use division to avoid integer overflow. */
ci->count * sid_scale[sid] < space_subsize_pair / cj->count &&
!sort_is_corner(sid)) {
/* Make this task a sub task. */
......@@ -624,8 +623,7 @@ static void scheduler_splittask_gravity(struct task *t, struct scheduler *s) {
if (ci->split) {
/* Make a sub? */
if (scheduler_dosub && /* Note division here to avoid overflow */
(ci->gcount > 0 && ci->gcount < space_subsize / ci->gcount)) {
if (scheduler_dosub && ci->gcount < space_subsize_self) {
/* convert to a self-subtask. */
t->type = task_type_sub_self;
......
  • Owner

    Can I suggest to check the functions cell_can_split_self_task and cell_can_recurse_in_self_task in cell.h ? I am not sure I did not make them too restrictive.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment