From bc56ac5a2e42998aef39a672364c5462013f6101 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Sun, 17 Feb 2019 23:22:11 +0100
Subject: [PATCH] Link the star communication tasks to the correct super cell.

---
 src/engine_maketasks.c | 7 +++----
 src/task.c             | 7 +++----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/engine_maketasks.c b/src/engine_maketasks.c
index 1f1591e892..f6b1781388 100644
--- a/src/engine_maketasks.c
+++ b/src/engine_maketasks.c
@@ -270,11 +270,10 @@ void engine_addtasks_send_stars(struct engine *e, struct cell *ci,
                                  ci->mpi.tag, 0, ci, cj);
 
       /* The send_stars task should unlock the super_cell's kick task. */
-      // scheduler_addunlock(s, t_feed, ci->super->end_force);
-      error("need implementing");
+      scheduler_addunlock(s, t_feed, ci->hydro.super->stars.stars_out);
 
       /* Ghost before you send */
-      // scheduler_addunlock(s, ci->hydro.super->stars.ghost_out, t_feed);
+      scheduler_addunlock(s, ci->hydro.super->stars.ghost, t_feed);
     }
 
     if (hydro == NULL) {
@@ -2755,7 +2754,7 @@ void engine_maketasks(struct engine *e) {
 
   /* Free the old list of cell-task links. */
   if (e->links != NULL) free(e->links);
-  e->size_links = e->sched.nr_tasks * e->links_per_tasks;
+  e->size_links = e->sched.nr_tasks * e->links_per_tasks * 2;
 
   /* Make sure that we have space for more links than last time. */
   if (e->size_links < e->nr_links * engine_rebuild_link_alloc_margin)
diff --git a/src/task.c b/src/task.c
index c64288e59f..40887aa593 100644
--- a/src/task.c
+++ b/src/task.c
@@ -681,10 +681,9 @@ void task_get_group_name(int type, int subtype, char *cluster) {
       break;
     case task_subtype_gradient:
       if (type == task_type_send || type == task_type_recv) {
-	strcpy(cluster, "None");
-      }
-      else {
-	strcpy(cluster, "Gradient");
+        strcpy(cluster, "None");
+      } else {
+        strcpy(cluster, "Gradient");
       }
       break;
     case task_subtype_force:
-- 
GitLab