From f5a50abe0087f27d8d3002cb376cf6ec9cd2922a Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Sun, 12 Aug 2018 22:45:10 +0100
Subject: [PATCH] Do not activate communication tasks when unlocking an M-M
 one.

---
 src/cell.c   |  2 ++
 src/engine.c | 22 ----------------------
 2 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/src/cell.c b/src/cell.c
index e8038db1da..eba2ee675b 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -2348,6 +2348,8 @@ int cell_unskip_gravity_tasks(struct cell *c, struct scheduler *s) {
     /* Only activate tasks that involve a local active cell. */
     if ((ci_active && ci_nodeID == nodeID) ||
         (cj_active && cj_nodeID == nodeID)) {
+
+      scheduler_activate(s, t);
       cell_activate_grav_mm_task(ci, cj, s);
     }
   }
diff --git a/src/engine.c b/src/engine.c
index 04694b2c9c..6a840379fc 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -3741,28 +3741,6 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
       if ((ci_active_gravity && ci_nodeID == engine_rank) ||
           (cj_active_gravity && cj_nodeID == engine_rank))
         scheduler_activate(s, t);
-
-#ifdef WITH_MPI
-      /* Activate the send/recv tasks. */
-      if (ci->nodeID != engine_rank) {
-
-        /* If the foreign cell is active, we want its ti_end values. */
-        if (ci_active_gravity) scheduler_activate(s, ci->recv_ti);
-
-        /* If the local cell is active, send its ti_end values. */
-        if (cj_active_gravity)
-          scheduler_activate_send(s, cj->send_ti, ci->nodeID);
-
-      } else if (cj->nodeID != engine_rank) {
-
-        /* If the foreign cell is active, we want its ti_end values. */
-        if (cj_active_gravity) scheduler_activate(s, cj->recv_ti);
-
-        /* If the local cell is active, send its ti_end values. */
-        if (ci_active_gravity)
-          scheduler_activate_send(s, ci->send_ti, cj->nodeID);
-      }
-#endif
     }
 
     /* Time-step? */
-- 
GitLab