From 0d4b3d10c10484cd77ad6bc33c50ce13b2c9b600 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Tue, 2 Apr 2019 10:56:51 +0100
Subject: [PATCH] Reset the debugging cell counter when rebuilding.

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

diff --git a/src/space.c b/src/space.c
index 3e51e9f111..d5ad72dc3a 100644
--- a/src/space.c
+++ b/src/space.c
@@ -1037,6 +1037,9 @@ void space_rebuild(struct space *s, int repartitioned, int verbose) {
 #ifdef SWIFT_DEBUG_CHECKS
   if (s->e->nodeID == 0 || verbose) message("(re)building space");
   fflush(stdout);
+
+  /* Reset the cell counter */
+  last_cell_id = 1;
 #endif
 
   /* Re-grid if necessary, or just re-set the cell data. */
-- 
GitLab