Skip to content
Snippets Groups Projects
Commit a5bbe133 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Do not reset the delta times for snapshot triggers upon restarting the code

parent c184f132
Branches
Tags
4 merge requests!2119Mhd canvas,!2112Prep for remix merge,!2109Catching the zoom branch up with master,!2081Do not reset the delta times for snapshot triggers upon restarting the code
......@@ -684,7 +684,7 @@ struct engine {
/* Function prototypes, engine.c. */
void engine_addlink(struct engine *e, struct link **l, struct task *t);
void engine_barrier(struct engine *e);
void engine_compute_next_snapshot_time(struct engine *e);
void engine_compute_next_snapshot_time(struct engine *e, const int restart);
void engine_compute_next_stf_time(struct engine *e);
void engine_compute_next_fof_time(struct engine *e);
void engine_compute_next_statistics_time(struct engine *e);
......
......@@ -789,7 +789,7 @@ void engine_config(int restart, int fof, struct engine *e,
#endif
/* Find the time of the first snapshot output */
engine_compute_next_snapshot_time(e);
engine_compute_next_snapshot_time(e, restart);
/* Find the time of the first statistics output */
engine_compute_next_statistics_time(e);
......
......@@ -565,7 +565,7 @@ void engine_io(struct engine *e) {
#endif
/* ... and find the next output time */
engine_compute_next_snapshot_time(e);
engine_compute_next_snapshot_time(e, /*restart=*/0);
break;
case output_statistics:
......@@ -752,15 +752,19 @@ void engine_set_and_verify_snapshot_triggers(struct engine *e) {
* @brief Computes the next time (on the time line) for a dump
*
* @param e The #engine.
* @param restart Are we calling this upon a restart event?
*/
void engine_compute_next_snapshot_time(struct engine *e) {
void engine_compute_next_snapshot_time(struct engine *e, const int restart) {
/* Do output_list file case */
if (e->output_list_snapshots) {
output_list_read_next_time(e->output_list_snapshots, e, "snapshots",
&e->ti_next_snapshot);
engine_set_and_verify_snapshot_triggers(e);
/* Unless we are restarting, check the allowed recording trigger time */
if (!restart) engine_set_and_verify_snapshot_triggers(e);
/* All done in the list case */
return;
}
......@@ -818,8 +822,8 @@ void engine_compute_next_snapshot_time(struct engine *e) {
message("Next snapshot time set to t=%e.", next_snapshot_time);
}
/* Set the recording triggers accordingly for the next output */
engine_set_and_verify_snapshot_triggers(e);
/* Unless we are restarting, set the recording triggers accordingly for the next output */
if (!restart) engine_set_and_verify_snapshot_triggers(e);
}
}
......@@ -1184,7 +1188,7 @@ void engine_init_output_lists(struct engine *e, struct swift_params *params,
if (e->output_list_snapshots->select_output_on)
output_list_check_selection(e->output_list_snapshots, output_options);
engine_compute_next_snapshot_time(e);
engine_compute_next_snapshot_time(e, /*restart=*/0);
if (e->policy & engine_policy_cosmology)
e->a_first_snapshot =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment