diff --git a/src/debug.c b/src/debug.c
index 368c5cbb08003b2f1a45d276c3942bbd35a02012..4e99108f509fa4c327e0d2a801920cd8fb374bc2 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -280,6 +280,7 @@ static void dumpCells_map(struct cell *c, void *data) {
   FILE *file = (FILE *)ldata[0];
   struct engine *e = (struct engine *)ldata[1];
   float ntasks = c->nr_tasks;
+  int pactive = (int)ldata[2];
 
 #if SWIFT_DEBUG_CHECKS
   /* The c->nr_tasks field does not include all the tasks. So let's check this
@@ -301,47 +302,75 @@ static void dumpCells_map(struct cell *c, void *data) {
 #endif
 
   /* Only locally active cells are dumped. */
-  if (c->count > 0 || c->gcount > 0 || c->scount > 0)
-    fprintf(file,
-            "  %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6d %6d %6d %6d "
-            "%6.1f %20lld %6d %6d %6d %6d %6d\n",
-            c->loc[0], c->loc[1], c->loc[2], c->width[0], c->width[1],
-            c->width[2], c->count, c->gcount, c->scount, c->depth, ntasks,
-            c->ti_end_min, get_time_bin(c->ti_end_min), (c->super == c),
-            cell_is_active(c, e), c->nodeID, c->nodeID == e->nodeID);
+  if (c->count > 0 || c->gcount > 0 || c->scount > 0) {
+
+    /* If requested we work out how many particles are active in this cell. */
+    int pactcount = 0;
+    if (pactive) {
+      const struct part *parts = c->parts;
+      for (int k = 0; k < c->count; k++)
+        if (part_is_active(&parts[k], e)) pactcount++;
+      struct gpart *gparts = c->gparts;
+      for (int k = 0; k < c->gcount; k++)
+        if (gpart_is_active(&gparts[k], e)) pactcount++;
+      struct spart *sparts = c->sparts;
+      for (int k = 0; k < c->scount; k++)
+        if (spart_is_active(&sparts[k], e)) pactcount++;
+    }
+#if WITH_MPI
+    int sendto = (c->send_xv != NULL);
+#else
+    int sendto = 0;
+#endif
+
+    /* Local cells that are active and are super cells and have MPI tasks. */
+    if (c->nodeID == e->nodeID && cell_is_active(c, e) && (c->super == c) && sendto)
+      fprintf(file,
+              "  %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6d %6d %6d %6d %6d %6d "
+              "%6.1f %20lld %6d %6d %6d %6d %6d\n",
+              c->loc[0], c->loc[1], c->loc[2], c->width[0], c->width[1],
+              c->width[2], e->step, c->count, c->gcount, c->scount, pactcount,
+              c->depth, ntasks, c->ti_end_min, get_time_bin(c->ti_end_min),
+              (c->super == c), cell_is_active(c, e), c->nodeID,
+              c->nodeID == e->nodeID);
+
+  }
 }
 
 /**
  * @brief Dump the location, depth, task counts and timebins and active state,
- * for all cells to a simple text file.
+ * for all cells to a simple text file. A more costly count of the active
+ * particles in a cell can also be output.
  *
  * @param prefix base output filename, result is written to
  *               %prefix%_%rank%_%step%.dat
+ * @param pactive also output a count of active particles.
  * @param s the space holding the cells to dump.
  * @param rank node ID of MPI rank, or 0 if not relevant.
  * @param step the current engine step, or some unique integer.
  */
-void dumpCells(const char *prefix, struct space *s, int rank, int step) {
+void dumpCells(const char *prefix, int pactive, struct space *s, int rank,
+               int step) {
 
   FILE *file = NULL;
 
   /* Name of output file. */
-  static int nseq = 0;
   char fname[200];
-  int uniq = atomic_inc(&nseq);
-  sprintf(fname, "%s_%03d.dat", prefix, uniq);
+  sprintf(fname, "%s_%03d.dat", prefix, step);
   file = fopen(fname, "w");
 
   /* Header. */
   fprintf(file,
-          "# %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s "
-          "%20s %6s %6s %6s %6s\n",
-          "x", "y", "z", "xw", "yw", "zw", "count", "gcount", "scount", "depth",
-          "tasks", "ti_end_min", "timebin", "issuper", "active", "rank", "local");
+          "# %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s "
+          "%20s %6s %6s %6s %6s %6s\n",
+          "x", "y", "z", "xw", "yw", "zw", "step", "count", "gcount", "scount",
+          "actcount", "depth", "tasks", "ti_end_min", "timebin",
+          "issuper", "active", "rank", "local");
 
-  uintptr_t data[2];
+  uintptr_t data[3];
   data[0] = (size_t)file;
   data[1] = (size_t)s->e;
+  data[2] = (size_t)pactive;
   space_map_cells_pre(s, 1, dumpCells_map, &data);
   fclose(file);
 }
diff --git a/src/debug.h b/src/debug.h
index d53fc1b6ea30589aec53bd3ffe0810ac6d9b9bd6..5e5fb4819e990349b57db7fa6c0bfe9dacba9d21 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -36,7 +36,8 @@ void printgParticle_single(struct gpart *gp);
 
 int checkSpacehmax(struct space *s);
 int checkCellhdxmax(const struct cell *c, int *depth);
-void dumpCells(const char *prefix, struct space *s, int rank, int step);
+void dumpCells(const char *prefix, int pactive, struct space *s, int rank,
+               int step);
 
 #ifdef HAVE_METIS
 #include "metis.h"