From a1982ff7f867170ac6cac4a8bb3b64d9f88c178a Mon Sep 17 00:00:00 2001
From: James Willis <james.s.willis@durham.ac.uk>
Date: Wed, 21 Mar 2018 13:52:04 +0800
Subject: [PATCH] Renamed wrappers for call to VELOCIraptor.

---
 examples/main.c              | 2 +-
 src/engine.c                 | 4 ++--
 src/velociraptor_interface.c | 6 ++++--
 src/velociraptor_interface.h | 4 ++--
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/examples/main.c b/examples/main.c
index 811b2d9469..8fb53f2825 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 e39d8ccb80..1537119fc1 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 c33d490894..9ad48ee9fe 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 b798a200b1..90f98857ef 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 */
-- 
GitLab