From 5e33f26256dd84bf209f5e78b64e2793ba25e36f Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Mon, 23 Jul 2018 10:43:08 +0100 Subject: [PATCH] Do not construct hierarchical gravity tasks below the level where there are any tasks. --- src/engine.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/engine.c b/src/engine.c index 37124546b5..8a99358d2c 100644 --- a/src/engine.c +++ b/src/engine.c @@ -358,10 +358,8 @@ void engine_make_hierarchical_tasks_gravity(struct engine *e, struct cell *c) { } } - /* We are below the super-cell */ - else if (c->super_gravity != NULL) { - - // MATTHIEU stop the recursion below the level where there are tasks + /* We are below the super-cell but not below the maximal splitting depth */ + else if (c->super_gravity != NULL && c->depth <= space_subdepth_grav) { /* Local tasks only... */ if (c->nodeID == e->nodeID) { @@ -380,8 +378,8 @@ void engine_make_hierarchical_tasks_gravity(struct engine *e, struct cell *c) { } } - /* Recurse. */ - if (c->split) + /* Recurse but not below the maximal splitting depth */ + if (c->split && c->depth <= space_subdepth_grav) for (int k = 0; k < 8; k++) if (c->progeny[k] != NULL) engine_make_hierarchical_tasks_gravity(e, c->progeny[k]); -- GitLab