Commit 2f87756c authored by James Willis's avatar James Willis
Browse files

Rename debug interactions macros and remove extra debug.

parent 10a80a19
......@@ -175,7 +175,7 @@ __attribute__((always_inline)) INLINE static void hydro_timestep_extra(
__attribute__((always_inline)) INLINE static void hydro_init_part(
struct part *restrict p, const struct hydro_space *hs) {
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
for (int i = 0; i < NUM_OF_NEIGHBOURS; ++i) p->ids_ngbs_density[i] = -1;
p->num_ngb_density = 0;
#endif
......@@ -316,7 +316,7 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
__attribute__((always_inline)) INLINE static void hydro_reset_acceleration(
struct part *restrict p) {
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
for (int i = 0; i < NUM_OF_NEIGHBOURS; ++i) p->ids_ngbs_force[i] = -1;
p->num_ngb_force = 0;
#endif
......
......@@ -105,10 +105,10 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
pj->density.rot_v[2] += facj * curlvr[2];
/* Update ngb counters */
#ifdef DEBUG_INTERACTIONS
if(pi->id == CHECK_PART_ID) pi->ids_ngbs_density[pi->num_ngb_density] = pj->id;
#ifdef DEBUG_INTERACTIONS_SPH
pi->ids_ngbs_density[pi->num_ngb_density] = pj->id;
++pi->num_ngb_density;
if(pj->id == CHECK_PART_ID) pj->ids_ngbs_density[pj->num_ngb_density] = pi->id;
pj->ids_ngbs_density[pj->num_ngb_density] = pi->id;
++pj->num_ngb_density;
#endif
......@@ -161,9 +161,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_density(
pi->density.rot_v[1] += fac * curlvr[1];
pi->density.rot_v[2] += fac * curlvr[2];
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
/* Update ngb counters */
if(pi->id == CHECK_PART_ID) pi->ids_ngbs_density[pi->num_ngb_density] = pj->id;
pi->ids_ngbs_density[pi->num_ngb_density] = pj->id;
++pi->num_ngb_density;
#endif
......@@ -497,15 +497,11 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
pi->entropy_dt += mj * visc_term * dvdr;
pj->entropy_dt += mi * visc_term * dvdr;
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
/* Update ngb counters */
if(pi->id == CHECK_PART_ID) {
pi->ids_ngbs_force[pi->num_ngb_force] = pj->id;
}
pi->ids_ngbs_force[pi->num_ngb_force] = pj->id;
++pi->num_ngb_force;
if(pj->id == CHECK_PART_ID) {
pj->ids_ngbs_force[pj->num_ngb_force] = pi->id;
}
pj->ids_ngbs_force[pj->num_ngb_force] = pi->id;
++pj->num_ngb_force;
#endif
......@@ -599,11 +595,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
/* Change in entropy */
pi->entropy_dt += mj * visc_term * dvdr;
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
/* Update ngb counters */
if(pi->id == CHECK_PART_ID) {
pi->ids_ngbs_force[pi->num_ngb_force] = pj->id;
}
pi->ids_ngbs_force[pi->num_ngb_force] = pj->id;
++pi->num_ngb_force;
#endif
......
......@@ -77,7 +77,7 @@ void hydro_write_particles(struct part* parts, struct io_props* list,
*num_fields = 10;
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
*num_fields = 14;
#endif
......@@ -103,7 +103,7 @@ void hydro_write_particles(struct part* parts, struct io_props* list,
parts, rho, convert_u);
list[9] = io_make_output_field_convert_part(
"Pressure", FLOAT, 1, UNIT_CONV_PRESSURE, parts, rho, convert_P);
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
list[10] = io_make_output_field("Num_ngb_density", INT, 1, UNIT_CONV_NO_UNITS,
parts, num_ngb_density);
list[11] = io_make_output_field("Num_ngb_force", INT, 1, UNIT_CONV_NO_UNITS,
......
......@@ -34,8 +34,6 @@
#include "cooling_struct.h"
#define NUM_OF_NEIGHBOURS 128
#define CHECK_PART_ID 999999999999999999999
//#define CHECK_PART_ID 5673486482283
/* Extra particle data not needed during the SPH loops over neighbours. */
struct xpart {
......@@ -147,7 +145,7 @@ struct part {
#endif
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
/*! List of interacting particles in the density SELF and PAIR */
long long ids_ngbs_density[NUM_OF_NEIGHBOURS];
......
......@@ -634,21 +634,14 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
doi_mask = doi_mask & doi_mask_self_check;
doi_mask2 = doi_mask2 & doi_mask2_self_check;
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if (doi_mask & (1 << bit_index)) {
if(pi->id == CHECK_PART_ID) {
pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + bit_index].id;
}
pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + bit_index].id;
++pi->num_ngb_density;
}
}
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if (doi_mask2 & (1 << bit_index)) {
if(pi->id == CHECK_PART_ID) {
pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + VEC_SIZE + bit_index].id;
}
pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + VEC_SIZE + bit_index].id;
++pi->num_ngb_density;
}
}
......@@ -873,12 +866,10 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
vec_combine_masks(v_doi_mask, v_doi_mask_self_check);
doi_mask = vec_form_int_mask(v_doi_mask);
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if (doi_mask & (1 << bit_index)) {
if(pi->id == CHECK_PART_ID) {
pi->ids_ngbs_force[pi->num_ngb_force] = parts[pjd + bit_index].id;
}
pi->ids_ngbs_force[pi->num_ngb_force] = parts[pjd + bit_index].id;
++pi->num_ngb_force;
}
}
......@@ -1142,12 +1133,10 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
/* Form integer mask. */
doi_mask = vec_form_int_mask(v_doi_mask);
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if (doi_mask & (1 << bit_index)) {
if(pi->id == CHECK_PART_ID) {
pi->ids_ngbs_density[pi->num_ngb_density] = parts_j[sort_j[pjd + bit_index].i].id;
}
pi->ids_ngbs_density[pi->num_ngb_density] = parts_j[sort_j[pjd + bit_index].i].id;
++pi->num_ngb_density;
}
}
......@@ -1284,12 +1273,10 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
/* Form integer mask. */
doj_mask = vec_form_int_mask(v_doj_mask);
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if (doj_mask & (1 << bit_index)) {
if(pj->id == CHECK_PART_ID) {
pj->ids_ngbs_density[pj->num_ngb_density] = parts_i[sort_i[ci_cache_idx + first_pi_align + bit_index].i].id;
}
pj->ids_ngbs_density[pj->num_ngb_density] = parts_i[sort_i[ci_cache_idx + first_pi_align + bit_index].i].id;
++pj->num_ngb_density;
}
}
......@@ -1557,12 +1544,10 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci,
/* Form integer masks. */
doi_mask = vec_form_int_mask(v_doi_mask);
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if (doi_mask & (1 << bit_index)) {
if(pi->id == CHECK_PART_ID) {
pi->ids_ngbs_force[pi->num_ngb_force] = parts_j[sort_j[pjd + bit_index].i].id;
}
pi->ids_ngbs_force[pi->num_ngb_force] = parts_j[sort_j[pjd + bit_index].i].id;
++pi->num_ngb_force;
}
}
......@@ -1710,12 +1695,10 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci,
/* Form integer masks. */
doj_mask = vec_form_int_mask(v_doj_mask);
#ifdef DEBUG_INTERACTIONS
#ifdef DEBUG_INTERACTIONS_SPH
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if (doj_mask & (1 << bit_index)) {
if(pj->id == CHECK_PART_ID) {
pj->ids_ngbs_force[pj->num_ngb_force] = parts_i[sort_i[ci_cache_idx + first_pi_align + bit_index].i].id;
}
pj->ids_ngbs_force[pj->num_ngb_force] = parts_i[sort_i[ci_cache_idx + first_pi_align + bit_index].i].id;
++pj->num_ngb_force;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment