From 90d7cf62cbc03640088d78832e9b29d1a60e620c Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Sat, 20 Apr 2019 18:51:52 +0200
Subject: [PATCH] Better timers output style.

---
 src/runner.c | 9 ++++++---
 src/timers.c | 6 +++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/runner.c b/src/runner.c
index b2644d1882..183204faad 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -663,11 +663,12 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
 #endif
 
   /* Anything to do here? */
-  if (c->hydro.count == 0) return;
-  if (!cell_is_active_hydro(c, e)) {
+  if (c->hydro.count == 0 || !cell_is_active_hydro(c, e)) {
     star_formation_logger_log_inactive_cell(&c->stars.sfh);
     return;
   }
+
+  /* Reset the SFR */
   star_formation_logger_init(&c->stars.sfh);
 
   /* Recurse? */
@@ -746,8 +747,10 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
           star_formation_update_part_not_SFR(p, xp, e, sf_props,
                                              with_cosmology);
 
-        }      /* Not Star-forming? */
+        } /* Not Star-forming? */
+
       } else { /* is active? */
+
         /* Check if the particle is not inhibited */
         if (!part_is_inhibited(p, e)) {
           star_formation_logger_log_inactive_part(p, xp, &c->stars.sfh);
diff --git a/src/timers.c b/src/timers.c
index 139078655d..8b0d4c4d83 100644
--- a/src/timers.c
+++ b/src/timers.c
@@ -128,7 +128,7 @@ void timers_reset_all(void) {
 void timers_print(int step) {
   fprintf(timers_file, "%d\t", step);
   for (int k = 0; k < timer_count; k++)
-    fprintf(timers_file, "%22.3f ", clocks_from_ticks(timers[k]));
+    fprintf(timers_file, "%25.3f ", clocks_from_ticks(timers[k]));
   fprintf(timers_file, "\n");
   fflush(timers_file);
 }
@@ -144,9 +144,9 @@ void timers_open_file(int rank) {
   sprintf(buff, "timers_%d.txt", rank);
   timers_file = fopen(buff, "w");
 
-  fprintf(timers_file, "# timers: \n# step | ");
+  fprintf(timers_file, "# timers: \n# step |");
   for (int k = 0; k < timer_count; k++)
-    fprintf(timers_file, "%22s ", timers_names[k]);
+    fprintf(timers_file, "%25s ", timers_names[k]);
   fprintf(timers_file, "\n");
 }
 
-- 
GitLab