From 4c03a2e0ff8b1c3581773db0e1fc29138bfac7d4 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Fri, 3 May 2019 17:06:13 +0200
Subject: [PATCH] Fix a bracketing error in the MPI task making code.

---
 src/engine_maketasks.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/engine_maketasks.c b/src/engine_maketasks.c
index 8c928a763a..49dec37a42 100644
--- a/src/engine_maketasks.c
+++ b/src/engine_maketasks.c
@@ -282,16 +282,18 @@ void engine_addtasks_send_stars(struct engine *e, struct cell *ci,
       /* Drift before you send */
       scheduler_addunlock(s, ci->hydro.super->stars.drift, t_feedback);
 
+      scheduler_addunlock(s, ci->super->timestep, t_ti);
+
       /* Update the stars counts before you send them */
       if (with_star_formation && ci->hydro.count > 0) {
         scheduler_addunlock(s, ci->top->hydro.star_formation, t_sf_counts);
       }
+    }
 
-      engine_addlink(e, &ci->mpi.send, t_feedback);
-      engine_addlink(e, &ci->mpi.send, t_ti);
-      if (with_star_formation) {
-        engine_addlink(e, &ci->mpi.send, t_sf_counts);
-      }
+    engine_addlink(e, &ci->mpi.send, t_feedback);
+    engine_addlink(e, &ci->mpi.send, t_ti);
+    if (with_star_formation) {
+      engine_addlink(e, &ci->mpi.send, t_sf_counts);
     }
   }
 
-- 
GitLab