From 39f3d2140e480050e0547a88238f17e6bb592eda Mon Sep 17 00:00:00 2001
From: Jacob Kegerreis <jacob.kegerreis@durham.ac.uk>
Date: Fri, 11 May 2018 14:15:02 +0100
Subject: [PATCH] Add label_delta to parallel IO too

---
 src/parallel_io.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/parallel_io.c b/src/parallel_io.c
index 8d5a97a2ad..6cd15be294 100644
--- a/src/parallel_io.c
+++ b/src/parallel_io.c
@@ -850,8 +850,12 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6],
 
   /* HDF5 File name */
   char fileName[FILENAME_BUFFER_SIZE];
-  snprintf(fileName, FILENAME_BUFFER_SIZE, "%s_%04i.hdf5", baseName,
-           e->snapshot_output_count);
+  if (e->snapshot_label_delta == 1)
+    snprintf(fileName, FILENAME_BUFFER_SIZE, "%s_%04i.hdf5", baseName,
+             e->snapshot_output_count);
+  else
+    snprintf(fileName, FILENAME_BUFFER_SIZE, "%s_%06i.hdf5", baseName,
+             e->snapshot_output_count * e->snapshot_label_delta);
 
   /* Open HDF5 file with the chosen parameters */
   hid_t h_file = H5Fcreate(fileName, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
-- 
GitLab