From ce6b6c58cba687af307a7e2421a8ba8dc426ad77 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Sun, 21 Aug 2016 13:36:12 +0100
Subject: [PATCH] Make the ID of the Gizmo-particles a long long and not
 unsigned long long

---
 src/const.h                  | 13 ++++++-------
 src/hydro/Gizmo/hydro_part.h |  2 +-
 src/runner.c                 | 12 ++++++++++--
 3 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/src/const.h b/src/const.h
index fccc6d9aac..64d07b3f3b 100644
--- a/src/const.h
+++ b/src/const.h
@@ -63,23 +63,22 @@
 
 /* SPH variant to use */
 //#define MINIMAL_SPH
-//#define GADGET2_SPH
+#define GADGET2_SPH
 //#define DEFAULT_SPH
-#define GIZMO_SPH
+//#define GIZMO_SPH
 
 /* Riemann solver to use (GIZMO_SPH only) */
 #define RIEMANN_SOLVER_EXACT
 //#define RIEMANN_SOLVER_TRRS
 //#define RIEMANN_SOLVER_HLLC
 
-/* Type of gradients to use (GIZMO_SPH only)
-   If no option is chosen, no gradients are used (first order scheme) */
+/* Type of gradients to use (GIZMO_SPH only) */
+/* If no option is chosen, no gradients are used (first order scheme) */
 //#define GRADIENTS_SPH
 #define GRADIENTS_GIZMO
 
-/* Types of slope limiter to use (GIZMO_SPH only)
-   Different slope limiters can be combined, so multiple options may
-   be selected */
+/* Types of slope limiter to use (GIZMO_SPH only) */
+/* Different slope limiters can be combined */
 #define SLOPE_LIMITER_PER_FACE
 #define SLOPE_LIMITER_CELL_WIDE
 
diff --git a/src/hydro/Gizmo/hydro_part.h b/src/hydro/Gizmo/hydro_part.h
index 6da950b605..89c625de79 100644
--- a/src/hydro/Gizmo/hydro_part.h
+++ b/src/hydro/Gizmo/hydro_part.h
@@ -196,7 +196,7 @@ struct part {
   float mass;
 
   /* Particle ID. */
-  unsigned long long id;
+  long long id;
 
   /* Associated gravitas. */
   struct gpart *gpart;
diff --git a/src/runner.c b/src/runner.c
index d3e6783930..b2c7c5cd2f 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -82,8 +82,8 @@ const char runner_flip[27] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
 #define FUNCTION density
 #include "runner_doiact.h"
 
+/* Import the gradient loop functions (if required). */
 #ifdef EXTRA_HYDRO_LOOP
-/* Import the gradient loop functions. */
 #undef FUNCTION
 #define FUNCTION gradient
 #include "runner_doiact.h"
@@ -436,7 +436,9 @@ void runner_do_init(struct runner *r, struct cell *c, int timer) {
  * @param c The cell.
  */
 void runner_do_extra_ghost(struct runner *r, struct cell *c) {
+
 #ifdef EXTRA_HYDRO_LOOP
+
   struct part *restrict parts = c->parts;
   const int count = c->count;
   const int ti_current = r->e->ti_current;
@@ -461,6 +463,9 @@ void runner_do_extra_ghost(struct runner *r, struct cell *c) {
       }
     }
   }
+
+#else
+  error("SWIFT was not compiled with the extra hydro loop activated.");
 #endif
 }
 
@@ -1131,7 +1136,8 @@ void *runner_main(void *data) {
       /* Different types of tasks... */
       switch (t->type) {
         case task_type_self:
-          if (t->subtype == task_subtype_density) runner_doself1_density(r, ci);
+          if (t->subtype == task_subtype_density) 
+	    runner_doself1_density(r, ci);
 #ifdef EXTRA_HYDRO_LOOP
           else if (t->subtype == task_subtype_gradient)
             runner_doself1_gradient(r, ci);
@@ -1194,9 +1200,11 @@ void *runner_main(void *data) {
         case task_type_ghost:
           runner_do_ghost(r, ci);
           break;
+#ifdef EXTRA_HYDRO_LOOP
         case task_type_extra_ghost:
           runner_do_extra_ghost(r, ci);
           break;
+#endif
         case task_type_kick:
           runner_do_kick(r, ci, 1);
           break;
-- 
GitLab