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

Comments. Moved debugging to SWIFT_DEBUG_CHECKS.

parent 0f532a4e
No related branches found
No related tags found
1 merge request!445Doself subset vec
......@@ -581,28 +581,30 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
#endif /* WITH_VECTORIZATION */
}
/**
* @brief Compute the interactions between a cell pair, but only for the
* given indices in ci. (Vectorised)
*
* @param r The #runner.
* @param c The first #cell.
* @param parts The #part to interact.
* @param ind The list of indices of particles in @c c to interact with.
* @param pi_count The number of particles in @c ind.
*/
__attribute__((always_inline)) INLINE void runner_doself_subset_density_vec(
struct runner *r, struct cell *restrict c, struct part *restrict parts, int *restrict ind, int pi_count) {
#ifdef WITH_VECTORIZATION
const struct engine *e = r->e;
struct part *restrict pi;
int count_align;
int num_vec_proc = NUM_VEC_PROC;
//struct part *restrict parts = c->parts;
const int count = c->count;
const timebin_t max_active_bin = e->max_active_bin;
vector v_hi, v_vix, v_viy, v_viz, v_hig2, v_r2;
TIMER_TIC
if (!cell_is_active(c, e)) return;
if (!cell_are_part_drifted(c, e)) error("Interacting undrifted cell.");
/* Get the particle cache from the runner and re-allocate
* the cache if it is not big enough for the cell. */
struct cache *restrict cell_cache = &r->ci_cache;
......@@ -618,7 +620,7 @@ __attribute__((always_inline)) INLINE void runner_doself_subset_density_vec(
struct c2_cache int_cache;
int icount = 0, icount_align = 0;
/* Loop over the particles in the cell. */
/* Loop over the subset of particles in the parts that need updating. */
for (int pid = 0; pid < pi_count; pid++) {
const int pi_index = ind[pid];
......@@ -626,23 +628,16 @@ __attribute__((always_inline)) INLINE void runner_doself_subset_density_vec(
/* Get a pointer to the ith particle. */
pi = &parts[pi_index];
/* Is the ith particle active? */
if (!part_is_active_no_debug(pi, max_active_bin)) continue;
#ifdef SWIFT_DEBUG_CHECKS
const struct engine *e = r->e;
if (!part_is_active(pi, e)) error("Inactive particle in subset function!");
#endif
vector pix, piy, piz;
//const float hi = cell_cache->h[pi_index];
const float hi = pi->h;
/* Fill particle pi vectors. */
//pix.v = vec_set1(cell_cache->x[pi_index]);
//piy.v = vec_set1(cell_cache->y[pi_index]);
//piz.v = vec_set1(cell_cache->z[pi_index]);
//v_hi.v = vec_set1(hi);
//v_vix.v = vec_set1(cell_cache->vx[pi_index]);
//v_viy.v = vec_set1(cell_cache->vy[pi_index]);
//v_viz.v = vec_set1(cell_cache->vz[pi_index]);
pix.v = vec_set1(pi->x[0] - c->loc[0]);
piy.v = vec_set1(pi->x[1] - c->loc[1]);
piz.v = vec_set1(pi->x[2] - c->loc[2]);
......@@ -803,7 +798,7 @@ __attribute__((always_inline)) INLINE void runner_doself_subset_density_vec(
icount = 0;
} /* loop over all particles. */
TIMER_TOC(timer_doself_density);
TIMER_TOC(timer_doself_subset);
#endif /* WITH_VECTORIZATION */
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment