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

Additional concistency checks in the hydro and limiter loops

parent dea44f53
Branches
No related tags found
1 merge request!1353Draft: Subtask speedup - Still requires work
...@@ -1337,6 +1337,15 @@ void DOPAIR1_BRANCH(struct runner *r, struct cell *ci, struct cell *cj, ...@@ -1337,6 +1337,15 @@ void DOPAIR1_BRANCH(struct runner *r, struct cell *ci, struct cell *cj,
double shift[3] = {0.0, 0.0, 0.0}; double shift[3] = {0.0, 0.0, 0.0};
const int sid = space_getsid(e->s, &ci, &cj, shift); const int sid = space_getsid(e->s, &ci, &cj, shift);
/* Have the cells been sorted? */
if (!(ci->hydro.sorted & (1 << sid)) ||
ci->hydro.dx_max_sort_old > space_maxreldx * ci->dmin)
error("Interacting unsorted cells (ci).");
if (!(cj->hydro.sorted & (1 << sid)) ||
cj->hydro.dx_max_sort_old > space_maxreldx * cj->dmin)
error("Interacting unsorted cells (cj).");
#if defined(SWIFT_USE_NAIVE_INTERACTIONS) #if defined(SWIFT_USE_NAIVE_INTERACTIONS)
DOPAIR1_NAIVE(r, ci, cj, limit_min_h, limit_max_h); DOPAIR1_NAIVE(r, ci, cj, limit_min_h, limit_max_h);
#elif defined(WITH_VECTORIZATION) && defined(GADGET2_SPH) && \ #elif defined(WITH_VECTORIZATION) && defined(GADGET2_SPH) && \
...@@ -1927,6 +1936,15 @@ void DOPAIR2_BRANCH(struct runner *r, struct cell *ci, struct cell *cj, ...@@ -1927,6 +1936,15 @@ void DOPAIR2_BRANCH(struct runner *r, struct cell *ci, struct cell *cj,
double shift[3] = {0.0, 0.0, 0.0}; double shift[3] = {0.0, 0.0, 0.0};
const int sid = space_getsid(e->s, &ci, &cj, shift); const int sid = space_getsid(e->s, &ci, &cj, shift);
/* Have the cells been sorted? */
if (!(ci->hydro.sorted & (1 << sid)) ||
ci->hydro.dx_max_sort_old > space_maxreldx * ci->dmin)
error("Interacting unsorted cells (ci).");
if (!(cj->hydro.sorted & (1 << sid)) ||
cj->hydro.dx_max_sort_old > space_maxreldx * cj->dmin)
error("Interacting unsorted cells (cj).");
#ifdef SWIFT_USE_NAIVE_INTERACTIONS #ifdef SWIFT_USE_NAIVE_INTERACTIONS
DOPAIR2_NAIVE(r, ci, cj, limit_min_h, limit_max_h); DOPAIR2_NAIVE(r, ci, cj, limit_min_h, limit_max_h);
#elif defined(WITH_VECTORIZATION) && defined(GADGET2_SPH) && \ #elif defined(WITH_VECTORIZATION) && defined(GADGET2_SPH) && \
......
...@@ -516,6 +516,15 @@ void DOPAIR1_BRANCH(struct runner *r, struct cell *ci, struct cell *cj, ...@@ -516,6 +516,15 @@ void DOPAIR1_BRANCH(struct runner *r, struct cell *ci, struct cell *cj,
double shift[3] = {0.0, 0.0, 0.0}; double shift[3] = {0.0, 0.0, 0.0};
const int sid = space_getsid(e->s, &ci, &cj, shift); const int sid = space_getsid(e->s, &ci, &cj, shift);
/* Have the cells been sorted? */
if (!(ci->hydro.sorted & (1 << sid)) ||
ci->hydro.dx_max_sort_old > space_maxreldx * ci->dmin)
error("Interacting unsorted cells (ci).");
if (!(cj->hydro.sorted & (1 << sid)) ||
cj->hydro.dx_max_sort_old > space_maxreldx * cj->dmin)
error("Interacting unsorted cells (cj).");
#if defined(SWIFT_USE_NAIVE_INTERACTIONS) #if defined(SWIFT_USE_NAIVE_INTERACTIONS)
DOPAIR1_NAIVE(r, ci, cj, limit_min_h, limit_max_h); DOPAIR1_NAIVE(r, ci, cj, limit_min_h, limit_max_h);
#else #else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment