From 7f1e844f9a609cfeb4d63e76f5cf1a4f23d14081 Mon Sep 17 00:00:00 2001
From: axc67-mjm02 <axc67-mjm02@sqg1cintr14.bullx>
Date: Thu, 22 Nov 2018 16:41:42 +0000
Subject: [PATCH] Fixed compilation issues

---
 src/Makefile.am   | 4 ++--
 src/numa_helper.c | 4 ++--
 src/numa_helper.h | 2 +-
 src/runner.c      | 1 -
 src/swift.h       | 1 +
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index afe4002b29..c6e9950d15 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -49,7 +49,7 @@ include_HEADERS = space.h runner.h queue.h task.h lock.h cell.h part.h const.h \
     gravity_softened_derivatives.h vector_power.h collectgroup.h hydro_space.h sort_part.h \
     chemistry.h chemistry_io.h chemistry_struct.h cosmology.h restart.h space_getsid.h utilities.h \
     mesh_gravity.h cbrt.h velociraptor_interface.h swift_velociraptor_part.h outputlist.h \
-    logger_io.h
+    logger_io.h numa_helper.h
 
 # Common source files
 AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c engine_maketasks.c \
@@ -62,7 +62,7 @@ AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c engine_maketasks.c
     part_type.c xmf.c gravity_properties.c gravity.c \
     collectgroup.c hydro_space.c equation_of_state.c \
     chemistry.c cosmology.c restart.c mesh_gravity.c velociraptor_interface.c \
-    outputlist.c velociraptor_dummy.c logger_io.c
+    outputlist.c velociraptor_dummy.c logger_io.c numa_helper.c
 
 # Include files for distribution, not installation.
 nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h inline.h kernel_hydro.h kernel_gravity.h \
diff --git a/src/numa_helper.c b/src/numa_helper.c
index a79d849f06..5f9fa9011f 100644
--- a/src/numa_helper.c
+++ b/src/numa_helper.c
@@ -54,7 +54,7 @@
  * @param node The numa node to move to.
  * @param verbose Are we talkative/do we check things.
  */
-int swiftnuma_cell_move_hydro_parts(struct cell *c, int32_t node, int32_t verbose){
+void swiftnuma_cell_move_hydro_parts(struct cell *c, int32_t node, int32_t verbose){
 #ifdef HAVE_LIBNUMA
   struct part *start_part = c->hydro.parts;
   struct part *end_part = &c->hydro.parts[c->hydro.count];
@@ -66,7 +66,7 @@ int swiftnuma_cell_move_hydro_parts(struct cell *c, int32_t node, int32_t verbos
     start_page += page_size;
   }
   if( ((uintptr_t)(((uint8_t*)(end_part+1)) - last_page)) <= (page_size/2) ){
-    end_page -= page_size;
+    last_page -= page_size;
   }
   uintptr_t nr_pages = ((uintptr_t)(last_page - start_page)) / page_size;
   if(nr_pages > 0){
diff --git a/src/numa_helper.h b/src/numa_helper.h
index 6e4809c147..68912b8589 100644
--- a/src/numa_helper.h
+++ b/src/numa_helper.h
@@ -22,6 +22,6 @@
 #include <stdint.h>
 #include "cell.h"
 
-int swiftnuma_cell_move_hydro_parts(struct cell *c, int32_t node, int32_t verbose);
+void swiftnuma_cell_move_hydro_parts(struct cell *c, int32_t node, int32_t verbose);
 
 #endif
diff --git a/src/runner.c b/src/runner.c
index 6db47da945..dbfe31ef7a 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -2503,7 +2503,6 @@ void *runner_main(void *data) {
       DRAM_hits.exclude_hv = 1;
       DRAM_miss.exclude_hv = 1;
       ins_ret.exclude_hv = 1;
-      printf("%i %i\n", r->id, r->cpuid);
       r->local_DRAM_hits_handle = swift_perf_event_open(&DRAM_hits,0,r->cpuid,-1,0);
       r->local_DRAM_miss_handle = swift_perf_event_open(&DRAM_miss,0,r->cpuid,-1,0);
       r->instructions_retired_handle = swift_perf_event_open(&ins_ret,0,r->cpuid,-1,0);
diff --git a/src/swift.h b/src/swift.h
index 153c4ae0d4..259e0edb6d 100644
--- a/src/swift.h
+++ b/src/swift.h
@@ -50,6 +50,7 @@
 #include "map.h"
 #include "mesh_gravity.h"
 #include "multipole.h"
+#include "numa_helper.h"
 #include "outputlist.h"
 #include "parallel_io.h"
 #include "parser.h"
-- 
GitLab