From fd721632b640705f0e2de0456023c524cae6680e Mon Sep 17 00:00:00 2001
From: Pedro Gonnet <gonnet@google.com>
Date: Wed, 4 Jul 2018 23:15:54 +0200
Subject: [PATCH] initialize the cell tags to -1.

---
 src/space.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/space.c b/src/space.c
index e80cc37190..3f80edfb4a 100644
--- a/src/space.c
+++ b/src/space.c
@@ -205,6 +205,8 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements,
         c->sort[i] = NULL;
       }
 #if WITH_MPI
+    c->tag = -1;
+
     c->recv_xv = NULL;
     c->recv_rho = NULL;
     c->recv_gradient = NULL;
@@ -418,6 +420,9 @@ void space_regrid(struct space *s, int verbose) {
           c->ti_old_part = ti_old;
           c->ti_old_gpart = ti_old;
           c->ti_old_multipole = ti_old;
+#ifdef WITH_MPI
+          c->tag = -1;
+#endif  // WITH_MPI
           if (s->gravity) c->multipole = &s->multipoles_top[cid];
         }
 
@@ -1825,6 +1830,9 @@ void space_split_recursive(struct space *s, struct cell *c,
       cp->super = NULL;
       cp->super_hydro = NULL;
       cp->super_gravity = NULL;
+#ifdef WITH_MPI
+      cp->tag = -1;
+#endif  // WITH_MPI
 #ifdef SWIFT_DEBUG_CHECKS
       cp->cellID = last_cell_id++;
 #endif
-- 
GitLab