diff --git a/examples/main.c b/examples/main.c index 811b2d94697e0e28569a8a27204bbdcc1ff3e472..8fb53f2825aaf0d71d872217e5838d345811d842 100644 --- a/examples/main.c +++ b/examples/main.c @@ -850,7 +850,7 @@ int main(int argc, char *argv[]) { engine_print_stats(&e); /* Call VELOCIraptor before first step. */ - if(with_structure_finding) invoke_velociraptor(&e); + if(with_structure_finding) velociraptor_invoke(&e); } /* Legend */ diff --git a/src/engine.c b/src/engine.c index e39d8ccb805fe3b703e579692a15a9bbc0714153..1537119fc11054ebbf8e36980b9d1d03c3ea27bc 100644 --- a/src/engine.c +++ b/src/engine.c @@ -4515,7 +4515,7 @@ void engine_step(struct engine *e) { } /* Invoke VELOCIraptor every 250 timesteps thereafter. */ - if ((e->policy & engine_policy_structure_finding) && e->step%250 == 0) invoke_velociraptor(e); + if ((e->policy & engine_policy_structure_finding) && e->step%250 == 0) velociraptor_invoke(e); /* Now apply all the collected time step updates and particle counts. */ collectgroup1_apply(&e->collect_group1, e); @@ -5337,7 +5337,7 @@ void engine_config(int restart, struct engine *e, engine_rank = nodeID; /* Initialise VELOCIraptor. */ - if (e->policy & engine_policy_structure_finding) init_velociraptor(e); + if (e->policy & engine_policy_structure_finding) velociraptor_init(e); /* Get the number of queues */ int nr_queues = diff --git a/src/velociraptor_interface.c b/src/velociraptor_interface.c index c33d490894acf414e847213fb3f8aa35b5ab5948..9ad48ee9fe5189df2d1d5826160c02bdb1e9c5e9 100644 --- a/src/velociraptor_interface.c +++ b/src/velociraptor_interface.c @@ -34,7 +34,7 @@ * @param e The #engine. * */ -void init_velociraptor(struct engine *e) { +void velociraptor_init(struct engine *e) { struct space *s = e->s; struct cosmoinfo cosmo_info; struct unitinfo unit_info; @@ -93,6 +93,7 @@ void init_velociraptor(struct engine *e) { sim_info.numcells = s->nr_cells; /* Allocate and populate top-level cell locations. */ + /* JSW TODO: Remember to free at the end of the simulation. */ if (posix_memalign((void **)&(sim_info.cellloc), 32, s->nr_cells * sizeof(struct cell_loc)) != 0) error("Failed to allocate top-level cell locations for VELOCIraptor."); @@ -131,7 +132,7 @@ void init_velociraptor(struct engine *e) { * @param e The #engine. * */ -void invoke_velociraptor(struct engine *e) { +void velociraptor_invoke(struct engine *e) { struct space *s = e->s; struct gpart *gparts = s->gparts; @@ -140,6 +141,7 @@ void invoke_velociraptor(struct engine *e) { int *cell_node_ids; /* Allocate and populate array of cell node IDs. */ + /* JSW TODO: Remember to free at the end of the simulation. */ if (posix_memalign((void **)&cell_node_ids, 32, nr_cells * sizeof(int)) != 0) error("Failed to allocate list of cells node IDs for VELOCIraptor."); diff --git a/src/velociraptor_interface.h b/src/velociraptor_interface.h index b798a200b161c51f9da4b337646b2aedba1941b2..90f98857efc6b67d806a034fb5875ecd284568c6 100644 --- a/src/velociraptor_interface.h +++ b/src/velociraptor_interface.h @@ -72,7 +72,7 @@ void InitVelociraptor(char* config_name, char* output_name, struct cosmoinfo cos void InvokeVelociraptor(const int num_gravity_parts, struct gpart *gravity_parts, const int *cell_node_ids); /* VELOCIraptor wrapper functions. */ -void init_velociraptor(struct engine *e); -void invoke_velociraptor(struct engine *e); +void velociraptor_init(struct engine *e); +void velociraptor_invoke(struct engine *e); #endif /* SWIFT_VELOCIRAPTOR_INTERFACE_H */