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

Merge branch 'fix_triggers_for_restarts' into 'master'

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

See merge request !2081
parents 5cf9f321 a5bbe133
No related branches found
No related tags found
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 { ...@@ -684,7 +684,7 @@ struct engine {
/* Function prototypes, engine.c. */ /* Function prototypes, engine.c. */
void engine_addlink(struct engine *e, struct link **l, struct task *t); void engine_addlink(struct engine *e, struct link **l, struct task *t);
void engine_barrier(struct engine *e); 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_stf_time(struct engine *e);
void engine_compute_next_fof_time(struct engine *e); void engine_compute_next_fof_time(struct engine *e);
void engine_compute_next_statistics_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, ...@@ -789,7 +789,7 @@ void engine_config(int restart, int fof, struct engine *e,
#endif #endif
/* Find the time of the first snapshot output */ /* 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 */ /* Find the time of the first statistics output */
engine_compute_next_statistics_time(e); engine_compute_next_statistics_time(e);
......
...@@ -565,7 +565,7 @@ void engine_io(struct engine *e) { ...@@ -565,7 +565,7 @@ void engine_io(struct engine *e) {
#endif #endif
/* ... and find the next output time */ /* ... and find the next output time */
engine_compute_next_snapshot_time(e); engine_compute_next_snapshot_time(e, /*restart=*/0);
break; break;
case output_statistics: case output_statistics:
...@@ -752,15 +752,19 @@ void engine_set_and_verify_snapshot_triggers(struct engine *e) { ...@@ -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 * @brief Computes the next time (on the time line) for a dump
* *
* @param e The #engine. * @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 */ /* Do output_list file case */
if (e->output_list_snapshots) { if (e->output_list_snapshots) {
output_list_read_next_time(e->output_list_snapshots, e, "snapshots", output_list_read_next_time(e->output_list_snapshots, e, "snapshots",
&e->ti_next_snapshot); &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; return;
} }
...@@ -818,8 +822,8 @@ void engine_compute_next_snapshot_time(struct engine *e) { ...@@ -818,8 +822,8 @@ void engine_compute_next_snapshot_time(struct engine *e) {
message("Next snapshot time set to t=%e.", next_snapshot_time); message("Next snapshot time set to t=%e.", next_snapshot_time);
} }
/* Set the recording triggers accordingly for the next output */ /* Unless we are restarting, set the recording triggers accordingly for the next output */
engine_set_and_verify_snapshot_triggers(e); 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, ...@@ -1184,7 +1188,7 @@ void engine_init_output_lists(struct engine *e, struct swift_params *params,
if (e->output_list_snapshots->select_output_on) if (e->output_list_snapshots->select_output_on)
output_list_check_selection(e->output_list_snapshots, output_options); 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) if (e->policy & engine_policy_cosmology)
e->a_first_snapshot = 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