diff --git a/examples/main.c b/examples/main.c index 40cfca8499d9d6148dc3c821c7fd055fa81aef16..7baf549c6e37c57d89d3eb90fc43ca71ed603ddf 100644 --- a/examples/main.c +++ b/examples/main.c @@ -845,9 +845,9 @@ int main(int argc, char *argv[]) { /* Legend */ if (myrank == 0) - printf("# %6s %14s %14s %12s %12s %12s %16s [%s] %6s\n", "Step", "Time", - "Time-step", "Updates", "g-Updates", "s-Updates", "Wall-clock time", - clocks_getunit(), "Props"); + printf("# %6s %14s %14s %9s %12s %12s %12s %16s [%s] %6s\n", "Step", "Time", + "Time-step", "Time-bins", "Updates", "g-Updates", "s-Updates", + "Wall-clock time", clocks_getunit(), "Props"); /* File for the timers */ if (with_verbose_timers) timers_open_file(myrank); diff --git a/examples/plot_scaling_results.py b/examples/plot_scaling_results.py index 9e938c720f81dcf2246d2e48922ec5b4dd404f3e..552fab9206d9242748346f51c0fc2645a085a8ae 100755 --- a/examples/plot_scaling_results.py +++ b/examples/plot_scaling_results.py @@ -148,8 +148,8 @@ def parse_files(): # Loop over all files for a given series and load the times for j in range(0,len(file_list)): - times = np.loadtxt(file_list[j],usecols=(6,)) - updates = np.loadtxt(file_list[j],usecols=(3,)) + times = np.loadtxt(file_list[j],usecols=(8,)) + updates = np.loadtxt(file_list[j],usecols=(5,)) totalTime[i].append(np.sum(times)) sumTotal.append(np.sum(totalTime[i])) diff --git a/examples/plot_scaling_results_breakdown.py b/examples/plot_scaling_results_breakdown.py index 92a9564c326b9a4d33c047a87f7792d257c96b69..e20b429c6112163dff04241a00980f98da168cf5 100755 --- a/examples/plot_scaling_results_breakdown.py +++ b/examples/plot_scaling_results_breakdown.py @@ -149,8 +149,8 @@ def parse_files(): # Loop over all files for a given series and load the times for j in range(0,len(file_list)): - times = np.loadtxt(file_list[j],usecols=(6,), skiprows=11) - updates = np.loadtxt(file_list[j],usecols=(3,), skiprows=11) + times = np.loadtxt(file_list[j],usecols=(8,)) + updates = np.loadtxt(file_list[j],usecols=(5,)) totalTime[i].append(np.sum(times)) sumTotal.append(np.sum(totalTime[i])) diff --git a/src/engine.c b/src/engine.c index ffb4d752efcbf676685cefe83861c4335e3e1464..c48510b657a2eae3420dc9f3d95624d47b719812 100644 --- a/src/engine.c +++ b/src/engine.c @@ -4370,14 +4370,17 @@ void engine_step(struct engine *e) { if (e->nodeID == 0) { /* Print some information to the screen */ - printf(" %6d %14e %14e %12zu %12zu %12zu %21.3f %6d\n", e->step, e->time, - e->time_step, e->updates, e->g_updates, e->s_updates, - e->wallclock_time, e->step_props); + printf(" %6d %14e %14e %4d %4d %12zu %12zu %12zu %21.3f %6d\n", e->step, + e->time, e->time_step, e->min_active_bin, e->max_active_bin, + e->updates, e->g_updates, e->s_updates, e->wallclock_time, + e->step_props); fflush(stdout); - fprintf(e->file_timesteps, " %6d %14e %14e %12zu %12zu %12zu %21.3f %6d\n", - e->step, e->time, e->time_step, e->updates, e->g_updates, - e->s_updates, e->wallclock_time, e->step_props); + fprintf(e->file_timesteps, + " %6d %14e %14e %4d %4d %12zu %12zu %12zu %21.3f %6d\n", e->step, + e->time, e->time_step, e->min_active_bin, e->max_active_bin, + e->updates, e->g_updates, e->s_updates, e->wallclock_time, + e->step_props); fflush(e->file_timesteps); } @@ -4385,6 +4388,7 @@ void engine_step(struct engine *e) { e->ti_old = e->ti_current; e->ti_current = e->ti_end_min; e->max_active_bin = get_max_active_bin(e->ti_end_min); + e->min_active_bin = get_min_active_bin(e->ti_current, e->ti_old); e->step += 1; e->step_props = engine_step_prop_none; @@ -5213,6 +5217,7 @@ void engine_init( e->time_begin = 0.; e->time_end = 0.; e->max_active_bin = num_time_bins; + e->min_active_bin = 1; e->internal_units = internal_units; e->timeFirstSnapshot = parser_get_param_double(params, "Snapshots:time_first"); @@ -5508,12 +5513,13 @@ void engine_config(int restart, struct engine *e, "Version: %s \n# " "Number of threads: %d\n# Number of MPI ranks: %d\n# Hydrodynamic " "scheme: %s\n# Hydrodynamic kernel: %s\n# No. of neighbours: %.2f " - "+/- %.4f\n# Eta: %f\n", + "+/- %.4f\n# Eta: %f\n# Config: %s\n# CFLAGS: %s\n", hostname(), git_branch(), git_revision(), compiler_name(), compiler_version(), e->nr_threads, e->nr_nodes, SPH_IMPLEMENTATION, kernel_name, e->hydro_properties->target_neighbours, e->hydro_properties->delta_neighbours, - e->hydro_properties->eta_neighbours); + e->hydro_properties->eta_neighbours, configuration_options(), + compilation_cflags()); fprintf(e->file_timesteps, "# Step Properties: Rebuild=%d, Redistribute=%d, Repartition=%d, " @@ -5523,9 +5529,9 @@ void engine_config(int restart, struct engine *e, engine_step_prop_snapshot, engine_step_prop_restarts); fprintf(e->file_timesteps, - "# %6s %14s %14s %12s %12s %12s %16s [%s] %6s\n", "Step", "Time", - "Time-step", "Updates", "g-Updates", "s-Updates", - "Wall-clock time", clocks_getunit(), "Props"); + "# %6s %14s %14s %9s %12s %12s %12s %16s [%s] %6s\n", "Step", + "Time", "Time-step", "Time-bins", "Updates", "g-Updates", + "s-Updates", "Wall-clock time", clocks_getunit(), "Props"); fflush(e->file_timesteps); } } diff --git a/src/engine.h b/src/engine.h index 3e29b9226ff6a0d2d62e1f36fe01c4c6d9b4fb52..0fa8ca93b84760d0d92d9494f6e8e6224e3d1d9a 100644 --- a/src/engine.h +++ b/src/engine.h @@ -142,6 +142,9 @@ struct engine { /* The highest active bin at this time */ timebin_t max_active_bin; + /* The lowest active bin at this time */ + timebin_t min_active_bin; + /* Time step */ double time_step; diff --git a/src/timeline.h b/src/timeline.h index 0f38ff3e9421c122b61caf74290c170b62b2dd92..66b2c9456fb9e2e9f8b36272a9bbf3b7764523fc 100644 --- a/src/timeline.h +++ b/src/timeline.h @@ -40,6 +40,12 @@ typedef char timebin_t; /*! Fictious time-bin to hold inhibited particles */ #define time_bin_inhibited (num_time_bins + 2) +/*! Fictitious time-bin for particles not awaken */ +#define time_bin_not_awake (0) + +/*! Fictitious time-bin for particles woken up */ +#define time_bin_awake (-1) + /** * @brief Returns the integer time interval corresponding to a time bin * @@ -122,4 +128,17 @@ static INLINE timebin_t get_max_active_bin(integertime_t time) { return bin; } +/** + * @brief Returns the lowest active time bin at a given point on the time line. + * + * @param ti_current The current point on the time line. + * @param ti_old The last synchronisation point on the time line. + */ +static INLINE timebin_t get_min_active_bin(integertime_t ti_current, + integertime_t ti_old) { + + const timebin_t min_bin = get_max_active_bin(ti_current - ti_old); + return (ti_old > 0) ? min_bin : (min_bin - 1); +} + #endif /* SWIFT_TIMELINE_H */