From 733f2de2bbdfd9f74bba89b5f8c242f1bb06ca1c Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Tue, 24 Jul 2018 13:00:04 +0100
Subject: [PATCH] Do not recurse below the level where there are tasks when
 unskiping

---
 examples/main.c | 4 +++-
 src/runner.c    | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/examples/main.c b/examples/main.c
index d1a82bbdc3..234bd72547 100644
--- a/examples/main.c
+++ b/examples/main.c
@@ -915,11 +915,13 @@ int main(int argc, char *argv[]) {
   }
 
   /* Legend */
-  if (myrank == 0)
+  if (myrank == 0) {
     printf("# %6s %14s %14s %10s %14s %9s %12s %12s %12s %16s [%s] %6s\n",
            "Step", "Time", "Scale-factor", "Redshift", "Time-step", "Time-bins",
            "Updates", "g-Updates", "s-Updates", "Wall-clock time",
            clocks_getunit(), "Props");
+    fflush(stdout);
+  }
 
   /* File for the timers */
   if (with_verbose_timers) timers_open_file(myrank);
diff --git a/src/runner.c b/src/runner.c
index 37c6030889..fe8e7483e2 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -968,7 +968,7 @@ static void runner_do_unskip_gravity(struct cell *c, struct engine *e) {
   if (!cell_is_active_gravity(c, e)) return;
 
   /* Recurse */
-  if (c->split) {
+  if (c->split && c->depth < space_subdepth_grav) {
     for (int k = 0; k < 8; k++) {
       if (c->progeny[k] != NULL) {
         struct cell *cp = c->progeny[k];
-- 
GitLab