diff --git a/src/cell.c b/src/cell.c index 5fbb444172c24deaae52c2ca5bc6c897c162d491..04848c7972f3e8d5d1aac2cd0bec43c3b0298d01 100644 --- a/src/cell.c +++ b/src/cell.c @@ -2762,10 +2762,6 @@ void cell_activate_limiter(struct cell *c, struct scheduler *s) { if (c->timestep_limiter == NULL) error("Trying to activate un-existing c->timestep_limiter"); #endif - if (c == c->hydro.super) { - scheduler_activate(s, c->hydro.limiter_in); - scheduler_activate(s, c->hydro.limiter_out); - } scheduler_activate(s, c->timestep_limiter); } else { for (struct cell *parent = c->parent; @@ -2780,10 +2776,6 @@ void cell_activate_limiter(struct cell *c, struct scheduler *s) { if (parent->timestep_limiter == NULL) error("Trying to activate un-existing parent->timestep_limiter"); #endif - if (parent == c->hydro.super) { - scheduler_activate(s, parent->hydro.limiter_in); - scheduler_activate(s, parent->hydro.limiter_out); - } scheduler_activate(s, parent->timestep_limiter); break; } @@ -3621,9 +3613,6 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) { if (c->timestep != NULL) scheduler_activate(s, c->timestep); if (c->hydro.end_force != NULL) scheduler_activate(s, c->hydro.end_force); if (c->hydro.cooling != NULL) scheduler_activate(s, c->hydro.cooling); - if (c->hydro.limiter_in != NULL) scheduler_activate(s, c->hydro.limiter_in); - if (c->hydro.limiter_out != NULL) - scheduler_activate(s, c->hydro.limiter_out); #ifdef WITH_LOGGER if (c->logger != NULL) scheduler_activate(s, c->logger); #endif diff --git a/src/engine_maketasks.c b/src/engine_maketasks.c index 2ec73c9195a0b7144a996673245f066db7784713..8e9f81b40dc7431aa39343ddeb30f38a4f27e17a 100644 --- a/src/engine_maketasks.c +++ b/src/engine_maketasks.c @@ -1036,9 +1036,6 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c, const int with_cooling = (e->policy & engine_policy_cooling); const int with_star_formation = (e->policy & engine_policy_star_formation); const int with_black_holes = (e->policy & engine_policy_black_holes); - const int with_timestep_limiter = - (e->policy & engine_policy_timestep_limiter); - const int with_timestep_sync = (e->policy & engine_policy_timestep_sync); /* Are we are the level where we create the stars' resort tasks? * If the tree is shallow, we need to do this at the super-level if the @@ -1186,39 +1183,6 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c, scheduler_addunlock(s, c->black_holes.black_holes_out, c->super->timestep); } - - /* Time-step limiter */ - if (with_timestep_limiter) { - - c->hydro.limiter_in = - scheduler_addtask(s, task_type_limiter_in, task_subtype_none, 0, - /* implicit = */ 1, c, NULL); - - c->hydro.limiter_out = - scheduler_addtask(s, task_type_limiter_out, task_subtype_none, 0, - /* implicit = */ 1, c, NULL); - - scheduler_addunlock(s, c->super->kick2, c->hydro.limiter_in); - scheduler_addunlock(s, c->hydro.limiter_out, c->super->timestep); - scheduler_addunlock(s, c->hydro.limiter_out, - c->super->timestep_limiter); - - if (with_timestep_sync) { - scheduler_addunlock(s, c->hydro.limiter_out, c->super->timestep_sync); - } - - if (with_star_formation && c->hydro.count > 0) { - scheduler_addunlock(s, c->top->hydro.star_formation, - c->hydro.limiter_in); - } - if (with_feedback) { - scheduler_addunlock(s, c->stars.stars_out, c->hydro.limiter_in); - } - if (with_black_holes) { - scheduler_addunlock(s, c->black_holes.black_holes_out, - c->hydro.limiter_in); - } - } } } else { /* We are above the super-cell so need to go deeper */ @@ -2003,11 +1967,9 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, } if (with_timestep_limiter) { - scheduler_addunlock(sched, ci->hydro.super->hydro.limiter_in, - t_limiter); + scheduler_addunlock(sched, ci->super->timestep, t_limiter); scheduler_addunlock(sched, ci->hydro.super->hydro.drift, t_limiter); - scheduler_addunlock(sched, t_limiter, - ci->hydro.super->hydro.limiter_out); + scheduler_addunlock(sched, t_limiter, ci->super->kick1); scheduler_addunlock(sched, t_limiter, ci->super->timestep_limiter); } @@ -2206,10 +2168,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, if (with_timestep_limiter) { scheduler_addunlock(sched, ci->hydro.super->hydro.drift, t_limiter); - scheduler_addunlock(sched, ci->hydro.super->hydro.limiter_in, - t_limiter); - scheduler_addunlock(sched, t_limiter, - ci->hydro.super->hydro.limiter_out); + scheduler_addunlock(sched, ci->super->timestep, t_limiter); + scheduler_addunlock(sched, t_limiter, ci->super->kick1); scheduler_addunlock(sched, t_limiter, ci->super->timestep_limiter); } @@ -2295,16 +2255,14 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, if (with_timestep_limiter) { scheduler_addunlock(sched, cj->hydro.super->hydro.drift, t_limiter); - scheduler_addunlock(sched, cj->hydro.super->hydro.limiter_in, - t_limiter); - scheduler_addunlock(sched, t_limiter, - cj->hydro.super->hydro.limiter_out); } } if (ci->super != cj->super) { if (with_timestep_limiter) { + scheduler_addunlock(sched, cj->super->timestep, t_limiter); + scheduler_addunlock(sched, t_limiter, cj->super->kick1); scheduler_addunlock(sched, t_limiter, cj->super->timestep_limiter); } @@ -2482,11 +2440,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, if (with_timestep_limiter) { scheduler_addunlock(sched, ci->hydro.super->hydro.drift, t_limiter); - scheduler_addunlock(sched, ci->hydro.super->hydro.limiter_in, - t_limiter); - scheduler_addunlock(sched, t_limiter, - ci->hydro.super->hydro.limiter_out); - + scheduler_addunlock(sched, ci->super->timestep, t_limiter); + scheduler_addunlock(sched, t_limiter, ci->super->kick1); scheduler_addunlock(sched, t_limiter, ci->super->timestep_limiter); } @@ -2688,10 +2643,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, if (with_timestep_limiter) { scheduler_addunlock(sched, ci->hydro.super->hydro.drift, t_limiter); - scheduler_addunlock(sched, ci->hydro.super->hydro.limiter_in, - t_limiter); - scheduler_addunlock(sched, t_limiter, - ci->hydro.super->hydro.limiter_out); + scheduler_addunlock(sched, ci->super->timestep, t_limiter); + scheduler_addunlock(sched, t_limiter, ci->super->kick1); scheduler_addunlock(sched, t_limiter, ci->super->timestep_limiter); } @@ -2705,7 +2658,6 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, } else /* ci->nodeID != nodeID */ { if (with_feedback) { - /* message("%p/%p",ci->hydro.super->stars.sorts, t_star_feedback); */ scheduler_addunlock(sched, ci->hydro.super->stars.sorts, t_star_feedback); } @@ -2779,16 +2731,14 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements, if (with_timestep_limiter) { scheduler_addunlock(sched, cj->hydro.super->hydro.drift, t_limiter); - scheduler_addunlock(sched, cj->hydro.super->hydro.limiter_in, - t_limiter); - scheduler_addunlock(sched, t_limiter, - cj->hydro.super->hydro.limiter_out); } } if (ci->super != cj->super) { if (with_timestep_limiter) { + scheduler_addunlock(sched, cj->super->timestep, t_limiter); + scheduler_addunlock(sched, t_limiter, cj->super->kick1); scheduler_addunlock(sched, t_limiter, cj->super->timestep_limiter); } diff --git a/src/engine_marktasks.c b/src/engine_marktasks.c index 83b358dc6feab76ff72064d7fb8ef304f5d0f837..25d27c1b3d231687829fbfd4aeb046f0b3fea873 100644 --- a/src/engine_marktasks.c +++ b/src/engine_marktasks.c @@ -940,12 +940,6 @@ void engine_marktasks_mapper(void *map_data, int num_elements, if (cell_is_active_black_holes(t->ci, e)) scheduler_activate(s, t); } - /* Limiter implicit tasks? */ - else if (t_type == task_type_limiter_in || - t_type == task_type_limiter_out) { - if (cell_is_active_hydro(t->ci, e)) scheduler_activate(s, t); - } - /* Time-step? */ else if (t_type == task_type_timestep) { t->ci->hydro.updated = 0; diff --git a/src/runner_main.c b/src/runner_main.c index afa99d3ced41d1302634163a22f5e7442e5d5a53..c65d4da178fe732886653ed1a7b1005398cbbd1a 100644 --- a/src/runner_main.c +++ b/src/runner_main.c @@ -216,7 +216,7 @@ void *runner_main(void *data) { else if (t->subtype == task_subtype_force) runner_dopair2_branch_force(r, ci, cj); else if (t->subtype == task_subtype_limiter) - runner_dopair1_branch_limiter(r, ci, cj); + ; // runner_dopair1_branch_limiter(r, ci, cj); else if (t->subtype == task_subtype_grav) runner_dopair_recursive_grav(r, ci, cj, 1); else if (t->subtype == task_subtype_stars_density) @@ -248,7 +248,7 @@ void *runner_main(void *data) { else if (t->subtype == task_subtype_force) runner_dosub_self2_force(r, ci, 1); else if (t->subtype == task_subtype_limiter) - runner_dosub_self1_limiter(r, ci, 1); + ; // runner_dosub_self1_limiter(r, ci, 1); else if (t->subtype == task_subtype_stars_density) runner_dosub_self_stars_density(r, ci, 1); else if (t->subtype == task_subtype_stars_feedback) @@ -278,7 +278,7 @@ void *runner_main(void *data) { else if (t->subtype == task_subtype_force) runner_dosub_pair2_force(r, ci, cj, 1); else if (t->subtype == task_subtype_limiter) - runner_dosub_pair1_limiter(r, ci, cj, 1); + ; // runner_dosub_pair1_limiter(r, ci, cj, 1); else if (t->subtype == task_subtype_stars_density) runner_dosub_pair_stars_density(r, ci, cj, 1); else if (t->subtype == task_subtype_stars_feedback) diff --git a/src/runner_time_integration.c b/src/runner_time_integration.c index 10473a97e1aac047a568dc0395c837e7a45b8b57..3f03b4f91533cc7ec231087c6bad545e6a8465fd 100644 --- a/src/runner_time_integration.c +++ b/src/runner_time_integration.c @@ -121,13 +121,10 @@ void runner_do_kick1(struct runner *r, struct cell *c, int timer) { if (part_is_starting(p, e)) { #ifdef SWIFT_DEBUG_CHECKS - if (p->wakeup == time_bin_awake) + if (p->wakeup != time_bin_not_awake) error("Woken-up particle that has not been processed in kick1"); #endif - /* Skip particles that have been woken up and treated by the limiter. */ - if (p->wakeup != time_bin_not_awake) continue; - const integertime_t ti_step = get_integer_timestep(p->time_bin); const integertime_t ti_begin = get_integer_time_begin(ti_current + 1, p->time_bin); @@ -349,10 +346,12 @@ void runner_do_kick2(struct runner *r, struct cell *c, int timer) { integertime_t ti_begin, ti_end, ti_step; #ifdef SWIFT_DEBUG_CHECKS - if (p->wakeup == time_bin_awake) + if (p->wakeup != time_bin_not_awake) error("Woken-up particle that has not been processed in kick1"); #endif + // MATTHIEU + if (p->wakeup == time_bin_not_awake) { /* Time-step from a regular kick */ @@ -1020,12 +1019,8 @@ void runner_do_limiter(struct runner *r, struct cell *c, int force, int timer) { /* Avoid inhibited particles */ if (part_is_inhibited(p, e)) continue; - /* If the particle will be active no need to wake it up */ - if (part_is_active(p, e) && p->wakeup != time_bin_not_awake) - p->wakeup = time_bin_not_awake; - /* Bip, bip, bip... wake-up time */ - if (p->wakeup <= time_bin_awake) { + if (p->wakeup != time_bin_not_awake) { /* Apply the limiter and get the new time-step size */ const integertime_t ti_new_step = timestep_limit_part(p, xp, e); @@ -1160,8 +1155,10 @@ void runner_do_sync(struct runner *r, struct cell *c, int force, int timer) { if (part_is_inhibited(p, e)) continue; /* If the particle is active no need to sync it */ - if (part_is_active(p, e) && p->to_be_synchronized) + if (part_is_active(p, e) && p->to_be_synchronized) { + message("Particle %lld already synchronized!", p->id); p->to_be_synchronized = 0; + } if (p->to_be_synchronized) { diff --git a/src/space.c b/src/space.c index 54a2e37aaad8ba3fad918eb535bf8cfa6e909776..71c2e465aca12c03d8185861ebf44489a1bcffa5 100644 --- a/src/space.c +++ b/src/space.c @@ -5466,8 +5466,9 @@ void space_check_limiter_mapper(void *map_data, int nr_parts, if (parts[k].time_bin < 0) error("Particle has negative time-bin!"); - if (with_timestep_limiter && parts[k].wakeup == time_bin_awake) - error("Particle still woken up! id=%lld", parts[k].id); + if (with_timestep_limiter && parts[k].wakeup != time_bin_not_awake) + error("Particle still woken up! id=%lld wakeup=%d", parts[k].id, + parts[k].wakeup); if (with_timestep_sync && parts[k].to_be_synchronized != 0) error("Synchronized particle not treated! id=%lld synchronized=%d", diff --git a/src/timeline.h b/src/timeline.h index 0f94321101c9f3e319348cfb46210a389df56fd3..2bc59281fc7ae86cce2486fa2741ef61d1e3d433 100644 --- a/src/timeline.h +++ b/src/timeline.h @@ -45,10 +45,10 @@ typedef int8_t timebin_t; #define time_bin_not_created (num_time_bins + 3) /*! Fictitious time-bin for particles not awaken */ -#define time_bin_not_awake (0) +#define time_bin_not_awake (-num_time_bins) /*! Fictitious time-bin for particles woken up */ -#define time_bin_awake (-1) +//#define time_bin_awake (-1) /* Maximal difference in time-bins between neighbouring particles */ #define time_bin_neighbour_max_delta_bin 2 diff --git a/src/timestep_limiter.h b/src/timestep_limiter.h index 01b72daea5599b662c38fdc4b3ada8b2ac5b3d11..74d183ab4c34c64d5a0edac418d6d1c9241e05ef 100644 --- a/src/timestep_limiter.h +++ b/src/timestep_limiter.h @@ -40,109 +40,118 @@ __attribute__((always_inline)) INLINE static integertime_t timestep_limit_part( const struct cosmology *cosmo = e->cosmology; const int with_cosmology = e->policy & engine_policy_cosmology; const double time_base = e->time_base; + const integertime_t ti_current = e->ti_current; - integertime_t old_ti_beg, old_ti_end; - timebin_t old_time_bin; + if (part_is_active(p, e)) { - /* Let's see when this particle started and used to end */ - if (p->wakeup == time_bin_awake) { + message("Limiting active particle!"); - /* Normal case */ - old_ti_beg = get_integer_time_begin(e->ti_current, p->time_bin); - old_ti_end = get_integer_time_end(e->ti_current, p->time_bin); - old_time_bin = p->time_bin; - } else { + /* First case, the particle was active so we only need to update the length + of its next time-step */ - /* Particle that was limited in the previous step already */ - old_ti_beg = get_integer_time_begin(e->ti_current, -p->wakeup); - old_ti_end = get_integer_time_end(e->ti_current, p->time_bin); - old_time_bin = -p->wakeup; - } + /* New time-bin of this particle */ + p->time_bin = -p->wakeup + 2; - const integertime_t old_dti = old_ti_end - old_ti_beg; + /* Mark the particle as being rady to be time integrated */ + p->wakeup = time_bin_not_awake; - /* The new fake time-step the particle will be on */ - const integertime_t new_fake_ti_step = - get_integer_timestep(e->min_active_bin); + return get_integer_timestep(p->time_bin); - /* The actual time-step size this particle will use */ - const integertime_t new_ti_beg = old_ti_beg; - const integertime_t new_ti_end = e->ti_current + new_fake_ti_step; - const integertime_t new_dti = new_ti_end - new_ti_beg; + } else { -#ifdef SWIFT_DEBUG_CHECKS - /* Some basic safety checks */ - if (old_ti_beg >= e->ti_current) - error( - "Incorrect value for old time-step beginning ti_current=%lld, " - "old_ti_beg=%lld", - e->ti_current, old_ti_beg); + message("Limiting inactive particle!"); - if (old_ti_end <= e->ti_current) - error( - "Incorrect value for old time-step end ti_current=%lld, " - "old_ti_end=%lld", - e->ti_current, old_ti_end); + /* 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 */ - if (new_ti_end > old_ti_end) error("New end of time-step after the old one"); + /* The timebins to play with */ + const timebin_t old_bin = p->time_bin; + const timebin_t new_bin = -p->wakeup + 2; - if (new_dti > old_dti) error("New time-step larger than old one"); + /* Current start and end time of this particle */ + const integertime_t ti_beg_old = + get_integer_time_begin(ti_current, old_bin); + const integertime_t ti_end_old = get_integer_time_end(ti_current, old_bin); + const integertime_t dti_old = ti_end_old - ti_beg_old; - if (new_fake_ti_step == 0) error("Wakeup call too early"); -#endif + /* Start and end time of the fake step ending now */ + const integertime_t ti_beg_new = ti_beg_old; + const integertime_t ti_end_new = ti_current; + const integertime_t dti_new = ti_end_new - ti_beg_new; - double dt_kick_grav = 0., dt_kick_hydro = 0., dt_kick_therm = 0., - dt_kick_corr = 0.; - - /* Now we need to reverse the kick1... (the dt are negative here) */ - if (with_cosmology) { - dt_kick_hydro = -cosmology_get_hydro_kick_factor(cosmo, old_ti_beg, - old_ti_beg + old_dti / 2); - dt_kick_grav = -cosmology_get_grav_kick_factor(cosmo, old_ti_beg, - old_ti_beg + old_dti / 2); - dt_kick_therm = -cosmology_get_therm_kick_factor(cosmo, old_ti_beg, - old_ti_beg + old_dti / 2); - dt_kick_corr = -cosmology_get_corr_kick_factor(cosmo, old_ti_beg, - old_ti_beg + old_dti / 2); - } else { - dt_kick_hydro = -(old_dti / 2) * time_base; - dt_kick_grav = -(old_dti / 2) * time_base; - dt_kick_therm = -(old_dti / 2) * time_base; - dt_kick_corr = -(old_dti / 2) * time_base; - } +#ifdef SWIFT_DEBUG_CHECKS + /* Some basic safety checks */ + if (ti_beg_old >= e->ti_current) + error( + "Incorrect value for old time-step beginning ti_current=%lld, " + "ti_beg_old=%lld", + e->ti_current, ti_beg_old); + + if (ti_end_old <= e->ti_current) + error( + "Incorrect value for old time-step end ti_current=%lld, " + "ti_end_old=%lld", + e->ti_current, ti_end_old); + + if (ti_end_new > ti_end_old) + error("New end of time-step after the old one"); + + if (dti_new > dti_old) error("New time-step larger than old one"); +#endif - kick_part(p, xp, dt_kick_hydro, dt_kick_grav, dt_kick_therm, dt_kick_corr, - e->cosmology, e->hydro_properties, e->entropy_floor, - old_ti_beg + old_dti / 2, old_ti_beg); - - /* ...and apply the new one (dt is positiive) */ - if (with_cosmology) { - dt_kick_hydro = cosmology_get_hydro_kick_factor(cosmo, new_ti_beg, - new_ti_beg + new_dti / 2); - dt_kick_grav = cosmology_get_grav_kick_factor(cosmo, new_ti_beg, - new_ti_beg + new_dti / 2); - dt_kick_therm = cosmology_get_therm_kick_factor(cosmo, new_ti_beg, - new_ti_beg + new_dti / 2); - dt_kick_corr = cosmology_get_corr_kick_factor(cosmo, new_ti_beg, - new_ti_beg + new_dti / 2); - } else { - dt_kick_hydro = (new_dti / 2) * time_base; - dt_kick_grav = (new_dti / 2) * time_base; - dt_kick_therm = (new_dti / 2) * time_base; - dt_kick_corr = (new_dti / 2) * time_base; + double dt_kick_grav = 0., dt_kick_hydro = 0., dt_kick_therm = 0., + dt_kick_corr = 0.; + + /* Now we need to reverse the kick1... (the dt are negative here) */ + if (with_cosmology) { + dt_kick_hydro = -cosmology_get_hydro_kick_factor( + cosmo, ti_beg_old, ti_beg_old + dti_old / 2); + dt_kick_grav = -cosmology_get_grav_kick_factor(cosmo, ti_beg_old, + ti_beg_old + dti_old / 2); + dt_kick_therm = -cosmology_get_therm_kick_factor( + cosmo, ti_beg_old, ti_beg_old + dti_old / 2); + dt_kick_corr = -cosmology_get_corr_kick_factor(cosmo, ti_beg_old, + ti_beg_old + dti_old / 2); + } else { + dt_kick_hydro = -(dti_old / 2) * time_base; + dt_kick_grav = -(dti_old / 2) * time_base; + dt_kick_therm = -(dti_old / 2) * time_base; + dt_kick_corr = -(dti_old / 2) * time_base; + } + + kick_part(p, xp, dt_kick_hydro, dt_kick_grav, dt_kick_therm, dt_kick_corr, + e->cosmology, e->hydro_properties, e->entropy_floor, + ti_beg_old + dti_old / 2, ti_beg_old); + + /* ...and apply the new one (dt is positiive) */ + if (with_cosmology) { + dt_kick_hydro = cosmology_get_hydro_kick_factor(cosmo, ti_beg_new, + ti_beg_new + dti_new / 2); + dt_kick_grav = cosmology_get_grav_kick_factor(cosmo, ti_beg_new, + ti_beg_new + dti_new / 2); + dt_kick_therm = cosmology_get_therm_kick_factor(cosmo, ti_beg_new, + ti_beg_new + dti_new / 2); + dt_kick_corr = cosmology_get_corr_kick_factor(cosmo, ti_beg_new, + ti_beg_new + dti_new / 2); + } else { + dt_kick_hydro = (dti_new / 2) * time_base; + dt_kick_grav = (dti_new / 2) * time_base; + dt_kick_therm = (dti_new / 2) * time_base; + dt_kick_corr = (dti_new / 2) * time_base; + } + + kick_part(p, xp, dt_kick_hydro, dt_kick_grav, dt_kick_therm, dt_kick_corr, + e->cosmology, e->hydro_properties, e->entropy_floor, ti_beg_new, + ti_beg_new + dti_new / 2); + + /* New time-bin of this particle */ + p->time_bin = new_bin; + + /* Mark the particle as being rady to be time integrated */ + p->wakeup = time_bin_not_awake; + + return get_integer_timestep(new_bin); } - - kick_part(p, xp, dt_kick_hydro, dt_kick_grav, dt_kick_therm, dt_kick_corr, - e->cosmology, e->hydro_properties, e->entropy_floor, new_ti_beg, - new_ti_beg + new_dti / 2); - - /* Remember the old time-bin */ - p->wakeup = old_time_bin; - - /* Update the time bin of this particle */ - p->time_bin = e->min_active_bin; - - return new_fake_ti_step; } #endif /* SWIFT_TIMESTEP_LIMITER_H */ diff --git a/src/timestep_sync.h b/src/timestep_sync.h index b79cb01e2d149e0c6e63f1024cd2b210487c3eda..f6e93e5f2fae1a064471bc1f50d3f95795ca2897 100644 --- a/src/timestep_sync.h +++ b/src/timestep_sync.h @@ -52,7 +52,10 @@ INLINE static void timestep_process_sync_part(struct part *p, struct xpart *xp, p->to_be_synchronized = 0; /* This particle is already active. Nothing to do here... */ - if (p->time_bin <= max_active_bin) return; + if (p->time_bin <= max_active_bin) { + message("Particle %lld already synchronized!", p->id); + return; + } message("Synchronizing particle %lld old bin: %d", p->id, p->time_bin); diff --git a/src/timestep_sync_part.h b/src/timestep_sync_part.h index ef43067c7966c18d13a76b257a33e4b1c9d65917..cb3b1325d425220ef79f8e5bc93a049b8e08e984 100644 --- a/src/timestep_sync_part.h +++ b/src/timestep_sync_part.h @@ -32,9 +32,8 @@ __attribute__((always_inline)) INLINE static void timestep_sync_part( p->to_be_synchronized = 1; #ifdef SWIFT_DEBUG_CHECKS - /* message("Demanding a synchronization for particle %lld current - * time_bin=%d", */ - /* p->id, p->time_bin); */ + message("Demanding a synchronization for particle %lld current time_bin=%d", + p->id, p->time_bin); #endif }