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

Removed debugging code.

parent f227c938
Branches
Tags
1 merge request!956Fully implement the timestep limiter (non MPI)
......@@ -23,8 +23,6 @@
/* Time integration constants. */
#define const_max_u_change 0.1f
#define ICHECK 116567
/* I/O Constant; this determines the relative tolerance between the value of
* redshift read from the snapshot, and the value from the parameter file. This
* current value asserts that they must match within 0.1%. */
......
......@@ -94,9 +94,6 @@ __attribute__((always_inline)) INLINE static void drift_part(
p->ti_drift = ti_current;
#endif
if (p->id == ICHECK)
message("DRIFT id=%lld ti_current=%lld", p->id, ti_current);
/* Drift... */
p->x[0] += xp->v_full[0] * dt_drift;
p->x[1] += xp->v_full[1] * dt_drift;
......
......@@ -94,8 +94,6 @@ __attribute__((always_inline)) INLINE static void kick_part(
p->ti_kick = ti_end;
#endif
if (p->id == ICHECK) message("KICK ti_end=%lld", ti_end);
/* Kick particles in momentum space (hydro acc.) */
xp->v_full[0] += p->a_hydro[0] * dt_kick_hydro;
xp->v_full[1] += p->a_hydro[1] * dt_kick_hydro;
......
......@@ -117,14 +117,9 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) {
struct part *restrict p = &parts[k];
struct xpart *restrict xp = &xparts[k];
if (p->id == ICHECK)
message("is_starting=%d wakeup=%d", part_is_starting(p, e), p->wakeup);
/* If particle needs to be kicked */
if (part_is_starting(p, e)) {
// p->wakeup = time_bin_not_awake;
#ifdef SWIFT_DEBUG_CHECKS
if (p->wakeup != time_bin_not_awake)
error("Woken-up particle that has not been processed in kick1");
......@@ -162,9 +157,6 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) {
dt_kick_corr = (ti_step / 2) * time_base;
}
if (p->id == ICHECK)
message("KICK1 id=%lld ti_end=%lld", p->id, ti_begin + ti_step / 2);
/* do the kick */
kick_part(p, xp, dt_kick_hydro, dt_kick_grav, dt_kick_therm,
dt_kick_corr, cosmo, hydro_props, entropy_floor, ti_begin,
......@@ -388,9 +380,6 @@ void runner_do_kick2(struct runner *r, struct cell *c, int timer) {
dt_kick_corr = (ti_end - (ti_begin + ti_step / 2)) * time_base;
}
if (p->id == ICHECK)
message("KICK2 id=%lld ti_end=%lld", p->id, ti_end);
/* Finish the time-step with a second half-kick */
kick_part(p, xp, dt_kick_hydro, dt_kick_grav, dt_kick_therm,
dt_kick_corr, cosmo, hydro_props, entropy_floor,
......@@ -611,9 +600,6 @@ void runner_do_timestep(struct runner *r, struct cell *c, int timer) {
p->time_bin = get_time_bin(ti_new_step);
if (p->gpart != NULL) p->gpart->time_bin = p->time_bin;
if (p->id == ICHECK)
message("TIMESTEP bin=%d time_step=%lld", p->time_bin, ti_new_step);
/* Update the tracers properties */
tracers_after_timestep(p, xp, e->internal_units, e->physical_constants,
with_cosmology, e->cosmology,
......@@ -1021,10 +1007,6 @@ void runner_do_limiter(struct runner *r, struct cell *c, int force, int timer) {
/* Bip, bip, bip... wake-up time */
if (p->wakeup != time_bin_not_awake) {
if (p->id == ICHECK)
message("ti_end_min=%lld ti_current=%lld", ti_hydro_end_min,
e->ti_current);
/* Apply the limiter and get the new end of time-step */
const integertime_t ti_end_new = timestep_limit_part(p, xp, e);
......@@ -1038,10 +1020,6 @@ void runner_do_limiter(struct runner *r, struct cell *c, int force, int timer) {
/* What is the next starting point for this cell ? */
ti_hydro_beg_max = max(ti_current, ti_hydro_beg_max);
if (p->id == ICHECK)
message("ti_end_min=%lld ti_current=%lld", ti_hydro_end_min,
e->ti_current);
/* Also limit the gpart counter-part */
if (p->gpart != NULL) {
......
......@@ -33,7 +33,7 @@ typedef long long integertime_t;
typedef int8_t timebin_t;
/*! The number of time bins */
#define num_time_bins 26
#define num_time_bins 56
/*! The maximal number of timesteps in a simulation */
#define max_nr_timesteps (1LL << (num_time_bins + 1))
......@@ -48,7 +48,7 @@ typedef int8_t timebin_t;
#define time_bin_not_awake (-num_time_bins)
/*! Fictitious time-bin for particles woken up */
#define time_bin_awake (-(num_time_bins + 1))
//#define time_bin_awake (-(num_time_bins + 1))
/* Maximal difference in time-bins between neighbouring particles */
#define time_bin_neighbour_max_delta_bin 2
......
......@@ -44,13 +44,8 @@ __attribute__((always_inline)) INLINE static integertime_t timestep_limit_part(
const double time_base = e->time_base;
const integertime_t ti_current = e->ti_current;
if (p->id == ICHECK)
message("LIMITER time_bin=%d wakeup=%d", p->time_bin, p->wakeup);
if (part_is_active(p, e)) {
// message("Limiting active particle!");
/* First case, the particle was active so we only need to update the length
of its next time-step */
......@@ -65,8 +60,6 @@ __attribute__((always_inline)) INLINE static integertime_t timestep_limit_part(
} else {
// message("Limiting inactive particle!");
/* Second case, the particle was inactive so we need to interrupt its
time-step, undo the "kick" operator and assign a new time-step size */
......@@ -89,12 +82,6 @@ __attribute__((always_inline)) INLINE static integertime_t timestep_limit_part(
const integertime_t ti_beg_new = ti_beg_old + (k - 1) * dti_new;
if (p->id == ICHECK) {
message("ti_kick=%lld (%d)", p->ti_kick, get_time_bin(p->ti_kick) + 1);
message("ti_beg_new = %lld", ti_beg_new);
message("ti_beg_old = %lld", ti_beg_new);
}
#ifdef SWIFT_DEBUG_CHECKS
/* Some basic safety checks */
if (ti_beg_old >= e->ti_current)
......@@ -139,12 +126,8 @@ __attribute__((always_inline)) INLINE static integertime_t timestep_limit_part(
e->cosmology, e->hydro_properties, e->entropy_floor,
ti_beg_old + dti_old / 2, ti_beg_old);
if (p->id == ICHECK) {
message("ti_kick=%lld (%d)", p->ti_kick, get_time_bin(p->ti_kick) + 1);
}
/* ...and apply the new one (dt is positiive).
* This brought us to the current time. */
* This brings us to the current time. */
if (with_cosmology) {
dt_kick_hydro = cosmology_get_hydro_kick_factor(cosmo, ti_beg_new,
ti_beg_new + dti_new / 2);
......@@ -165,10 +148,6 @@ __attribute__((always_inline)) INLINE static integertime_t timestep_limit_part(
e->cosmology, e->hydro_properties, e->entropy_floor, ti_beg_old,
ti_beg_new);
if (p->id == ICHECK) {
message("ti_kick=%lld (%d)", p->ti_kick, get_time_bin(p->ti_kick) + 1);
}
/* The particle has now been kicked to the current time */
/* New time-bin of this particle */
......@@ -177,8 +156,6 @@ __attribute__((always_inline)) INLINE static integertime_t timestep_limit_part(
/* Mark the particle as being ready to be time integrated */
p->wakeup = time_bin_not_awake;
if (p->id == ICHECK) message("new time bin=%d", p->time_bin);
/* Do we need to apply the mising kick1 or is this bin active and
it will be done in the kick task? */
if (new_bin > e->max_active_bin) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment