Skip to content
Snippets Groups Projects
Commit fc7c339d authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Merge branch 'run_labels' into 'master'

Added a run label to the parameter file that gets written to the snapshot headers.

See merge request !817
parents bebc280f 03ebd831
No related branches found
No related tags found
1 merge request!817Added a run label to the parameter file that gets written to the snapshot headers.
Showing with 51 additions and 0 deletions
# Define some meta-data about the simulation
MetaData:
run_name: EAGLE-L0012N0188-Ref
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun in grams
......
# Define some meta-data about the simulation
MetaData:
run_name: EAGLE-L0025N0376-Ref
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun in grams
......
# Define some meta-data about the simulation
MetaData:
run_name: EAGLE-L0050N0752-Ref
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun in grams
......
# Define some meta-data about the simulation
MetaData:
run_name: Planck-Millennium simulation - 1536^3
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun
......
# Define some meta-data about the simulation
MetaData:
run_name: Planck-Millennium simulation - 384^3
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun
......
# Define some meta-data about the simulation
MetaData:
run_name: Planck-Millennium simulation - 768^3
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun
......
# Define some meta-data about the simulation
MetaData:
run_name: Santa-Barbara cluster comparison project 128^3
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun in grams
......
# Define some meta-data about the simulation
MetaData:
run_name: Santa-Barbara cluster comparison project 256^3
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 Msun
......
# Define some meta-data about the simulation
MetaData:
run_name: Name of the sim in less than 256 characters. # The name of the simulation. This is written into the snapshot headers.
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1 # Grams
......
......@@ -4972,6 +4972,15 @@ void engine_init(struct engine *e, struct space *s, struct swift_params *params,
/* Make the space link back to the engine. */
s->e = e;
/* Read the run label */
memset(e->run_name, 0, PARSER_MAX_LINE_SIZE);
parser_get_opt_param_string(params, "MetaData:run_name", e->run_name,
"Untitled SWIFT simulation");
if (strlen(e->run_name) == 0) {
error("The run name in the parameter file cannot be an empty string.");
}
if (e->nodeID == 0) message("Running simulation '%s'.", e->run_name);
/* Setup the timestep if non-cosmological */
if (!(e->policy & engine_policy_cosmology)) {
e->time_begin =
......
......@@ -451,6 +451,9 @@ struct engine {
/* Maximum number of tasks needed for restarting. */
int restart_max_tasks;
/* Label of the run */
char run_name[PARSER_MAX_LINE_SIZE];
};
/* Function prototypes, engine.c. */
......
......@@ -1051,6 +1051,7 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6],
io_write_attribute_s(h_grp, "Code", "SWIFT");
time_t tm = time(NULL);
io_write_attribute_s(h_grp, "Snapshot date", ctime(&tm));
io_write_attribute_s(h_grp, "RunName", e->run_name);
/* GADGET-2 legacy values */
/* Number of particles of each type */
......
......@@ -918,6 +918,7 @@ void write_output_serial(struct engine* e, const char* baseName,
io_write_attribute_s(h_grp, "Code", "SWIFT");
time_t tm = time(NULL);
io_write_attribute_s(h_grp, "Snapshot date", ctime(&tm));
io_write_attribute_s(h_grp, "RunName", e->run_name);
/* GADGET-2 legacy values */
/* Number of particles of each type */
......
......@@ -766,6 +766,7 @@ void write_output_single(struct engine* e, const char* baseName,
io_write_attribute_s(h_grp, "Code", "SWIFT");
time_t tm = time(NULL);
io_write_attribute_s(h_grp, "Snapshot date", ctime(&tm));
io_write_attribute_s(h_grp, "RunName", e->run_name);
/* GADGET-2 legacy values */
/* Number of particles of each type */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment