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

Post-merge fixes

parent 5b8599d3
......@@ -144,7 +144,7 @@ __attribute__((always_inline)) INLINE static int gpart_is_active(
}
/**
* @brief Is this s-particle active ?
* @brief Is this s-particle finishing its time-step now ?
*
* @param sp The #spart.
* @param e The #engine containing information about the current time.
......@@ -159,7 +159,7 @@ __attribute__((always_inline)) INLINE static int spart_is_active(
#ifdef SWIFT_DEBUG_CHECKS
if (ti_end < ti_current)
error(
"s-particle in an impossible time-zone! gp->ti_end=%lld "
"s-particle in an impossible time-zone! sp->ti_end=%lld "
"e->ti_current=%lld",
ti_end, ti_current);
#endif
......@@ -167,8 +167,6 @@ __attribute__((always_inline)) INLINE static int spart_is_active(
return (ti_end == ti_current);
}
/* Are cells / particles active for kick1 tasks ? */
/**
......@@ -242,4 +240,29 @@ __attribute__((always_inline)) INLINE static int gpart_is_starting(
return (ti_beg == ti_current);
}
/**
* @brief Is this s-particle starting its time-step now ?
*
* @param sp The #spart.
* @param e The #engine containing information about the current time.
* @return 1 if the #spart is active, 0 otherwise.
*/
__attribute__((always_inline)) INLINE static int spart_is_starting(
const struct spart *sp, const struct engine *e) {
const integertime_t ti_current = e->ti_current;
const integertime_t ti_beg =
get_integer_time_begin(ti_current + 1, sp->time_bin);
#ifdef SWIFT_DEBUG_CHECKS
if (ti_beg > ti_current)
error(
"s-particle in an impossible time-zone! sp->ti_beg=%lld "
"e->ti_current=%lld",
ti_beg, ti_current);
#endif
return (ti_beg == ti_current);
}
#endif /* SWIFT_ACTIVE_H */
......@@ -3077,7 +3077,6 @@ void engine_step(struct engine *e) {
if (e->ti_end_min >= e->ti_nextSnapshot && e->ti_nextSnapshot > 0)
e->dump_snapshot = 1;
/* Drift everybody (i.e. what has not yet been drifted) */
/* to the current time */
if (e->dump_snapshot || e->forcerebuild || e->forcerepart != REPART_NONE)
......
......@@ -431,11 +431,12 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units,
*flag_entropy = flag_entropy_temp[0];
readAttribute(h_grp, "BoxSize", DOUBLE, boxSize);
readAttribute(h_grp, "NumPart_Total", LONGLONG, numParticles);
readAttribute(h_grp, "NumPart_Total_HighWord", LONGLONG, numParticles_highWord);
readAttribute(h_grp, "NumPart_Total_HighWord", LONGLONG,
numParticles_highWord);
for (int ptype = 0; ptype < NUM_PARTICLE_TYPES; ++ptype)
N_total[ptype] = (numParticles[ptype]) +
(numParticles_highWord[ptype] << 32);
N_total[ptype] =
(numParticles[ptype]) + (numParticles_highWord[ptype] << 32);
dim[0] = boxSize[0];
dim[1] = (boxSize[1] < 0) ? boxSize[0] : boxSize[1];
......
......@@ -968,8 +968,7 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) {
/* do the kick */
kick_spart(sp, ti_begin, ti_begin + ti_step / 2, timeBase);
}
}
}
}
if (timer) TIMER_TOC(timer_kick1);
}
......@@ -1119,7 +1118,7 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) {
TIMER_TIC;
int updated = 0, g_updated = 0, s_updated = 0;
integertime_t ti_end_min = max_nr_timesteps, ti_end_max = 0, ti_end_max = 0, ti_beg_max = 0;
integertime_t ti_end_min = max_nr_timesteps, ti_end_max = 0, ti_beg_max = 0;
/* No children? */
if (!c->split) {
......
......@@ -483,11 +483,12 @@ void read_ic_serial(char* fileName, const struct UnitSystem* internal_units,
*flag_entropy = flag_entropy_temp[0];
readAttribute(h_grp, "BoxSize", DOUBLE, boxSize);
readAttribute(h_grp, "NumPart_Total", LONGLONG, numParticles);
readAttribute(h_grp, "NumPart_Total_HighWord", LONGLONG, numParticles_highWord);
readAttribute(h_grp, "NumPart_Total_HighWord", LONGLONG,
numParticles_highWord);
for (int ptype = 0; ptype < NUM_PARTICLE_TYPES; ++ptype)
N_total[ptype] = (numParticles[ptype]) +
(numParticles_highWord[ptype] << 32);
N_total[ptype] =
(numParticles[ptype]) + (numParticles_highWord[ptype] << 32);
dim[0] = boxSize[0];
dim[1] = (boxSize[1] < 0) ? boxSize[0] : boxSize[1];
......
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