From 047fa75a74a6be9fbf6c86d9b1c5decdeec41977 Mon Sep 17 00:00:00 2001
From: James Willis <james.s.willis@durham.ac.uk>
Date: Mon, 11 Dec 2017 16:47:50 +0000
Subject: [PATCH] Changed name of number of neighbours to log.

---
 src/hydro/Gadget2/hydro.h      |  4 ++--
 src/hydro/Gadget2/hydro_iact.h | 12 ++++++------
 src/hydro/Gadget2/hydro_io.h   |  4 ++--
 src/runner_doiact_vec.c        | 18 +++++++++---------
 4 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/hydro/Gadget2/hydro.h b/src/hydro/Gadget2/hydro.h
index 829c7ce985..f7ce7d4b49 100644
--- a/src/hydro/Gadget2/hydro.h
+++ b/src/hydro/Gadget2/hydro.h
@@ -176,7 +176,7 @@ __attribute__((always_inline)) INLINE static void hydro_init_part(
     struct part *restrict p, const struct hydro_space *hs) {
 
 #ifdef DEBUG_INTERACTIONS_SPH
-  for (int i = 0; i < NUM_OF_NEIGHBOURS; ++i) p->ids_ngbs_density[i] = -1;
+  for (int i = 0; i < MAX_NUM_OF_NEIGHBOURS; ++i) p->ids_ngbs_density[i] = -1;
   p->num_ngb_density = 0;
 #endif
   
@@ -317,7 +317,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_acceleration(
     struct part *restrict p) {
 
 #ifdef DEBUG_INTERACTIONS_SPH
-  for (int i = 0; i < NUM_OF_NEIGHBOURS; ++i) p->ids_ngbs_force[i] = -1;
+  for (int i = 0; i < MAX_NUM_OF_NEIGHBOURS; ++i) p->ids_ngbs_force[i] = -1;
   p->num_ngb_force = 0;
 #endif
   
diff --git a/src/hydro/Gadget2/hydro_iact.h b/src/hydro/Gadget2/hydro_iact.h
index f6d8be0da0..3b5b785a3e 100644
--- a/src/hydro/Gadget2/hydro_iact.h
+++ b/src/hydro/Gadget2/hydro_iact.h
@@ -106,13 +106,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
   
 #ifdef DEBUG_INTERACTIONS_SPH
   /* Update ngb counters */
-  if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
+  if(pi->num_ngb_density < MAX_NUM_OF_NEIGHBOURS) {
     pi->ids_ngbs_density[pi->num_ngb_density] = pj->id;
     ++pi->num_ngb_density;
   }
   else ++pi->num_ngb_density;
 
-  if(pj->num_ngb_density < NUM_OF_NEIGHBOURS) {
+  if(pj->num_ngb_density < MAX_NUM_OF_NEIGHBOURS) {
     pj->ids_ngbs_density[pj->num_ngb_density] = pi->id;
     ++pj->num_ngb_density;
   }
@@ -170,7 +170,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_density(
   
 #ifdef DEBUG_INTERACTIONS_SPH
   /* Update ngb counters */
-  if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
+  if(pi->num_ngb_density < MAX_NUM_OF_NEIGHBOURS) {
     pi->ids_ngbs_density[pi->num_ngb_density] = pj->id;
     ++pi->num_ngb_density;
   }
@@ -503,13 +503,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
   
 #ifdef DEBUG_INTERACTIONS_SPH
   /* Update ngb counters */
-  if(pi->num_ngb_force < NUM_OF_NEIGHBOURS) {
+  if(pi->num_ngb_force < MAX_NUM_OF_NEIGHBOURS) {
     pi->ids_ngbs_force[pi->num_ngb_force] = pj->id;
     ++pi->num_ngb_force;
   }
   else ++pi->num_ngb_force;
 
-  if(pj->num_ngb_force < NUM_OF_NEIGHBOURS) {
+  if(pj->num_ngb_force < MAX_NUM_OF_NEIGHBOURS) {
     pj->ids_ngbs_force[pj->num_ngb_force] = pi->id;
     ++pj->num_ngb_force;
   }
@@ -608,7 +608,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
   
 #ifdef DEBUG_INTERACTIONS_SPH
   /* Update ngb counters */
-  if(pi->num_ngb_force < NUM_OF_NEIGHBOURS) {
+  if(pi->num_ngb_force < MAX_NUM_OF_NEIGHBOURS) {
     pi->ids_ngbs_force[pi->num_ngb_force] = pj->id;
     ++pi->num_ngb_force;
   }
diff --git a/src/hydro/Gadget2/hydro_io.h b/src/hydro/Gadget2/hydro_io.h
index fd3e058c1a..7b7c5c6477 100644
--- a/src/hydro/Gadget2/hydro_io.h
+++ b/src/hydro/Gadget2/hydro_io.h
@@ -122,9 +122,9 @@ void hydro_write_particles(const struct part* parts, struct io_props* list,
                                  parts, num_ngb_density);
   list[11] = io_make_output_field("Num_ngb_force", INT, 1, UNIT_CONV_NO_UNITS,
                                  parts, num_ngb_force);
-  list[12] = io_make_output_field("Ids_ngb_density", LONGLONG, NUM_OF_NEIGHBOURS,
+  list[12] = io_make_output_field("Ids_ngb_density", LONGLONG, MAX_NUM_OF_NEIGHBOURS,
                                  UNIT_CONV_NO_UNITS, parts, ids_ngbs_density);
-  list[13] = io_make_output_field("Ids_ngb_force", LONGLONG, NUM_OF_NEIGHBOURS,
+  list[13] = io_make_output_field("Ids_ngb_force", LONGLONG, MAX_NUM_OF_NEIGHBOURS,
                                  UNIT_CONV_NO_UNITS, parts, ids_ngbs_force);
 #endif
 
diff --git a/src/runner_doiact_vec.c b/src/runner_doiact_vec.c
index e73cdf2111..3373e0e1fe 100644
--- a/src/runner_doiact_vec.c
+++ b/src/runner_doiact_vec.c
@@ -669,7 +669,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
 #ifdef DEBUG_INTERACTIONS_SPH
       for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
         if (doi_mask & (1 << bit_index)) { 
-          if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
+          if(pi->num_ngb_density < MAX_NUM_OF_NEIGHBOURS) {
             pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + bit_index].id;
             ++pi->num_ngb_density;
           }
@@ -677,7 +677,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
         }
 
         if (doi_mask2 & (1 << bit_index)) { 
-          if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
+          if(pi->num_ngb_density < MAX_NUM_OF_NEIGHBOURS) {
             pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + VEC_SIZE + bit_index].id;
             ++pi->num_ngb_density;
           }
@@ -897,7 +897,7 @@ __attribute__((always_inline)) INLINE void runner_doself_subset_density_vec(
 #ifdef DEBUG_INTERACTIONS_SPH
       for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
         if (doi_mask & (1 << bit_index)) {
-          if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
+          if(pi->num_ngb_density < MAX_NUM_OF_NEIGHBOURS) {
             pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + bit_index].id;
             ++pi->num_ngb_density;
           }
@@ -905,7 +905,7 @@ __attribute__((always_inline)) INLINE void runner_doself_subset_density_vec(
         }
         
         if (doi_mask2 & (1 << bit_index)) {
-          if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
+          if(pi->num_ngb_density < MAX_NUM_OF_NEIGHBOURS) {
             pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + VEC_SIZE + bit_index].id;
             ++pi->num_ngb_density;
           }
@@ -1121,7 +1121,7 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
 #ifdef DEBUG_INTERACTIONS_SPH
       for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
         if (vec_is_mask_true(v_doi_mask) & (1 << bit_index)) {
-          if(pi->num_ngb_force < NUM_OF_NEIGHBOURS) {
+          if(pi->num_ngb_force < MAX_NUM_OF_NEIGHBOURS) {
             pi->ids_ngbs_force[pi->num_ngb_force] = parts[pjd + bit_index].id;
             ++pi->num_ngb_force;
           }
@@ -1373,7 +1373,7 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
 #ifdef DEBUG_INTERACTIONS_SPH
         for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
           if (vec_is_mask_true(v_doi_mask) & (1 << bit_index)) { 
-            if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
+            if(pi->num_ngb_density < MAX_NUM_OF_NEIGHBOURS) {
               pi->ids_ngbs_density[pi->num_ngb_density] = parts_j[sort_j[pjd + bit_index].i].id;
               ++pi->num_ngb_density;
             }
@@ -1500,7 +1500,7 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
 #ifdef DEBUG_INTERACTIONS_SPH
         for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
           if (vec_is_mask_true(v_doj_mask) & (1 << bit_index)) { 
-            if(pj->num_ngb_density < NUM_OF_NEIGHBOURS) {
+            if(pj->num_ngb_density < MAX_NUM_OF_NEIGHBOURS) {
               pj->ids_ngbs_density[pj->num_ngb_density] = parts_i[sort_i[ci_cache_idx + first_pi + bit_index].i].id;
               ++pj->num_ngb_density;
             }
@@ -1762,7 +1762,7 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci,
 #ifdef DEBUG_INTERACTIONS_SPH
         for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
           if (vec_is_mask_true(v_doi_mask) & (1 << bit_index)) {
-            if(pi->num_ngb_force < NUM_OF_NEIGHBOURS) {
+            if(pi->num_ngb_force < MAX_NUM_OF_NEIGHBOURS) {
               pi->ids_ngbs_force[pi->num_ngb_force] = parts_j[sort_j[pjd + bit_index].i].id;
               ++pi->num_ngb_force;
             }
@@ -1899,7 +1899,7 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci,
 #ifdef DEBUG_INTERACTIONS_SPH
         for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
           if (vec_is_mask_true(v_doj_mask) & (1 << bit_index)) {
-            if(pj->num_ngb_force < NUM_OF_NEIGHBOURS) {
+            if(pj->num_ngb_force < MAX_NUM_OF_NEIGHBOURS) {
               pj->ids_ngbs_force[pj->num_ngb_force] = parts_i[sort_i[ci_cache_idx + first_pi + bit_index].i].id;
               ++pj->num_ngb_force;
             }
-- 
GitLab