From 38ec5e44601c62cee38eb1507400b982b56e62d2 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Sun, 17 Feb 2019 23:09:22 +0100
Subject: [PATCH] Correct linking of the gradient communication task.

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

diff --git a/src/engine_maketasks.c b/src/engine_maketasks.c
index 60f5adc3e0..1f1591e892 100644
--- a/src/engine_maketasks.c
+++ b/src/engine_maketasks.c
@@ -153,7 +153,7 @@ void engine_addtasks_send_hydro(struct engine *e, struct cell *ci,
 
 #ifdef EXTRA_HYDRO_LOOP
 
-      scheduler_addunlock(s, t_gradient, ci->super->kick2);
+      scheduler_addunlock(s, t_gradient, ci->hydro.super->hydro.end_force);
 
       scheduler_addunlock(s, ci->hydro.super->hydro.extra_ghost, t_gradient);
 
@@ -169,7 +169,7 @@ void engine_addtasks_send_hydro(struct engine *e, struct cell *ci,
 
 #else
       /* The send_rho task should unlock the super_hydro-cell's kick task. */
-      scheduler_addunlock(s, t_rho, ci->super->end_force);
+      scheduler_addunlock(s, t_rho, ci->hydro.super->hydro.end_force);
 
       /* The send_rho task depends on the cell's ghost task. */
       scheduler_addunlock(s, ci->hydro.super->hydro.ghost_out, t_rho);
diff --git a/src/task.c b/src/task.c
index 2034aef53f..c64288e59f 100644
--- a/src/task.c
+++ b/src/task.c
@@ -680,7 +680,12 @@ void task_get_group_name(int type, int subtype, char *cluster) {
       strcpy(cluster, "Density");
       break;
     case task_subtype_gradient:
-      strcpy(cluster, "Gradient");
+      if (type == task_type_send || type == task_type_recv) {
+	strcpy(cluster, "None");
+      }
+      else {
+	strcpy(cluster, "Gradient");
+      }
       break;
     case task_subtype_force:
       strcpy(cluster, "Force");
-- 
GitLab