Commit e4adbf64 authored by lhausamm's avatar lhausamm Committed by Loic Hausammann
Browse files

Ensure size of the log

parent 602f8dcb
......@@ -91,6 +91,7 @@ Snapshots:
output_list_on: 0 # (Optional) Enable the output list
output_list: snaplist.txt # (Optional) File containing the output times (see documentation in "Parameter File" section)
logger_max_steps: 10 # (Optional) Number of particle steps between two chunk writing if using logger
logger_size: 1e7 # buffer size of the logger file in bytes
# Parameters governing the conserved quantities statistics
Statistics:
......
......@@ -5461,6 +5461,7 @@ void engine_step(struct engine *e) {
((double)e->total_nr_gparts) * e->gravity_properties->rebuild_frequency))
e->forcerebuild = 1;
#ifdef WITH_LOGGER
logger_log_timestamp(e->ti_old, &e->logger_time_offset,
e->logger_dump);
......@@ -6700,10 +6701,11 @@ void engine_init(struct engine *e, struct space *s, struct swift_params *params,
/* Logger params */
char logger_name_file[PARSER_MAX_LINE_SIZE];
e->logger_max_steps = parser_get_opt_param_int(params, "Snapshots:logger_max_steps", 10);
parser_get_opt_param_string(params, "Snapshots:dump_file", logger_name_file, e->snapshotBaseName);
e->logger_size = parser_get_param_float(params, "Snapshots:logger_size");
strcpy(logger_name_file, e->snapshotBaseName);
strcat(logger_name_file, ".dump");
e->logger_dump = malloc(sizeof(struct dump));
dump_init(e->logger_dump, logger_name_file, 1024 * 1024 * 100);
dump_init(e->logger_dump, logger_name_file, e->logger_size);
e->logger_time_offset = 0;
#endif
......
......@@ -325,6 +325,10 @@ struct engine {
/* Need to dump a snapshot ? */
int dump_snapshot;
/* Size of the dump file */
int logger_size;
#endif
/* How many steps have we done with the same set of tasks? */
int tasks_age;
......
......@@ -899,7 +899,7 @@ void runner_do_init_grav(struct runner *r, struct cell *c, int timer) {
* @param timer Are we timing this ?
*/
void runner_do_extra_ghost(struct runner *r, struct cell *c, int timer) {
#ifdef EXTRA_HYDRO_LOOP
struct part *restrict parts = c->hydro.parts;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment