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

Only check lack of time-step assignment for local particles

parent 08d40fbd
......@@ -41,9 +41,10 @@ __attribute__((always_inline)) INLINE static int cell_is_drifted(
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_old > e->ti_current)
error(
"Cell has been drifted too far forward in time! c->ti_old=%lld "
"e->ti_current=%lld",
c->ti_old, e->ti_current);
"Cell has been drifted too far forward in time! c->ti_old=%lld (t=%e) "
"and e->ti_current=%lld (t=%e)",
c->ti_old, c->ti_old * e->timeBase, e->ti_current,
e->ti_current * e->timeBase);
#endif
return (c->ti_old == e->ti_current);
......@@ -60,11 +61,12 @@ __attribute__((always_inline)) INLINE static int cell_is_active(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_end_min < e->ti_current)
if (c->ti_end_min < e->ti_current && c->nodeID != e->nodeID)
error(
"cell in an impossible time-zone! c->ti_end_min=%lld "
"e->ti_current=%lld",
c->ti_end_min, e->ti_current);
"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,
e->ti_current * e->timeBase);
#endif
return (c->ti_end_min == e->ti_current);
......
......@@ -1140,18 +1140,18 @@ void cell_drift(struct cell *c, const struct engine *e) {
void cell_check_timesteps(struct cell *c) {
#ifdef SWIFT_DEBUG_CHECKS
if(c->nodeID != engine_rank) return;
if(c->ti_end_min == 0) error("Cell without assigned time-step");
if(c->ti_end_min == 0 && c->nr_tasks > 0)
error("Cell without assigned time-step");
if(c->split) {
for(int k=0; k<8; ++k)
if(c->progeny[k] != NULL) cell_check_timesteps(c->progeny[k]);
} else {
for(int i=0; i<c->count; ++i)
if(c->parts[i].time_bin == 0)
error("Particle without assigned time-bin");
if(c->nodeID == engine_rank)
for(int i=0; i<c->count; ++i)
if(c->parts[i].time_bin == 0)
error("Particle without assigned time-bin");
}
#endif
......
......@@ -189,5 +189,4 @@ void space_check_drift_point(struct space *s, integertime_t ti_current);
void space_check_timesteps(struct space *s);
void space_clean(struct space *s);
#endif /* SWIFT_SPACE_H */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment