From fbfd36b125b61aef7d7bb198702925b4b5bcbe9a Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Thu, 27 Jun 2019 09:55:58 +0100
Subject: [PATCH] Fixed typo in the star task splitting logic.

---
 src/scheduler.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/scheduler.c b/src/scheduler.c
index b5ceb1d00c..5df4f71f04 100644
--- a/src/scheduler.c
+++ b/src/scheduler.c
@@ -672,25 +672,25 @@ static void scheduler_splittask_hydro(struct task *t, struct scheduler *s) {
         const int s_count_i = ci->stars.count;
         const int s_count_j = cj->stars.count;
 
-        int do_split_hydro = 0;
-        int do_split_stars_i = 0;
-        int do_split_stars_j = 0;
+        int do_sub_hydro = 1;
+        int do_sub_stars_i = 1;
+        int do_sub_stars_j = 1;
         if (h_count_i > 0 && h_count_j > 0) {
-          do_split_hydro =
+          do_sub_hydro =
               h_count_j * sid_scale[sid] < space_subsize_pair_hydro / h_count_j;
         }
         if (s_count_i > 0 && h_count_j > 0) {
-          do_split_stars_i =
+          do_sub_stars_i =
               s_count_i * sid_scale[sid] < space_subsize_pair_stars / h_count_j;
         }
         if (s_count_j > 0 && h_count_i > 0) {
-          do_split_stars_j =
+          do_sub_stars_j =
               s_count_j * sid_scale[sid] < space_subsize_pair_stars / h_count_i;
         }
 
         /* Replace by a single sub-task? */
         if (scheduler_dosub && /* Use division to avoid integer overflow. */
-            do_split_hydro && do_split_stars_i && do_split_stars_j &&
+            do_sub_hydro && do_sub_stars_i && do_sub_stars_j &&
             !sort_is_corner(sid)) {
           /* Make this task a sub task. */
           t->type = task_type_sub_pair;
-- 
GitLab