Commit e828d7bc authored by James Willis's avatar James Willis
Browse files

Bug inside debug checks.

parent 3d0eb1c0
......@@ -273,7 +273,8 @@ __attribute__((always_inline)) INLINE static void populate_max_index_no_cache(
while (first_pi > 0 && sort_i[first_pi - 1].d + dx_max + hi_max > dj_min) {
first_pi--;
/* Store the index of the particle if it is active. */
if (part_is_active_no_debug(&parts_i[sort_i[first_pi].i], max_active_bin)) active_id = first_pi;
if (part_is_active_no_debug(&parts_i[sort_i[first_pi].i], max_active_bin))
active_id = first_pi;
}
/* Set the first active pi in range of any particle in cell j. */
......@@ -320,7 +321,8 @@ __attribute__((always_inline)) INLINE static void populate_max_index_no_cache(
sort_j[last_pj + 1].d - hj_max - dx_max < di_max) {
last_pj++;
/* Store the index of the particle if it is active. */
if (part_is_active_no_debug(&parts_j[sort_j[last_pj].i], max_active_bin)) active_id = last_pj;
if (part_is_active_no_debug(&parts_j[sort_j[last_pj].i], max_active_bin))
active_id = last_pj;
}
/* Set the last active pj in range of any particle in cell i. */
......@@ -610,7 +612,7 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
vector v_hi, v_vix, v_viy, v_viz, v_hig2, v_r2;
vector v_rhoi, v_grad_hi, v_pOrhoi2, v_balsara_i, v_ci;
TIMER_TIC
TIMER_TIC;
if (!cell_is_active(c, e)) return;
......@@ -634,11 +636,10 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
if (pi->ti_drift != e->ti_current)
error("Particle pi not drifted to current time");
}
}
#endif
/* Loop over the particles in the cell. */
for (int pid = 0; pid < count; pid++) {
/* Loop over the particles in the cell. */
for (int pid = 0; pid < count; pid++) {
/* Get a pointer to the ith particle. */
pi = &parts[pid];
......@@ -747,7 +748,8 @@ for (int pid = 0; pid < count; pid++) {
vector v_hj_inv;
v_hj_inv = vec_reciprocal(hj);
/* To stop floating point exceptions for when particle separations are 0.
/* To stop floating point exceptions for when particle separations are
* 0.
*/
v_r2.v = vec_add(v_r2.v, vec_set1(FLT_MIN));
......@@ -757,8 +759,9 @@ for (int pid = 0; pid < count; pid++) {
&cell_cache->vy[pjd], &cell_cache->vz[pjd], &cell_cache->rho[pjd],
&cell_cache->grad_h[pjd], &cell_cache->pOrho2[pjd],
&cell_cache->balsara[pjd], &cell_cache->soundspeed[pjd],
&cell_cache->m[pjd], v_hi_inv, v_hj_inv, &a_hydro_xSum, &a_hydro_ySum,
&a_hydro_zSum, &h_dtSum, &v_sigSum, &entropy_dtSum, v_doi_mask);
&cell_cache->m[pjd], v_hi_inv, v_hj_inv, &a_hydro_xSum,
&a_hydro_ySum, &a_hydro_zSum, &h_dtSum, &v_sigSum, &entropy_dtSum,
v_doi_mask);
}
} /* Loop over all other particles. */
......@@ -770,9 +773,9 @@ for (int pid = 0; pid < count; pid++) {
VEC_HMAX(v_sigSum, pi->force.v_sig);
VEC_HADD(entropy_dtSum, pi->entropy_dt);
} /* loop over all particles. */
} /* loop over all particles. */
TIMER_TOC(timer_doself_force);
TIMER_TOC(timer_doself_force);
#endif /* WITH_VECTORIZATION */
}
......
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