Commit 184dd8b4 authored by James Willis's avatar James Willis
Browse files

Added energy.txt and timesteps.txt as optional file names in the parameter file.

parent 8ab0ae26
......@@ -2960,7 +2960,7 @@ void engine_init(struct engine *e, struct space *s,
/* Open some files */
if (e->nodeID == 0) {
char energyfileName[200] = "";
parser_get_param_string(params, "Statistics:energy_file_name", energyfileName);
parser_get_opt_param_string(params, "Statistics:energy_file_name", energyfileName, engine_default_energy_file_name);
sprintf(energyfileName + strlen(energyfileName),".txt");
e->file_stats = fopen(energyfileName, "w");
fprintf(e->file_stats,
......@@ -2970,7 +2970,7 @@ void engine_init(struct engine *e, struct space *s,
fflush(e->file_stats);
char timestepsfileName[200] = "";
parser_get_param_string(params, "Statistics:timestep_file_name", timestepsfileName);
parser_get_opt_param_string(params, "Statistics:timestep_file_name", timestepsfileName, engine_default_timesteps_file_name);
sprintf(timestepsfileName + strlen(timestepsfileName),"_%d.txt",nr_nodes * nr_threads);
e->file_timesteps = fopen(timestepsfileName, "w");
......
......@@ -72,6 +72,8 @@ extern const char *engine_policy_names[];
#define engine_tasksreweight 10
#define engine_parts_size_grow 1.05
#define engine_redistribute_alloc_margin 1.2
#define engine_default_energy_file_name "energy"
#define engine_default_timesteps_file_name "timesteps"
/* The rank of the engine as a global variable (for messages). */
extern int engine_rank;
......
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