Skip to content
Snippets Groups Projects
Commit e4fc771f authored by James Willis's avatar James Willis
Browse files

If the neighbour count goes above NUM_OF_NEIGHBOURS don't log the neighbour id...

If the neighbour count goes above NUM_OF_NEIGHBOURS don't log the neighbour id but keep logging the neighbour count.
parent 6744caee
No related branches found
No related tags found
1 merge request!443Debug interactions
...@@ -668,13 +668,20 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec( ...@@ -668,13 +668,20 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
#ifdef DEBUG_INTERACTIONS_SPH #ifdef DEBUG_INTERACTIONS_SPH
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) { for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if ((doi_mask & (1 << bit_index)) && pi->num_ngb_density < NUM_OF_NEIGHBOURS) { if (doi_mask & (1 << bit_index)) {
pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + bit_index].id; if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
++pi->num_ngb_density; pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + bit_index].id;
++pi->num_ngb_density;
}
else ++pi->num_ngb_density;
} }
if ((doi_mask2 & (1 << bit_index)) && pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + VEC_SIZE + bit_index].id; if (doi_mask2 & (1 << bit_index)) {
++pi->num_ngb_density; if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + VEC_SIZE + bit_index].id;
++pi->num_ngb_density;
}
else ++pi->num_ngb_density;
} }
} }
#endif #endif
...@@ -889,13 +896,20 @@ __attribute__((always_inline)) INLINE void runner_doself_subset_density_vec( ...@@ -889,13 +896,20 @@ __attribute__((always_inline)) INLINE void runner_doself_subset_density_vec(
#ifdef DEBUG_INTERACTIONS_SPH #ifdef DEBUG_INTERACTIONS_SPH
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) { for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if ((doi_mask & (1 << bit_index)) && pi->num_ngb_density < NUM_OF_NEIGHBOURS) { if (doi_mask & (1 << bit_index)) {
pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + bit_index].id; if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
++pi->num_ngb_density; pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + bit_index].id;
++pi->num_ngb_density;
}
else ++pi->num_ngb_density;
} }
if ((doi_mask2 & (1 << bit_index)) && pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + VEC_SIZE + bit_index].id; if (doi_mask2 & (1 << bit_index)) {
++pi->num_ngb_density; if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
pi->ids_ngbs_density[pi->num_ngb_density] = parts[pjd + VEC_SIZE + bit_index].id;
++pi->num_ngb_density;
}
else ++pi->num_ngb_density;
} }
} }
#endif #endif
...@@ -1106,9 +1120,12 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec( ...@@ -1106,9 +1120,12 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
#ifdef DEBUG_INTERACTIONS_SPH #ifdef DEBUG_INTERACTIONS_SPH
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) { for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if ((vec_is_mask_true(v_doi_mask) & (1 << bit_index)) && pi->num_ngb_force < NUM_OF_NEIGHBOURS) { if (vec_is_mask_true(v_doi_mask) & (1 << bit_index)) {
pi->ids_ngbs_force[pi->num_ngb_force] = parts[pjd + bit_index].id; if(pi->num_ngb_force < NUM_OF_NEIGHBOURS) {
++pi->num_ngb_force; pi->ids_ngbs_force[pi->num_ngb_force] = parts[pjd + bit_index].id;
++pi->num_ngb_force;
}
else ++pi->num_ngb_force;
} }
} }
#endif #endif
...@@ -1355,9 +1372,12 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci, ...@@ -1355,9 +1372,12 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
#ifdef DEBUG_INTERACTIONS_SPH #ifdef DEBUG_INTERACTIONS_SPH
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) { for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if ((vec_is_mask_true(v_doi_mask) & (1 << bit_index)) && pi->num_ngb_density < NUM_OF_NEIGHBOURS) { if (vec_is_mask_true(v_doi_mask) & (1 << bit_index)) {
pi->ids_ngbs_density[pi->num_ngb_density] = parts_j[sort_j[pjd + bit_index].i].id; if(pi->num_ngb_density < NUM_OF_NEIGHBOURS) {
++pi->num_ngb_density; pi->ids_ngbs_density[pi->num_ngb_density] = parts_j[sort_j[pjd + bit_index].i].id;
++pi->num_ngb_density;
}
else ++pi->num_ngb_density;
} }
} }
#endif #endif
...@@ -1479,9 +1499,12 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci, ...@@ -1479,9 +1499,12 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
#ifdef DEBUG_INTERACTIONS_SPH #ifdef DEBUG_INTERACTIONS_SPH
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) { for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if ((vec_is_mask_true(v_doj_mask) & (1 << bit_index)) && pj->num_ngb_density < NUM_OF_NEIGHBOURS) { if (vec_is_mask_true(v_doj_mask) & (1 << bit_index)) {
pj->ids_ngbs_density[pj->num_ngb_density] = parts_i[sort_i[ci_cache_idx + first_pi + bit_index].i].id; if(pj->num_ngb_density < NUM_OF_NEIGHBOURS) {
++pj->num_ngb_density; 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;
}
else ++pj->num_ngb_density;
} }
} }
#endif #endif
...@@ -1738,9 +1761,12 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci, ...@@ -1738,9 +1761,12 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci,
#ifdef DEBUG_INTERACTIONS_SPH #ifdef DEBUG_INTERACTIONS_SPH
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) { for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if ((vec_is_mask_true(v_doi_mask) & (1 << bit_index)) && pi->num_ngb_force < NUM_OF_NEIGHBOURS) { if (vec_is_mask_true(v_doi_mask) & (1 << bit_index)) {
pi->ids_ngbs_force[pi->num_ngb_force] = parts_j[sort_j[pjd + bit_index].i].id; if(pi->num_ngb_force < NUM_OF_NEIGHBOURS) {
++pi->num_ngb_force; pi->ids_ngbs_force[pi->num_ngb_force] = parts_j[sort_j[pjd + bit_index].i].id;
++pi->num_ngb_force;
}
else ++pi->num_ngb_force;
} }
} }
#endif #endif
...@@ -1872,9 +1898,12 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci, ...@@ -1872,9 +1898,12 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci,
#ifdef DEBUG_INTERACTIONS_SPH #ifdef DEBUG_INTERACTIONS_SPH
for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) { for (int bit_index = 0; bit_index < VEC_SIZE; bit_index++) {
if ((vec_is_mask_true(v_doj_mask) & (1 << bit_index)) && pj->num_ngb_force < NUM_OF_NEIGHBOURS) { if (vec_is_mask_true(v_doj_mask) & (1 << bit_index)) {
pj->ids_ngbs_force[pj->num_ngb_force] = parts_i[sort_i[ci_cache_idx + first_pi + bit_index].i].id; if(pj->num_ngb_force < NUM_OF_NEIGHBOURS) {
++pj->num_ngb_force; 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;
}
else ++pj->num_ngb_force;
} }
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment