Commit c6e29dd8 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Separate the time-step information for hydro and gravity tasks into two...

Separate the time-step information for hydro and gravity tasks into two different set of variables for each cell.
parent 5048bd16
......@@ -82,19 +82,19 @@ __attribute__((always_inline)) INLINE static int cell_are_gpart_drifted(
* @param e The #engine containing information about the current time.
* @return 1 if the #cell contains at least an active particle, 0 otherwise.
*/
__attribute__((always_inline)) INLINE static int cell_is_active(
__attribute__((always_inline)) INLINE static int cell_is_active_hydro(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_end_min < e->ti_current)
if (c->ti_hydro_end_min < e->ti_current)
error(
"cell in an impossible time-zone! c->ti_end_min=%lld (t=%e) and "
"e->ti_current=%lld (t=%e)",
c->ti_end_min, c->ti_end_min * e->timeBase, e->ti_current,
c->ti_hydro_end_min, c->ti_hydro_end_min * e->timeBase, e->ti_current,
e->ti_current * e->timeBase);
#endif
return (c->ti_end_min == e->ti_current);
return (c->ti_hydro_end_min == e->ti_current);
}
/**
......@@ -104,18 +104,61 @@ __attribute__((always_inline)) INLINE static int cell_is_active(
* @param e The #engine containing information about the current time.
* @return 1 if all particles in a #cell are active, 0 otherwise.
*/
__attribute__((always_inline)) INLINE static int cell_is_all_active(
__attribute__((always_inline)) INLINE static int cell_is_all_active_hydro(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_end_max < e->ti_current)
if (c->ti_hydro_end_max < e->ti_current)
error(
"cell in an impossible time-zone! c->ti_end_max=%lld "
"e->ti_current=%lld",
c->ti_end_max, e->ti_current);
c->ti_hydro_end_max, e->ti_current);
#endif
return (c->ti_end_max == e->ti_current);
return (c->ti_hydro_end_max == e->ti_current);
}
/**
* @brief Does a cell contain any g-particle finishing their time-step now ?
*
* @param c The #cell.
* @param e The #engine containing information about the current time.
* @return 1 if the #cell contains at least an active particle, 0 otherwise.
*/
__attribute__((always_inline)) INLINE static int cell_is_active_gravity(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_gravity_end_min < e->ti_current)
error(
"cell in an impossible time-zone! c->ti_end_min=%lld (t=%e) and "
"e->ti_current=%lld (t=%e)",
c->ti_gravity_end_min, c->ti_gravity_end_min * e->timeBase,
e->ti_current, e->ti_current * e->timeBase);
#endif
return (c->ti_gravity_end_min == e->ti_current);
}
/**
* @brief Are *all* g-particles in a cell finishing their time-step now ?
*
* @param c The #cell.
* @param e The #engine containing information about the current time.
* @return 1 if all particles in a #cell are active, 0 otherwise.
*/
__attribute__((always_inline)) INLINE static int cell_is_all_active_gravity(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_gravity_end_max < e->ti_current)
error(
"cell in an impossible time-zone! c->ti_end_max=%lld "
"e->ti_current=%lld",
c->ti_gravity_end_max, e->ti_current);
#endif
return (c->ti_gravity_end_max == e->ti_current);
}
/**
......@@ -215,19 +258,41 @@ __attribute__((always_inline)) INLINE static int spart_is_active(
* @param e The #engine containing information about the current time.
* @return 1 if the #cell contains at least an active particle, 0 otherwise.
*/
__attribute__((always_inline)) INLINE static int cell_is_starting(
__attribute__((always_inline)) INLINE static int cell_is_starting_hydro(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_beg_max > e->ti_current)
if (c->ti_hydro_beg_max > e->ti_current)
error(
"cell in an impossible time-zone! c->ti_beg_max=%lld (t=%e) and "
"e->ti_current=%lld (t=%e)",
c->ti_beg_max, c->ti_beg_max * e->timeBase, e->ti_current,
c->ti_hydro_beg_max, c->ti_hydro_beg_max * e->timeBase, e->ti_current,
e->ti_current * e->timeBase);
#endif
return (c->ti_beg_max == e->ti_current);
return (c->ti_hydro_beg_max == e->ti_current);
}
/**
* @brief Does a cell contain any g-particle starting their time-step now ?
*
* @param c The #cell.
* @param e The #engine containing information about the current time.
* @return 1 if the #cell contains at least an active particle, 0 otherwise.
*/
__attribute__((always_inline)) INLINE static int cell_is_starting_gravity(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_gravity_beg_max > e->ti_current)
error(
"cell in an impossible time-zone! c->ti_beg_max=%lld (t=%e) and "
"e->ti_current=%lld (t=%e)",
c->ti_gravity_beg_max, c->ti_gravity_beg_max * e->timeBase,
e->ti_current, e->ti_current * e->timeBase);
#endif
return (c->ti_gravity_beg_max == e->ti_current);
}
/**
......
This diff is collapsed.
......@@ -80,14 +80,23 @@ struct pcell {
/*! Maximal smoothing length. */
double h_max;
/*! Minimal integer end-of-timestep in this cell */
integertime_t ti_end_min;
/*! Minimal integer end-of-timestep in this cell for hydro tasks */
integertime_t ti_hydro_end_min;
/*! Maximal integer end-of-timestep in this cell */
integertime_t ti_end_max;
/*! Maximal integer end-of-timestep in this cell for hydro tasks */
integertime_t ti_hydro_end_max;
/*! Maximal integer beginning-of-timestep in this cell */
integertime_t ti_beg_max;
/*! Maximal integer beginning-of-timestep in this cell for hydro tasks */
integertime_t ti_hydro_beg_max;
/*! Minimal integer end-of-timestep in this cell for gravity tasks */
integertime_t ti_gravity_end_min;
/*! Maximal integer end-of-timestep in this cell for gravity tasks */
integertime_t ti_gravity_end_max;
/*! Maximal integer beginning-of-timestep in this cell for gravity tasks */
integertime_t ti_gravity_beg_max;
/*! Integer time of the last drift of the #part in this cell */
integertime_t ti_old_part;
......@@ -125,8 +134,11 @@ struct pcell {
*/
struct pcell_step {
/*! Minimal integer end-of-timestep in this cell */
integertime_t ti_end_min;
/*! Minimal integer end-of-timestep in this cell (hydro) */
integertime_t ti_hydro_end_min;
/*! Minimal integer end-of-timestep in this cell (gravity) */
integertime_t ti_gravity_end_min;
/*! Maximal distance any #part has travelled since last rebuild */
float dx_max_part;
......@@ -295,14 +307,24 @@ struct cell {
#endif
/*! Minimum end of (integer) time step in this cell. */
integertime_t ti_end_min;
/*! Minimum end of (integer) time step in this cell for hydro tasks. */
integertime_t ti_hydro_end_min;
/*! Maximum end of (integer) time step in this cell. */
integertime_t ti_end_max;
/*! Maximum end of (integer) time step in this cell for hydro tasks. */
integertime_t ti_hydro_end_max;
/*! Maximum beginning of (integer) time step in this cell. */
integertime_t ti_beg_max;
/*! Maximum beginning of (integer) time step in this cell for hydro tasks. */
integertime_t ti_hydro_beg_max;
/*! Minimum end of (integer) time step in this cell for gravity tasks. */
integertime_t ti_gravity_end_min;
/*! Maximum end of (integer) time step in this cell for gravity tasks. */
integertime_t ti_gravity_end_max;
/*! Maximum beginning of (integer) time step in this cell for gravity tasks.
*/
integertime_t ti_gravity_beg_max;
/*! Last (integer) time the cell's part were drifted forward in time. */
integertime_t ti_old_part;
......@@ -470,7 +492,8 @@ void cell_check_part_drift_point(struct cell *c, void *data);
void cell_check_gpart_drift_point(struct cell *c, void *data);
void cell_check_multipole_drift_point(struct cell *c, void *data);
void cell_reset_task_counters(struct cell *c);
int cell_unskip_tasks(struct cell *c, struct scheduler *s);
int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s);
int cell_unskip_gravity_tasks(struct cell *c, struct scheduler *s);
void cell_set_super(struct cell *c, struct cell *super);
void cell_drift_part(struct cell *c, const struct engine *e, int force);
void cell_drift_gpart(struct cell *c, const struct engine *e, int force);
......@@ -478,8 +501,8 @@ void cell_drift_multipole(struct cell *c, const struct engine *e);
void cell_drift_all_multipoles(struct cell *c, const struct engine *e);
void cell_check_timesteps(struct cell *c);
void cell_store_pre_drift_values(struct cell *c);
void cell_activate_subcell_tasks(struct cell *ci, struct cell *cj,
struct scheduler *s);
void cell_activate_subcell_hydro_tasks(struct cell *ci, struct cell *cj,
struct scheduler *s);
void cell_activate_subcell_grav_tasks(struct cell *ci, struct cell *cj,
struct scheduler *s);
void cell_activate_subcell_external_grav_tasks(struct cell *ci,
......
......@@ -37,7 +37,8 @@
/* Local collections for MPI reduces. */
struct mpicollectgroup1 {
size_t updates, g_updates, s_updates;
integertime_t ti_end_min;
integertime_t ti_hydro_end_min;
integertime_t ti_gravity_end_min;
int forcerebuild;
};
......@@ -75,9 +76,15 @@ void collectgroup_init() {
* @param e The #engine
*/
void collectgroup1_apply(struct collectgroup1 *grp1, struct engine *e) {
e->ti_end_min = grp1->ti_end_min;
e->ti_end_max = grp1->ti_end_max;
e->ti_beg_max = grp1->ti_beg_max;
e->ti_hydro_end_min = grp1->ti_hydro_end_min;
e->ti_hydro_end_max = grp1->ti_hydro_end_max;
e->ti_hydro_beg_max = grp1->ti_hydro_beg_max;
e->ti_gravity_end_min = grp1->ti_gravity_end_min;
e->ti_gravity_end_max = grp1->ti_gravity_end_max;
e->ti_gravity_beg_max = grp1->ti_gravity_beg_max;
e->ti_end_min = min(e->ti_hydro_end_min, e->ti_gravity_end_min);
e->ti_end_max = max(e->ti_hydro_end_max, e->ti_gravity_end_max);
e->ti_beg_max = max(e->ti_hydro_beg_max, e->ti_gravity_beg_max);
e->updates = grp1->updates;
e->g_updates = grp1->g_updates;
e->s_updates = grp1->s_updates;
......@@ -99,14 +106,21 @@ void collectgroup1_apply(struct collectgroup1 *grp1, struct engine *e) {
*/
void collectgroup1_init(struct collectgroup1 *grp1, size_t updates,
size_t g_updates, size_t s_updates,
integertime_t ti_end_min, integertime_t ti_end_max,
integertime_t ti_beg_max, int forcerebuild) {
integertime_t ti_hydro_end_min,
integertime_t ti_hydro_end_max,
integertime_t ti_hydro_beg_max,
integertime_t ti_gravity_end_min,
integertime_t ti_gravity_end_max,
integertime_t ti_gravity_beg_max, int forcerebuild) {
grp1->updates = updates;
grp1->g_updates = g_updates;
grp1->s_updates = s_updates;
grp1->ti_end_min = ti_end_min;
grp1->ti_end_max = ti_end_max;
grp1->ti_beg_max = ti_beg_max;
grp1->ti_hydro_end_min = ti_hydro_end_min;
grp1->ti_hydro_end_max = ti_hydro_end_max;
grp1->ti_hydro_beg_max = ti_hydro_beg_max;
grp1->ti_gravity_end_min = ti_gravity_end_min;
grp1->ti_gravity_end_max = ti_gravity_end_max;
grp1->ti_gravity_beg_max = ti_gravity_beg_max;
grp1->forcerebuild = forcerebuild;
}
......@@ -127,7 +141,8 @@ void collectgroup1_reduce(struct collectgroup1 *grp1) {
mpigrp11.updates = grp1->updates;
mpigrp11.g_updates = grp1->g_updates;
mpigrp11.s_updates = grp1->s_updates;
mpigrp11.ti_end_min = grp1->ti_end_min;
mpigrp11.ti_hydro_end_min = grp1->ti_hydro_end_min;
mpigrp11.ti_gravity_end_min = grp1->ti_gravity_end_min;
mpigrp11.forcerebuild = grp1->forcerebuild;
struct mpicollectgroup1 mpigrp12;
......@@ -139,7 +154,8 @@ void collectgroup1_reduce(struct collectgroup1 *grp1) {
grp1->updates = mpigrp12.updates;
grp1->g_updates = mpigrp12.g_updates;
grp1->s_updates = mpigrp12.s_updates;
grp1->ti_end_min = mpigrp12.ti_end_min;
grp1->ti_hydro_end_min = mpigrp12.ti_hydro_end_min;
grp1->ti_gravity_end_min = mpigrp12.ti_gravity_end_min;
grp1->forcerebuild = mpigrp12.forcerebuild;
#endif
......@@ -162,7 +178,10 @@ static void doreduce1(struct mpicollectgroup1 *mpigrp11,
mpigrp11->s_updates += mpigrp12->s_updates;
/* Minimum end time. */
mpigrp11->ti_end_min = min(mpigrp11->ti_end_min, mpigrp12->ti_end_min);
mpigrp11->ti_hydro_end_min =
min(mpigrp11->ti_hydro_end_min, mpigrp12->ti_hydro_end_min);
mpigrp11->ti_gravity_end_min =
min(mpigrp11->ti_gravity_end_min, mpigrp12->ti_gravity_end_min);
/* Everyone must agree to not rebuild. */
if (mpigrp11->forcerebuild || mpigrp12->forcerebuild)
......
......@@ -38,7 +38,8 @@ struct collectgroup1 {
size_t updates, g_updates, s_updates;
/* Times for the time-step */
integertime_t ti_end_min, ti_end_max, ti_beg_max;
integertime_t ti_hydro_end_min, ti_hydro_end_max, ti_hydro_beg_max;
integertime_t ti_gravity_end_min, ti_gravity_end_max, ti_gravity_beg_max;
/* Force the engine to rebuild? */
int forcerebuild;
......@@ -48,8 +49,12 @@ void collectgroup_init();
void collectgroup1_apply(struct collectgroup1 *grp1, struct engine *e);
void collectgroup1_init(struct collectgroup1 *grp1, size_t updates,
size_t g_updates, size_t s_updates,
integertime_t ti_end_min, integertime_t ti_end_max,
integertime_t ti_beg_max, int forcerebuild);
integertime_t ti_hydro_end_min,
integertime_t ti_hydro_end_max,
integertime_t ti_hydro_beg_max,
integertime_t ti_gravity_end_min,
integertime_t ti_gravity_end_max,
integertime_t ti_gravity_beg_max, int forcerebuild);
void collectgroup1_reduce(struct collectgroup1 *grp1);
#endif /* SWIFT_COLLECTGROUP_H */
......@@ -319,7 +319,7 @@ static void dumpCells_map(struct cell *c, void *data) {
/* Active cells, otherwise all. */
if (active)
active = cell_is_active(c, e);
active = cell_is_active_hydro(c, e);
else
active = 1;
......@@ -346,9 +346,9 @@ static void dumpCells_map(struct cell *c, void *data) {
"%6.1f %20lld %6d %6d %6d %6d %6d\n",
c->loc[0], c->loc[1], c->loc[2], c->width[0], c->width[1],
c->width[2], e->step, c->count, c->gcount, c->scount, pactcount,
c->depth, ntasks, c->ti_end_min, get_time_bin(c->ti_end_min),
(c->super == c), cell_is_active(c, e), c->nodeID,
c->nodeID == e->nodeID);
c->depth, ntasks, c->ti_hydro_end_min,
get_time_bin(c->ti_hydro_end_min), (c->super == c),
cell_is_active_hydro(c, e), c->nodeID, c->nodeID == e->nodeID);
}
}
}
......
This diff is collapsed.
......@@ -147,13 +147,31 @@ struct engine {
double timeBase;
double timeBase_inv;
/* Minimal ti_end for the next time-step */
/* Minimal hydro ti_end for the next time-step */
integertime_t ti_hydro_end_min;
/* Maximal hydro ti_end for the next time-step */
integertime_t ti_hydro_end_max;
/* Maximal hydro ti_beg for the next time-step */
integertime_t ti_hydro_beg_max;
/* Minimal gravity ti_end for the next time-step */
integertime_t ti_gravity_end_min;
/* Maximal gravity ti_end for the next time-step */
integertime_t ti_gravity_end_max;
/* Maximal gravity ti_beg for the next time-step */
integertime_t ti_gravity_beg_max;
/* Minimal overall ti_end for the next time-step */
integertime_t ti_end_min;
/* Maximal ti_end for the next time-step */
/* Maximal overall ti_end for the next time-step */
integertime_t ti_end_max;
/* Maximal ti_beg for the next time-step */
/* Maximal overall ti_beg for the next time-step */
integertime_t ti_beg_max;
/* Number of particles updated in the previous step */
......
This diff is collapsed.
......@@ -130,7 +130,7 @@ void DOPAIR1_NAIVE(struct runner *r, struct cell *restrict ci,
TIMER_TIC;
/* Anything to do here? */
if (!cell_is_active(ci, e) && !cell_is_active(cj, e)) return;
if (!cell_is_active_hydro(ci, e) && !cell_is_active_hydro(cj, e)) return;
const int count_i = ci->count;
const int count_j = cj->count;
......@@ -218,7 +218,7 @@ void DOPAIR2_NAIVE(struct runner *r, struct cell *restrict ci,
TIMER_TIC;
/* Anything to do here? */
if (!cell_is_active(ci, e) && !cell_is_active(cj, e)) return;
if (!cell_is_active_hydro(ci, e) && !cell_is_active_hydro(cj, e)) return;
const int count_i = ci->count;
const int count_j = cj->count;
......@@ -308,7 +308,7 @@ void DOSELF1_NAIVE(struct runner *r, struct cell *restrict c) {
TIMER_TIC;
/* Anything to do here? */
if (!cell_is_active(c, e)) return;
if (!cell_is_active_hydro(c, e)) return;
const int count = c->count;
struct part *restrict parts = c->parts;
......@@ -386,7 +386,7 @@ void DOSELF2_NAIVE(struct runner *r, struct cell *restrict c) {
TIMER_TIC;
/* Anything to do here? */
if (!cell_is_active(c, e)) return;
if (!cell_is_active_hydro(c, e)) return;
const int count = c->count;
struct part *restrict parts = c->parts;
......@@ -801,7 +801,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
const double dj_min = sort_j[0].d;
const float dx_max = (ci->dx_max_sort + cj->dx_max_sort);
if (cell_is_active(ci, e)) {
if (cell_is_active_hydro(ci, e)) {
/* Loop over the parts in ci. */
for (int pid = count_i - 1;
......@@ -881,7 +881,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
} /* loop over the parts in ci. */
} /* Cell ci is active */
if (cell_is_active(cj, e)) {
if (cell_is_active_hydro(cj, e)) {
/* Loop over the parts in cj. */
for (int pjd = 0; pjd < count_j && sort_j[pjd].d - hj_max - dx_max < di_max;
......@@ -978,7 +978,7 @@ void DOPAIR1_BRANCH(struct runner *r, struct cell *ci, struct cell *cj) {
const struct engine *restrict e = r->e;
/* Anything to do here? */
if (!cell_is_active(ci, e) && !cell_is_active(cj, e)) return;
if (!cell_is_active_hydro(ci, e) && !cell_is_active_hydro(cj, e)) return;
/* Check that cells are drifted. */
if (!cell_are_part_drifted(ci, e) || !cell_are_part_drifted(cj, e))
......@@ -1106,11 +1106,11 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
int count_active_i = 0, count_active_j = 0;
struct entry *restrict sort_active_i = NULL, *restrict sort_active_j = NULL;
if (cell_is_all_active(ci, e)) {
if (cell_is_all_active_hydro(ci, e)) {
/* If everybody is active don't bother copying */
sort_active_i = sort_i;
count_active_i = count_i;
} else if (cell_is_active(ci, e)) {
} else if (cell_is_active_hydro(ci, e)) {
if (posix_memalign((void *)&sort_active_i, SWIFT_CACHE_ALIGNMENT,
sizeof(struct entry) * count_i) != 0)
error("Failed to allocate active sortlists.");
......@@ -1124,11 +1124,11 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
}
}
if (cell_is_all_active(cj, e)) {
if (cell_is_all_active_hydro(cj, e)) {
/* If everybody is active don't bother copying */
sort_active_j = sort_j;
count_active_j = count_j;
} else if (cell_is_active(cj, e)) {
} else if (cell_is_active_hydro(cj, e)) {
if (posix_memalign((void *)&sort_active_j, SWIFT_CACHE_ALIGNMENT,
sizeof(struct entry) * count_j) != 0)
error("Failed to allocate active sortlists.");
......@@ -1445,8 +1445,10 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
} /* Loop over all cj */
/* Clean-up if necessary */
if (cell_is_active(ci, e) && !cell_is_all_active(ci, e)) free(sort_active_i);
if (cell_is_active(cj, e) && !cell_is_all_active(cj, e)) free(sort_active_j);
if (cell_is_active_hydro(ci, e) && !cell_is_all_active_hydro(ci, e))
free(sort_active_i);
if (cell_is_active_hydro(cj, e) && !cell_is_all_active_hydro(cj, e))
free(sort_active_j);
TIMER_TOC(TIMER_DOPAIR);
}
......@@ -1465,7 +1467,7 @@ void DOPAIR2_BRANCH(struct runner *r, struct cell *ci, struct cell *cj) {
const struct engine *restrict e = r->e;
/* Anything to do here? */
if (!cell_is_active(ci, e) && !cell_is_active(cj, e)) return;
if (!cell_is_active_hydro(ci, e) && !cell_is_active_hydro(cj, e)) return;
/* Check that cells are drifted. */
if (!cell_are_part_drifted(ci, e) || !cell_are_part_drifted(cj, e))
......@@ -1548,7 +1550,7 @@ void DOSELF1(struct runner *r, struct cell *restrict c) {
TIMER_TIC;
if (!cell_is_active(c, e)) return;
if (!cell_is_active_hydro(c, e)) return;
if (!cell_are_part_drifted(c, e)) error("Interacting undrifted cell.");
......@@ -1685,7 +1687,7 @@ void DOSELF2(struct runner *r, struct cell *restrict c) {
TIMER_TIC;
if (!cell_is_active(c, e)) return;
if (!cell_is_active_hydro(c, e)) return;
if (!cell_are_part_drifted(c, e)) error("Cell is not drifted");
struct part *restrict parts = c->parts;
......@@ -1817,7 +1819,7 @@ void DOSUB_PAIR1(struct runner *r, struct cell *ci, struct cell *cj, int sid,
TIMER_TIC;
/* Should we even bother? */
if (!cell_is_active(ci, e) && !cell_is_active(cj, e)) return;
if (!cell_is_active_hydro(ci, e) && !cell_is_active_hydro(cj, e)) return;
if (ci->count == 0 || cj->count == 0) return;
/* Get the type of pair if not specified explicitly. */
......@@ -2026,7 +2028,7 @@ void DOSUB_PAIR1(struct runner *r, struct cell *ci, struct cell *cj, int sid,
}
/* Otherwise, compute the pair directly. */
else if (cell_is_active(ci, e) || cell_is_active(cj, e)) {
else if (cell_is_active_hydro(ci, e) || cell_is_active_hydro(cj, e)) {
/* Make sure both cells are drifted to the current timestep. */
if (!cell_are_part_drifted(ci, e) || !cell_are_part_drifted(cj, e))
......@@ -2059,7 +2061,7 @@ void DOSUB_SELF1(struct runner *r, struct cell *ci, int gettimer) {
TIMER_TIC;
/* Should we even bother? */
if (ci->count == 0 || !cell_is_active(ci, r->e)) return;
if (ci->count == 0 || !cell_is_active_hydro(ci, r->e)) return;
/* Recurse? */
if (cell_can_recurse_in_self_task(ci)) {
......@@ -2112,7 +2114,7 @@ void DOSUB_PAIR2(struct runner *r, struct cell *ci, struct cell *cj, int sid,
TIMER_TIC;
/* Should we even bother? */
if (!cell_is_active(ci, e) && !cell_is_active(cj, e)) return;
if (!cell_is_active_hydro(ci, e) && !cell_is_active_hydro(cj, e)) return;
if (ci->count == 0 || cj->count == 0) return;
/* Get the type of pair if not specified explicitly. */
......@@ -2321,7 +2323,7 @@ void DOSUB_PAIR2(struct runner *r, struct cell *ci, struct cell *cj, int sid,
}
/* Otherwise, compute the pair directly. */
else if (cell_is_active(ci, e) || cell_is_active(cj, e)) {
else if (cell_is_active_hydro(ci, e) || cell_is_active_hydro(cj, e)) {
/* Make sure both cells are drifted to the current timestep. */
if (!cell_are_part_drifted(ci, e) || !cell_are_part_drifted(cj, e))
......@@ -2354,7 +2356,7 @@ void DOSUB_SELF2(struct runner *r, struct cell *ci, int gettimer) {
TIMER_TIC;
/* Should we even bother? */
if (ci->count == 0 || !cell_is_active(ci, r->e)) return;
if (ci->count == 0 || !cell_is_active_hydro(ci, r->e)) return;
/* Recurse? */
if (cell_can_recurse_in_self_task(ci)) {
......@@ -2391,7 +2393,9 @@ void DOSUB_SUBSET(struct runner *r, struct cell *ci, struct part *parts,
TIMER_TIC;
/* Should we even bother? */
if (!cell_is_active(ci, e) && (cj == NULL || !cell_is_active(cj, e))) return;
if (!cell_is_active_hydro(ci, e) &&
(cj == NULL || !cell_is_active_hydro(cj, e)))
return;
if (ci->count == 0 || (cj != NULL && cj->count == 0)) return;
/* Find out in which sub-cell of ci the parts are. */
......@@ -2945,7 +2949,7 @@ void DOSUB_SUBSET(struct runner *r, struct cell *ci, struct part *parts,
}
/* Otherwise, compute the pair directly. */
else if (cell_is_active(ci, e) || cell_is_active(cj, e)) {
else if (cell_is_active_hydro(ci, e) || cell_is_active_hydro(cj, e)) {
/* Do any of the cells need to be drifted first? */
if (!cell_are_part_drifted(cj, e)) error("Cell should be drifted!");
......
......@@ -58,7 +58,7 @@ void runner_do_grav_down(struct runner *r, struct cell *c, int timer) {
struct cell *cp = c->progeny[k];
/* Do we have a progenitor with any active g-particles ? */
if (cp != NULL && cell_is_active(cp, e)) {
if (cp != NULL && cell_is_active_gravity(cp, e)) {
#ifdef SWIFT_DEBUG_CHECKS
if (cp->ti_old_multipole != e->ti_current)
......@@ -140,7 +140,7 @@ void runner_dopair_grav_mm(const struct runner *r, struct cell *restrict ci,
TIMER_TIC;
/* Anything to do here? */
if (!cell_is_active(ci, e) || ci->nodeID != engine_rank) return;
if (!cell_is_active_gravity(ci, e) || ci->nodeID != engine_rank) return;
/* Short-cut to the multipole */
const struct multipole *multi_j = &cj->multipole->m_pole;
......@@ -436,7 +436,7 @@ void runner_dopair_grav_pp(struct runner *r, struct cell *ci, struct cell *cj) {
TIMER_TIC;
/* Anything to do here? */