From 6bf681f3c8349e65fadee1e8ec4d65264e606908 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Thu, 17 Mar 2016 08:19:46 +0000
Subject: [PATCH] Better check for whether or not to create the HDF5 groups for
 a given particle type

---
 src/serial_io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/serial_io.c b/src/serial_io.c
index 9804a7012b..c9b08c6e65 100644
--- a/src/serial_io.c
+++ b/src/serial_io.c
@@ -742,7 +742,7 @@ void write_output_serial(struct engine* e, struct UnitSystem* us, int mpi_rank,
       for (int ptype = 0; ptype < NUM_PARTICLE_TYPES; ptype++) {
 
         /* Don't do anything if no particle of this kind */
-        if (N[ptype] == 0) continue;
+        if (N_total[ptype] == 0) continue;
 
         /* Open the particle group in the file */
         char partTypeGroupName[PARTICLE_GROUP_BUFFER_SIZE];
-- 
GitLab