From c16a31fea4d5bfe30ba31458741e08b61ebbc786 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Sun, 25 Mar 2018 16:29:53 +0200 Subject: [PATCH] Print the current redshift to stdout alongside the scale-factor. --- examples/main.c | 16 ++++++++-------- src/engine.c | 8 ++++---- src/space.c | 6 ++---- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/examples/main.c b/examples/main.c index f490465822..7dc4889c90 100644 --- a/examples/main.c +++ b/examples/main.c @@ -861,10 +861,10 @@ int main(int argc, char *argv[]) { /* Legend */ if (myrank == 0) - printf("# %6s %14s %14s %14s %9s %12s %12s %12s %16s [%s] %6s\n", "Step", - "Time", "Scale-factor", "Time-step", "Time-bins", "Updates", - "g-Updates", "s-Updates", "Wall-clock time", clocks_getunit(), - "Props"); + printf("# %6s %14s %14s %10s %14s %9s %12s %12s %12s %16s [%s] %6s\n", + "Step", "Time", "Scale-factor", "Redshift", "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); @@ -1020,10 +1020,10 @@ int main(int argc, char *argv[]) { if (myrank == 0) { /* Print some information to the screen */ - printf(" %6d %14e %14e %14e %4d %4d %12zu %12zu %12zu %21.3f %6d\n", - e.step, e.time, e.cosmology->a, 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); + printf(" %6d %14e %14e %10.5f %14e %4d %4d %12zu %12zu %12zu %21.3f %6d\n", + e.step, e.time, e.cosmology->a, e.cosmology->z, 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, diff --git a/src/engine.c b/src/engine.c index b66ceb4037..5dc13804c4 100644 --- a/src/engine.c +++ b/src/engine.c @@ -4371,10 +4371,10 @@ void engine_step(struct engine *e) { if (e->nodeID == 0) { /* Print some information to the screen */ - printf(" %6d %14e %14e %14e %4d %4d %12zu %12zu %12zu %21.3f %6d\n", - e->step, e->time, e->cosmology->a, 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); + printf(" %6d %14e %14e %10.5f %14e %4d %4d %12zu %12zu %12zu %21.3f %6d\n", + e->step, e->time, e->cosmology->a, e->cosmology->z, 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, diff --git a/src/space.c b/src/space.c index dd591f289b..f8564c0bc5 100644 --- a/src/space.c +++ b/src/space.c @@ -3245,11 +3245,9 @@ void space_generate_gas(struct space *s, const struct cosmology *cosmo, p->id = gp_gas->id_or_neg_offset * 2 + 1; gp_dm->id_or_neg_offset *= 2; - if(gp_dm->id_or_neg_offset <= 0) - error("DM particle ID overflowd"); + if (gp_dm->id_or_neg_offset <= 0) error("DM particle ID overflowd"); - if(p->id <= 0) - error("gas particle ID overflowd"); + if (p->id <= 0) error("gas particle ID overflowd"); /* Set the links correctly */ p->gpart = gp_gas; -- GitLab