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( ...@@ -82,19 +82,19 @@ __attribute__((always_inline)) INLINE static int cell_are_gpart_drifted(
* @param e The #engine containing information about the current time. * @param e The #engine containing information about the current time.
* @return 1 if the #cell contains at least an active particle, 0 otherwise. * @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) { const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
if (c->ti_end_min < e->ti_current) if (c->ti_hydro_end_min < e->ti_current)
error( error(
"cell in an impossible time-zone! c->ti_end_min=%lld (t=%e) and " "cell in an impossible time-zone! c->ti_end_min=%lld (t=%e) and "
"e->ti_current=%lld (t=%e)", "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); e->ti_current * e->timeBase);
#endif #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( ...@@ -104,18 +104,61 @@ __attribute__((always_inline)) INLINE static int cell_is_active(
* @param e The #engine containing information about the current time. * @param e The #engine containing information about the current time.
* @return 1 if all particles in a #cell are active, 0 otherwise. * @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) { const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
if (c->ti_end_max < e->ti_current) if (c->ti_hydro_end_max < e->ti_current)
error( error(
"cell in an impossible time-zone! c->ti_end_max=%lld " "cell in an impossible time-zone! c->ti_end_max=%lld "
"e->ti_current=%lld", "e->ti_current=%lld",
c->ti_end_max, e->ti_current); c->ti_hydro_end_max, e->ti_current);
#endif #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( ...@@ -215,19 +258,41 @@ __attribute__((always_inline)) INLINE static int spart_is_active(
* @param e The #engine containing information about the current time. * @param e The #engine containing information about the current time.
* @return 1 if the #cell contains at least an active particle, 0 otherwise. * @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) { const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
if (c->ti_beg_max > e->ti_current) if (c->ti_hydro_beg_max > e->ti_current)
error( error(
"cell in an impossible time-zone! c->ti_beg_max=%lld (t=%e) and " "cell in an impossible time-zone! c->ti_beg_max=%lld (t=%e) and "
"e->ti_current=%lld (t=%e)", "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); e->ti_current * e->timeBase);
#endif #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 { ...@@ -80,14 +80,23 @@ struct pcell {
/*! Maximal smoothing length. */ /*! Maximal smoothing length. */
double h_max; double h_max;
/*! Minimal integer end-of-timestep in this cell */ /*! Minimal integer end-of-timestep in this cell for hydro tasks */
integertime_t ti_end_min; integertime_t ti_hydro_end_min;
/*! Maximal integer end-of-timestep in this cell */ /*! Maximal integer end-of-timestep in this cell for hydro tasks */
integertime_t ti_end_max; integertime_t ti_hydro_end_max;
/*! Maximal integer beginning-of-timestep in this cell */ /*! Maximal integer beginning-of-timestep in this cell for hydro tasks */
integertime_t ti_beg_max; 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 */ /*! Integer time of the last drift of the #part in this cell */
integertime_t ti_old_part; integertime_t ti_old_part;
...@@ -125,8 +134,11 @@ struct pcell { ...@@ -125,8 +134,11 @@ struct pcell {
*/ */
struct pcell_step { struct pcell_step {
/*! Minimal integer end-of-timestep in this cell */ /*! Minimal integer end-of-timestep in this cell (hydro) */
integertime_t ti_end_min; 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 */ /*! Maximal distance any #part has travelled since last rebuild */
float dx_max_part; float dx_max_part;
...@@ -295,14 +307,24 @@ struct cell { ...@@ -295,14 +307,24 @@ struct cell {
#endif #endif
/*! Minimum end of (integer) time step in this cell. */ /*! Minimum end of (integer) time step in this cell for hydro tasks. */
integertime_t ti_end_min; integertime_t ti_hydro_end_min;
/*! Maximum end of (integer) time step in this cell. */ /*! Maximum end of (integer) time step in this cell for hydro tasks. */
integertime_t ti_end_max; integertime_t ti_hydro_end_max;
/*! Maximum beginning of (integer) time step in this cell. */ /*! Maximum beginning of (integer) time step in this cell for hydro tasks. */
integertime_t ti_beg_max; 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. */ /*! Last (integer) time the cell's part were drifted forward in time. */
integertime_t ti_old_part; integertime_t ti_old_part;
...@@ -470,7 +492,8 @@ void cell_check_part_drift_point(struct cell *c, void *data); ...@@ -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_gpart_drift_point(struct cell *c, void *data);
void cell_check_multipole_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); 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_set_super(struct cell *c, struct cell *super);
void cell_drift_part(struct cell *c, const struct engine *e, int force); 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); 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); ...@@ -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_drift_all_multipoles(struct cell *c, const struct engine *e);
void cell_check_timesteps(struct cell *c); void cell_check_timesteps(struct cell *c);
void cell_store_pre_drift_values(struct cell *c); void cell_store_pre_drift_values(struct cell *c);
void cell_activate_subcell_tasks(struct cell *ci, struct cell *cj, void cell_activate_subcell_hydro_tasks(struct cell *ci, struct cell *cj,
struct scheduler *s); struct scheduler *s);
void cell_activate_subcell_grav_tasks(struct cell *ci, struct cell *cj, void cell_activate_subcell_grav_tasks(struct cell *ci, struct cell *cj,
struct scheduler *s); struct scheduler *s);
void cell_activate_subcell_external_grav_tasks(struct cell *ci, void cell_activate_subcell_external_grav_tasks(struct cell *ci,
......
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
/* Local collections for MPI reduces. */ /* Local collections for MPI reduces. */
struct mpicollectgroup1 { struct mpicollectgroup1 {
size_t updates, g_updates, s_updates; 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; int forcerebuild;
}; };
...@@ -75,9 +76,15 @@ void collectgroup_init() { ...@@ -75,9 +76,15 @@ void collectgroup_init() {
* @param e The #engine * @param e The #engine
*/ */
void collectgroup1_apply(struct collectgroup1 *grp1, struct engine *e) { void collectgroup1_apply(struct collectgroup1 *grp1, struct engine *e) {
e->ti_end_min = grp1->ti_end_min; e->ti_hydro_end_min = grp1->ti_hydro_end_min;
e->ti_end_max = grp1->ti_end_max; e->ti_hydro_end_max = grp1->ti_hydro_end_max;
e->ti_beg_max = grp1->ti_beg_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->updates = grp1->updates;
e->g_updates = grp1->g_updates; e->g_updates = grp1->g_updates;
e->s_updates = grp1->s_updates; e->s_updates = grp1->s_updates;
...@@ -99,14 +106,21 @@ void collectgroup1_apply(struct collectgroup1 *grp1, struct engine *e) { ...@@ -99,14 +106,21 @@ void collectgroup1_apply(struct collectgroup1 *grp1, struct engine *e) {
*/ */
void collectgroup1_init(struct collectgroup1 *grp1, size_t updates, void collectgroup1_init(struct collectgroup1 *grp1, size_t updates,
size_t g_updates, size_t s_updates, size_t g_updates, size_t s_updates,
integertime_t ti_end_min, integertime_t ti_end_max, integertime_t ti_hydro_end_min,
integertime_t ti_beg_max, int forcerebuild) { 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->updates = updates;
grp1->g_updates = g_updates; grp1->g_updates = g_updates;
grp1->s_updates = s_updates; grp1->s_updates = s_updates;
grp1->ti_end_min = ti_end_min; grp1->ti_hydro_end_min = ti_hydro_end_min;
grp1->ti_end_max = ti_end_max; grp1->ti_hydro_end_max = ti_hydro_end_max;
grp1->ti_beg_max = ti_beg_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; grp1->forcerebuild = forcerebuild;
} }
...@@ -127,7 +141,8 @@ void collectgroup1_reduce(struct collectgroup1 *grp1) { ...@@ -127,7 +141,8 @@ void collectgroup1_reduce(struct collectgroup1 *grp1) {
mpigrp11.updates = grp1->updates; mpigrp11.updates = grp1->updates;
mpigrp11.g_updates = grp1->g_updates; mpigrp11.g_updates = grp1->g_updates;
mpigrp11.s_updates = grp1->s_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; mpigrp11.forcerebuild = grp1->forcerebuild;
struct mpicollectgroup1 mpigrp12; struct mpicollectgroup1 mpigrp12;
...@@ -139,7 +154,8 @@ void collectgroup1_reduce(struct collectgroup1 *grp1) { ...@@ -139,7 +154,8 @@ void collectgroup1_reduce(struct collectgroup1 *grp1) {
grp1->updates = mpigrp12.updates; grp1->updates = mpigrp12.updates;
grp1->g_updates = mpigrp12.g_updates; grp1->g_updates = mpigrp12.g_updates;
grp1->s_updates = mpigrp12.s_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; grp1->forcerebuild = mpigrp12.forcerebuild;
#endif #endif
...@@ -162,7 +178,10 @@ static void doreduce1(struct mpicollectgroup1 *mpigrp11, ...@@ -162,7 +178,10 @@ static void doreduce1(struct mpicollectgroup1 *mpigrp11,
mpigrp11->s_updates += mpigrp12->s_updates; mpigrp11->s_updates += mpigrp12->s_updates;
/* Minimum end time. */ /* 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. */ /* Everyone must agree to not rebuild. */
if (mpigrp11->forcerebuild || mpigrp12->forcerebuild) if (mpigrp11->forcerebuild || mpigrp12->forcerebuild)
......
...@@ -38,7 +38,8 @@ struct collectgroup1 { ...@@ -38,7 +38,8 @@ struct collectgroup1 {
size_t updates, g_updates, s_updates; size_t updates, g_updates, s_updates;
/* Times for the time-step */ /* 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? */ /* Force the engine to rebuild? */
int forcerebuild; int forcerebuild;
...@@ -48,8 +49,12 @@ void collectgroup_init(); ...@@ -48,8 +49,12 @@ void collectgroup_init();
void collectgroup1_apply(struct collectgroup1 *grp1, struct engine *e); void collectgroup1_apply(struct collectgroup1 *grp1, struct engine *e);
void collectgroup1_init(struct collectgroup1 *grp1, size_t updates, void collectgroup1_init(struct collectgroup1 *grp1, size_t updates,
size_t g_updates, size_t s_updates, size_t g_updates, size_t s_updates,
integertime_t ti_end_min, integertime_t ti_end_max, integertime_t ti_hydro_end_min,
integertime_t ti_beg_max, int forcerebuild); 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); void collectgroup1_reduce(struct collectgroup1 *grp1);
#endif /* SWIFT_COLLECTGROUP_H */ #endif /* SWIFT_COLLECTGROUP_H */
...@@ -319,7 +319,7 @@ static void dumpCells_map(struct cell *c, void *data) { ...@@ -319,7 +319,7 @@ static void dumpCells_map(struct cell *c, void *data) {
/* Active cells, otherwise all. */ /* Active cells, otherwise all. */
if (active) if (active)
active = cell_is_active(c, e); active = cell_is_active_hydro(c, e);
else else
active = 1; active = 1;
...@@ -346,9 +346,9 @@ static void dumpCells_map(struct cell *c, void *data) { ...@@ -346,9 +346,9 @@ static void dumpCells_map(struct cell *c, void *data) {
"%6.1f %20lld %6d %6d %6d %6d %6d\n", "%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->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->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->depth, ntasks, c->ti_hydro_end_min,
(c->super == c), cell_is_active(c, e), c->nodeID, get_time_bin(c->ti_hydro_end_min), (c->super == c),
c->nodeID == e->nodeID); cell_is_active_hydro(c, e), c->nodeID, c->nodeID == e->nodeID);
} }
} }
} }
......
This diff is collapsed.
...@@ -147,13 +147,31 @@ struct engine { ...@@ -147,13 +147,31 @@ struct engine {
double timeBase; double timeBase;
double timeBase_inv; 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; 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; 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; integertime_t ti_beg_max;
/* Number of particles updated in the previous step */ /* 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, ...@@ -130,7 +130,7 @@ void DOPAIR1_NAIVE(struct runner *r, struct cell *restrict ci,
TIMER_TIC; TIMER_TIC;
/* Anything to do here? */ /* 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_i = ci->count;
const int count_j = cj->count; const int count_j = cj->count;
...@@ -218,7 +218,7 @@ void DOPAIR2_NAIVE(struct runner *r, struct cell *restrict ci, ...@@ -218,7 +218,7 @@ void DOPAIR2_NAIVE(struct runner *r, struct cell *restrict ci,
TIMER_TIC; TIMER_TIC;
/* Anything to do here? */ /* 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_i = ci->count;
const int count_j = cj->count; const int count_j = cj->count;
...@@ -308,7 +308,7 @@ void DOSELF1_NAIVE(struct runner *r, struct cell *restrict c) { ...@@ -308,7 +308,7 @@ void DOSELF1_NAIVE(struct runner *r, struct cell *restrict c) {
TIMER_TIC; TIMER_TIC;
/* Anything to do here? */ /* Anything to do here? */
if (!cell_is_active(c, e)) return; if (!cell_is_active_hydro(c, e)) return;
const int count = c->count; const int count = c->count;
struct part *restrict parts = c->parts; struct part *restrict parts = c->parts;
...@@ -386,7 +386,7 @@ void DOSELF2_NAIVE(struct runner *r, struct cell *restrict c) { ...@@ -386,7 +386,7 @@ void DOSELF2_NAIVE(struct runner *r, struct cell *restrict c) {
TIMER_TIC; TIMER_TIC;
/* Anything to do here? */ /* Anything to do here? */
if (!cell_is_active(c, e)) return; if (!cell_is_active_hydro(c, e)) return;
const int count = c->count; const int count = c->count;
struct part *restrict parts = c->parts; struct part *restrict parts = c->parts;
...@@ -801,7 +801,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid, ...@@ -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 double dj_min = sort_j[0].d;
const float dx_max = (ci->dx_max_sort + cj->dx_max_sort); 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. */ /* Loop over the parts in ci. */
for (int pid = count_i - 1; for (int pid = count_i - 1;
...@@ -881,7 +881,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid, ...@@ -881,7 +881,7 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj, const int sid,
} /* loop over the parts in ci. */ } /* loop over the parts in ci. */
} /* Cell ci is active */ } /* Cell ci is active */
if (cell_is_active(cj, e)) { if (cell_is_active_hydro(cj, e)) {
/* Loop over the parts in cj. */ /* Loop over the parts in cj. */
for (int pjd = 0; pjd < count_j && sort_j[pjd].d - hj_max - dx_max < di_max; 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) { ...@@ -978,7 +978,7 @@ void DOPAIR1_BRANCH(struct runner *r, struct cell *ci, struct cell *cj) {
const struct engine *restrict e = r->e; const struct engine *restrict e = r->e;
/* Anything to do here? */ /* 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. */ /* Check that cells are drifted. */
if (!cell_are_part_drifted(ci, e) || !cell_are_part_drifted(cj, e)) 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, ...@@ -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; int count_active_i = 0, count_active_j = 0;
struct entry *restrict sort_active_i = NULL, *restrict sort_active_j = NULL; 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 */ /* If everybody is active don't bother copying */
sort_active_i = sort_i;