From 98f8fde91fed3ae9138aee98ed3a377b92b393c7 Mon Sep 17 00:00:00 2001
From: Pedro Gonnet <gonnet@google.com>
Date: Fri, 17 Jun 2016 22:54:36 +0200
Subject: [PATCH] add debugging output.

---
 src/engine.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/engine.c b/src/engine.c
index 87d668f673..e8d0302d75 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -1576,7 +1576,12 @@ void engine_maketasks(struct engine *e) {
     engine_make_gravityinteraction_tasks(e);
 
   /* Split the tasks. */
-  scheduler_splittasks(sched);
+  {
+    const ticks tic = getticks();
+    scheduler_splittasks(sched);
+    message("scheduler_splittasks took %.3f %s.", clocks_from_ticks(getticks() - tic),
+            clocks_getunit());
+  }
 
   /* Allocate the list of cell-task links. The maximum number of links
      is the number of cells (s->tot_cells) times the number of neighbours (27)
@@ -1640,10 +1645,20 @@ void engine_maketasks(struct engine *e) {
   scheduler_set_unlocks(sched);
 
   /* Rank the tasks. */
-  scheduler_ranktasks(sched);
+  {
+    const ticks tic = getticks();
+    scheduler_ranktasks(sched);
+    message("scheduler_ranktasks took %.3f %s.", clocks_from_ticks(getticks() - tic),
+            clocks_getunit());
+  }
 
   /* Weight the tasks. */
-  scheduler_reweight(sched);
+  {
+    const ticks tic = getticks();
+    scheduler_reweight(sched);
+    message("scheduler_reweight took %.3f %s.", clocks_from_ticks(getticks() - tic),
+            clocks_getunit());
+  }
 
   /* Set the tasks age. */
   e->tasks_age = 0;
-- 
GitLab