diff --git a/src/engine.c b/src/engine.c index d88b0f9f2335916c3b42665ae82ac03d694aea81..c4c266dea43eaba9f7480f5ef46f3e6fec0fcfd6 100644 --- a/src/engine.c +++ b/src/engine.c @@ -5266,17 +5266,17 @@ void engine_dump_snapshot(struct engine *e) { #if defined(HAVE_HDF5) #if defined(WITH_MPI) #if defined(HAVE_PARALLEL_HDF5) - write_output_parallel(e, e->snapshotBaseName, e->internal_units, - e->snapshotUnits, e->nodeID, e->nr_nodes, + write_output_parallel(e, e->snapshot_base_name, e->internal_units, + e->snapshot_units, e->nodeID, e->nr_nodes, MPI_COMM_WORLD, MPI_INFO_NULL); #else - write_output_serial(e, e->snapshotBaseName, e->internal_units, - e->snapshotUnits, e->nodeID, e->nr_nodes, MPI_COMM_WORLD, + write_output_serial(e, e->snapshot_base_name, e->internal_units, + e->snapshot_units, e->nodeID, e->nr_nodes, MPI_COMM_WORLD, MPI_INFO_NULL); #endif #else - write_output_single(e, e->snapshotBaseName, e->internal_units, - e->snapshotUnits); + write_output_single(e, e->snapshot_base_name, e->internal_units, + e->snapshot_units); #endif #endif @@ -5413,12 +5413,12 @@ void engine_init(struct engine *e, struct space *s, e->delta_time_snapshot = parser_get_param_double(params, "Snapshots:delta_time"); e->ti_next_snapshot = 0; - parser_get_param_string(params, "Snapshots:basename", e->snapshotBaseName); - e->snapshotCompression = + parser_get_param_string(params, "Snapshots:basename", e->snapshot_base_name); + e->snapshot_compression = parser_get_opt_param_int(params, "Snapshots:compression", 0); - e->snapshotUnits = (struct unit_system *)malloc(sizeof(struct unit_system)); - units_init_default(e->snapshotUnits, params, "Snapshots", internal_units); - e->snapshotOutputCount = 0; + e->snapshot_units = (struct unit_system *)malloc(sizeof(struct unit_system)); + units_init_default(e->snapshot_units, params, "Snapshots", internal_units); + e->snapshot_output_count = 0; e->dt_min = parser_get_param_double(params, "TimeIntegration:dt_min"); e->dt_max = parser_get_param_double(params, "TimeIntegration:dt_max"); e->a_first_statistics = @@ -6135,7 +6135,7 @@ void engine_clean(struct engine *e) { gravity_cache_clean(&e->runners[i].cj_gravity_cache); } free(e->runners); - free(e->snapshotUnits); + free(e->snapshot_units); free(e->links); scheduler_clean(&e->sched); space_clean(e->s); @@ -6159,7 +6159,7 @@ void engine_struct_dump(struct engine *e, FILE *stream) { /* And all the engine pointed data, these use their own dump functions. */ space_struct_dump(e->s, stream); units_struct_dump(e->internal_units, stream); - units_struct_dump(e->snapshotUnits, stream); + units_struct_dump(e->snapshot_units, stream); cosmology_struct_dump(e->cosmology, stream); #ifdef WITH_MPI @@ -6211,7 +6211,7 @@ void engine_struct_restore(struct engine *e, FILE *stream) { us = (struct unit_system *)malloc(sizeof(struct unit_system)); units_struct_restore(us, stream); - e->snapshotUnits = us; + e->snapshot_units = us; struct cosmology *cosmo = (struct cosmology *)malloc(sizeof(struct cosmology)); diff --git a/src/engine.h b/src/engine.h index 951786e5224be46126a1ea322aa2cb186460a6a2..6edb89fd3e36d33ec5cc4439bd875d25febb89e1 100644 --- a/src/engine.h +++ b/src/engine.h @@ -199,10 +199,10 @@ struct engine { /* Integer time of the next snapshot */ integertime_t ti_next_snapshot; - char snapshotBaseName[PARSER_MAX_LINE_SIZE]; - int snapshotCompression; - struct unit_system *snapshotUnits; - int snapshotOutputCount; + char snapshot_base_name[PARSER_MAX_LINE_SIZE]; + int snapshot_compression; + struct unit_system *snapshot_units; + int snapshot_output_count; /* Statistics information */ double a_first_statistics; diff --git a/src/parallel_io.c b/src/parallel_io.c index 957b8fed7e5adcabfa8e0ce66f99e3aad2c93460..710bd73548d4b99cdc4efe7c2116944889a3a9f1 100644 --- a/src/parallel_io.c +++ b/src/parallel_io.c @@ -854,7 +854,7 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6], int numFiles = 1; /* First time, we need to create the XMF file */ - if (e->snapshotOutputCount == 0) xmf_create_file(baseName); + if (e->snapshot_output_count == 0) xmf_create_file(baseName); /* Prepare the XMF file for the new entry */ xmfFile = xmf_prepare_file(baseName); @@ -862,7 +862,7 @@ 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->snapshotOutputCount); + e->snapshot_output_count); /* Open HDF5 file with the chosen parameters */ hid_t h_file = H5Fcreate(fileName, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1035,7 +1035,7 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6], } /* Write LXMF file descriptor */ - xmf_write_outputfooter(xmfFile, e->snapshotOutputCount, e->time); + xmf_write_outputfooter(xmfFile, e->snapshot_output_count, e->time); /* Close the file for now */ H5Fclose(h_file); @@ -1117,7 +1117,7 @@ void write_output_parallel(struct engine* e, const char* baseName, /* HDF5 File name */ char fileName[FILENAME_BUFFER_SIZE]; snprintf(fileName, FILENAME_BUFFER_SIZE, "%s_%04i.hdf5", baseName, - e->snapshotOutputCount); + e->snapshot_output_count); /* Prepare some file-access properties */ hid_t plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1327,7 +1327,7 @@ void write_output_parallel(struct engine* e, const char* baseName, clocks_getunit()); #endif - e->snapshotOutputCount++; + e->snapshot_output_count++; } #endif /* HAVE_HDF5 */ diff --git a/src/serial_io.c b/src/serial_io.c index fb9016b18ef829258604b0794e00069cdf2b38fe..4579ce27e7f3e591bf3c5e6bab6e7eedd5f6fefa 100644 --- a/src/serial_io.c +++ b/src/serial_io.c @@ -239,13 +239,13 @@ void prepareArray(const struct engine* e, hid_t grp, char* fileName, } /* Impose data compression */ - if (e->snapshotCompression > 0) { + if (e->snapshot_compression > 0) { h_err = H5Pset_shuffle(h_prop); if (h_err < 0) error("Error while setting shuffling options for field '%s'.", props.name); - h_err = H5Pset_deflate(h_prop, e->snapshotCompression); + h_err = H5Pset_deflate(h_prop, e->snapshot_compression); if (h_err < 0) error("Error while setting compression options for field '%s'.", props.name); @@ -746,7 +746,7 @@ void write_output_serial(struct engine* e, const char* baseName, /* File name */ char fileName[FILENAME_BUFFER_SIZE]; snprintf(fileName, FILENAME_BUFFER_SIZE, "%s_%04i.hdf5", baseName, - e->snapshotOutputCount); + e->snapshot_output_count); /* Compute offset in the file and total number of particles */ size_t N[swift_type_count] = {Ngas, Ndm, 0, 0, Nstars, 0}; @@ -766,7 +766,7 @@ void write_output_serial(struct engine* e, const char* baseName, if (mpi_rank == 0) { /* First time, we need to create the XMF file */ - if (e->snapshotOutputCount == 0) xmf_create_file(baseName); + if (e->snapshot_output_count == 0) xmf_create_file(baseName); /* Prepare the XMF file for the new entry */ xmfFile = xmf_prepare_file(baseName); @@ -1045,10 +1045,10 @@ void write_output_serial(struct engine* e, const char* baseName, /* Write footer of LXMF file descriptor */ if (mpi_rank == 0) - xmf_write_outputfooter(xmfFile, e->snapshotOutputCount, e->time); + xmf_write_outputfooter(xmfFile, e->snapshot_output_count, e->time); /* message("Done writing particles..."); */ - e->snapshotOutputCount++; + e->snapshot_output_count++; } #endif /* HAVE_HDF5 && HAVE_MPI */ diff --git a/src/single_io.c b/src/single_io.c index d81c9f9c1652546e223fb151ac3acdfa05399d0d..889334b73641d7d06f1b6773569c52328138f320 100644 --- a/src/single_io.c +++ b/src/single_io.c @@ -246,13 +246,13 @@ void writeArray(const struct engine* e, hid_t grp, char* fileName, } /* Impose data compression */ - if (e->snapshotCompression > 0) { + if (e->snapshot_compression > 0) { h_err = H5Pset_shuffle(h_prop); if (h_err < 0) error("Error while setting shuffling options for field '%s'.", props.name); - h_err = H5Pset_deflate(h_prop, e->snapshotCompression); + h_err = H5Pset_deflate(h_prop, e->snapshot_compression); if (h_err < 0) error("Error while setting compression options for field '%s'.", props.name); @@ -616,10 +616,10 @@ void write_output_single(struct engine* e, const char* baseName, /* File name */ char fileName[FILENAME_BUFFER_SIZE]; snprintf(fileName, FILENAME_BUFFER_SIZE, "%s_%04i.hdf5", baseName, - e->snapshotOutputCount); + e->snapshot_output_count); /* First time, we need to create the XMF file */ - if (e->snapshotOutputCount == 0) xmf_create_file(baseName); + if (e->snapshot_output_count == 0) xmf_create_file(baseName); /* Prepare the XMF file for the new entry */ FILE* xmfFile = 0; @@ -853,14 +853,14 @@ void write_output_single(struct engine* e, const char* baseName, } /* Write LXMF file descriptor */ - xmf_write_outputfooter(xmfFile, e->snapshotOutputCount, e->time); + xmf_write_outputfooter(xmfFile, e->snapshot_output_count, e->time); /* message("Done writing particles..."); */ /* Close file */ H5Fclose(h_file); - e->snapshotOutputCount++; + e->snapshot_output_count++; } #endif /* HAVE_HDF5 */