From 6ee3f611fbb46fad64e46b26d57d552252202fc3 Mon Sep 17 00:00:00 2001
From: "Peter W. Draper" <p.w.draper@durham.ac.uk>
Date: Wed, 31 Aug 2016 13:34:32 +0100
Subject: [PATCH] Fix couple of missing cells_top changes

---
 src/partition.c | 4 ++--
 src/space.c     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/partition.c b/src/partition.c
index 3fe704c37b..8d17bedf0a 100644
--- a/src/partition.c
+++ b/src/partition.c
@@ -274,7 +274,7 @@ static void accumulate_counts(struct space *s, int *counts) {
  */
 static void split_metis(struct space *s, int nregions, int *celllist) {
 
-  for (int i = 0; i < s->nr_cells; i++) s->cells[i].nodeID = celllist[i];
+  for (int i = 0; i < s->nr_cells; i++) s->cells_top[i].nodeID = celllist[i];
 }
 #endif
 
@@ -419,7 +419,7 @@ static void repart_edge_metis(int partweights, int bothweights, int nodeID,
   /* Create weight arrays using task ticks for vertices and edges (edges
    * assume the same graph structure as used in the part_ calls). */
   int nr_cells = s->nr_cells;
-  struct cell *cells = s->cells;
+  struct cell *cells = s->cells_top;
   float wscale = 1e-3, vscale = 1e-3, wscale_buff = 0.0;
   int wtot = 0;
   int wmax = 1e9 / nr_nodes;
diff --git a/src/space.c b/src/space.c
index 4f034f4c54..b308420f4b 100644
--- a/src/space.c
+++ b/src/space.c
@@ -390,7 +390,7 @@ void space_regrid(struct space *s, double cell_max, int verbose) {
       s->cells_top[k].ghost = NULL;
       s->cells_top[k].kick = NULL;
       s->cells_top[k].super = &s->cells_top[k];
-      s->cells_top[k].gsuper = &s->cells[k];
+      s->cells_top[k].gsuper = &s->cells_top[k];
     }
     s->maxdepth = 0;
   }
-- 
GitLab