From 2bf96d6e3b9da61dfd4651c5346840a9ee18e77c Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Sat, 6 Apr 2019 14:02:29 +0100
Subject: [PATCH] Only link the SF and feedback tasks if there is any gas in
 the cell.

---
 src/engine_maketasks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/engine_maketasks.c b/src/engine_maketasks.c
index b01eeb0d1d..aaf8bc677b 100644
--- a/src/engine_maketasks.c
+++ b/src/engine_maketasks.c
@@ -788,7 +788,7 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c) {
         scheduler_addunlock(s, c->super->kick2, c->stars.stars_in);
         scheduler_addunlock(s, c->stars.stars_out, c->super->timestep);
 
-        if (with_star_formation) {
+        if (with_star_formation && c->hydro.count > 0) {
           scheduler_addunlock(s, c->top->hydro.star_formation,
                               c->stars.stars_in);
         }
-- 
GitLab