Skip to content
Snippets Groups Projects
Commit 3068e6ad authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Make sure the xpart is never accessed in the feedback density loop

parent eca9f2e8
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,9 @@ void DOSELF1_STARS(struct runner *r, struct cell *c, int timer) {
const int count = c->hydro.count;
struct spart *restrict sparts = c->stars.parts;
struct part *restrict parts = c->hydro.parts;
#if (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
struct xpart *restrict xparts = c->hydro.xparts;
#endif
/* Loop over the sparts in ci. */
for (int sid = 0; sid < scount; sid++) {
......@@ -83,7 +85,9 @@ void DOSELF1_STARS(struct runner *r, struct cell *c, int timer) {
/* Get a pointer to the jth particle. */
struct part *restrict pj = &parts[pjd];
#if (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
struct xpart *restrict xpj = &xparts[pjd];
#endif
const float hj = pj->h;
/* Early abort? */
......@@ -105,7 +109,7 @@ void DOSELF1_STARS(struct runner *r, struct cell *c, int timer) {
if (r2 < hig2) {
IACT_STARS(r2, dx, hi, hj, si, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_feedback_density(r2, dx, hi, hj, si, pj, xpj, cosmo,
runner_iact_nonsym_feedback_density(r2, dx, hi, hj, si, pj, NULL, cosmo,
ti_current);
#elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, si, pj, xpj, cosmo,
......@@ -153,7 +157,9 @@ void DO_NONSYM_PAIR1_STARS_NAIVE(struct runner *r, struct cell *restrict ci,
const int count_j = cj->hydro.count;
struct spart *restrict sparts_i = ci->stars.parts;
struct part *restrict parts_j = cj->hydro.parts;
#if (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
struct xpart *restrict xparts_j = cj->hydro.xparts;
#endif
/* Get the relative distance between the pairs, wrapping. */
double shift[3] = {0.0, 0.0, 0.0};
......@@ -187,7 +193,9 @@ void DO_NONSYM_PAIR1_STARS_NAIVE(struct runner *r, struct cell *restrict ci,
/* Get a pointer to the jth particle. */
struct part *restrict pj = &parts_j[pjd];
#if (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
struct xpart *restrict xpj = &xparts_j[pjd];
#endif
const float hj = pj->h;
/* Skip inhibited particles. */
......@@ -210,7 +218,7 @@ void DO_NONSYM_PAIR1_STARS_NAIVE(struct runner *r, struct cell *restrict ci,
IACT_STARS(r2, dx, hi, hj, si, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_feedback_density(r2, dx, hi, hj, si, pj, xpj, cosmo,
runner_iact_nonsym_feedback_density(r2, dx, hi, hj, si, pj, NULL, cosmo,
ti_current);
#elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, si, pj, xpj, cosmo,
......@@ -286,7 +294,9 @@ void DO_SYM_PAIR1_STARS(struct runner *r, struct cell *ci, struct cell *cj,
const int count_j = cj->hydro.count;
struct spart *restrict sparts_i = ci->stars.parts;
struct part *restrict parts_j = cj->hydro.parts;
#if (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
struct xpart *restrict xparts_j = cj->hydro.xparts;
#endif
const double dj_min = sort_j[0].d;
const float dx_max_rshift =
(ci->stars.dx_max_sort + cj->hydro.dx_max_sort) - rshift;
......@@ -326,7 +336,9 @@ void DO_SYM_PAIR1_STARS(struct runner *r, struct cell *ci, struct cell *cj,
/* Recover pj */
struct part *pj = &parts_j[sort_j[pjd].i];
#if (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
struct xpart *xpj = &xparts_j[sort_j[pjd].i];
#endif
/* Skip inhibited particles. */
if (part_is_inhibited(pj, e)) continue;
......@@ -379,7 +391,7 @@ void DO_SYM_PAIR1_STARS(struct runner *r, struct cell *ci, struct cell *cj,
IACT_STARS(r2, dx, hi, hj, spi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, xpj,
runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, NULL,
cosmo, ti_current);
#elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, spi, pj, xpj, cosmo,
......@@ -574,7 +586,9 @@ void DOPAIR1_SUBSET_STARS(struct runner *r, struct cell *restrict ci,
const int count_j = cj->hydro.count;
struct part *restrict parts_j = cj->hydro.parts;
#if (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
struct xpart *restrict xparts_j = cj->hydro.xparts;
#endif
/* Early abort? */
if (count_j == 0) return;
......@@ -604,7 +618,9 @@ void DOPAIR1_SUBSET_STARS(struct runner *r, struct cell *restrict ci,
/* Get a pointer to the jth particle. */
struct part *restrict pj = &parts_j[sort_j[pjd].i];
#if (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
struct xpart *restrict xpj = &xparts_j[sort_j[pjd].i];
#endif
/* Skip inhibited particles. */
if (part_is_inhibited(pj, e)) continue;
......@@ -632,7 +648,7 @@ void DOPAIR1_SUBSET_STARS(struct runner *r, struct cell *restrict ci,
IACT_STARS(r2, dx, hi, hj, spi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, xpj,
runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, NULL,
cosmo, ti_current);
#elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, spi, pj, xpj, cosmo,
......@@ -664,7 +680,9 @@ void DOPAIR1_SUBSET_STARS(struct runner *r, struct cell *restrict ci,
/* Get a pointer to the jth particle. */
struct part *restrict pj = &parts_j[sort_j[pjd].i];
#if (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
struct xpart *restrict xpj = &xparts_j[sort_j[pjd].i];
#endif
/* Skip inhibited particles. */
if (part_is_inhibited(pj, e)) continue;
......@@ -692,7 +710,7 @@ void DOPAIR1_SUBSET_STARS(struct runner *r, struct cell *restrict ci,
IACT_STARS(r2, dx, hi, hj, spi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, xpj,
runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, NULL,
cosmo, ti_current);
#elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, spi, pj, xpj, cosmo,
......@@ -737,7 +755,9 @@ void DOPAIR1_SUBSET_STARS_NAIVE(struct runner *r, struct cell *restrict ci,
const int count_j = cj->hydro.count;
struct part *restrict parts_j = cj->hydro.parts;
#if (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
struct xpart *restrict xparts_j = cj->hydro.xparts;
#endif
/* Early abort? */
if (count_j == 0) return;
......@@ -764,7 +784,9 @@ void DOPAIR1_SUBSET_STARS_NAIVE(struct runner *r, struct cell *restrict ci,
/* Get a pointer to the jth particle. */
struct part *restrict pj = &parts_j[pjd];
#if (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
struct xpart *restrict xpj = &xparts_j[pjd];
#endif
/* Skip inhibited particles */
if (part_is_inhibited(pj, e)) continue;
......@@ -789,8 +811,8 @@ void DOPAIR1_SUBSET_STARS_NAIVE(struct runner *r, struct cell *restrict ci,
IACT_STARS(r2, dx, hi, hj, spi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, xpj, cosmo,
ti_current);
runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, NULL,
cosmo, ti_current);
#elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, spi, pj, xpj, cosmo,
ti_current);
......@@ -828,7 +850,9 @@ void DOSELF1_SUBSET_STARS(struct runner *r, struct cell *restrict ci,
const int count_i = ci->hydro.count;
struct part *restrict parts_j = ci->hydro.parts;
#if (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
struct xpart *restrict xparts_j = ci->hydro.xparts;
#endif
/* Early abort? */
if (count_i == 0) return;
......@@ -854,7 +878,9 @@ void DOSELF1_SUBSET_STARS(struct runner *r, struct cell *restrict ci,
/* Get a pointer to the jth particle. */
struct part *restrict pj = &parts_j[pjd];
#if (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
struct xpart *restrict xpj = &xparts_j[pjd];
#endif
/* Early abort? */
if (part_is_inhibited(pj, e)) continue;
......@@ -876,7 +902,7 @@ void DOSELF1_SUBSET_STARS(struct runner *r, struct cell *restrict ci,
if (r2 < hig2) {
IACT_STARS(r2, dx, hi, pj->h, spi, pj, a, H);
#if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY)
runner_iact_nonsym_feedback_density(r2, dx, hi, pj->h, spi, pj, xpj,
runner_iact_nonsym_feedback_density(r2, dx, hi, pj->h, spi, pj, NULL,
cosmo, ti_current);
#elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK)
runner_iact_nonsym_feedback_apply(r2, dx, hi, pj->h, spi, pj, xpj,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment