diff --git a/src/parallel_io.c b/src/parallel_io.c index 8d5a97a2ad92a9bfa7e3378534aa2df7b168fb47..6cd15be2948a0e46e5a1f8d79bdba8a443a5c454 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);