Commit 8213c390 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Runs now initialise velociraptor correctly upon restart. When writing the last...

Runs now initialise velociraptor correctly upon restart. When writing the last snapshot, invoke VR if that what asked for in the parameter file.
parent acd9dcdf
......@@ -919,10 +919,6 @@ int main(int argc, char *argv[]) {
fflush(stdout);
}
#ifdef HAVE_VELOCIRAPTOR
if (with_structure_finding) velociraptor_init(&e);
#endif
/* Get some info to the user. */
if (myrank == 0) {
long long N_DM = N_total[1] - N_total[2] - N_total[0];
......@@ -983,14 +979,6 @@ int main(int argc, char *argv[]) {
/* Is there a dump before the end of the first time-step? */
engine_check_for_dumps(&e);
#ifdef HAVE_VELOCIRAPTOR
/* Call VELOCIraptor for the first time after the first snapshot dump. */
// if (e.policy & engine_policy_structure_finding) {
// velociraptor_init(&e);
// velociraptor_invoke(&e);
//}
#endif
}
/* Legend */
......@@ -1203,8 +1191,19 @@ int main(int argc, char *argv[]) {
logger_log_all(e.logger, &e);
engine_dump_index(&e);
#endif
// write a final snapshot with logger, in order to facilitate a restart
#ifdef HAVE_VELOCIRAPTOR
if (with_structure_finding && e.snapshot_invoke_stf)
velociraptor_invoke(&e, /*linked_with_snap=*/1);
#endif
/* write a final snapshot */
engine_dump_snapshot(&e);
#ifdef HAVE_VELOCIRAPTOR
if (with_structure_finding && e.snapshot_invoke_stf)
free(e.s->gpart_group_data);
#endif
}
#ifdef WITH_MPI
......
......@@ -4746,6 +4746,11 @@ void engine_config(int restart, struct engine *e, struct swift_params *params,
logger_write_file_header(e->logger, e);
#endif
/* Initialise the structure finder */
#ifdef HAVE_VELOCIRAPTOR
if (e->policy & engine_policy_structure_finding) velociraptor_init(e);
#endif
/* Free the affinity stuff */
#if defined(HAVE_SETAFFINITY)
if (with_aff) {
......
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