From 2bdeb8c356d20eadb3aee3ef17d01fb5e19f56d8 Mon Sep 17 00:00:00 2001
From: "Peter W. Draper" <p.w.draper@durham.ac.uk>
Date: Mon, 14 Aug 2017 16:56:30 +0100
Subject: [PATCH] Report the number of tasks in use when the overflow happened

---
 src/scheduler.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/scheduler.c b/src/scheduler.c
index 5b818830e5..9170b01616 100644
--- a/src/scheduler.c
+++ b/src/scheduler.c
@@ -772,8 +772,8 @@ struct task *scheduler_addtask(struct scheduler *s, enum task_types type,
   const int ind = atomic_inc(&s->tasks_next);
 
   /* Overflow? */
-  if (ind >= s->size) error("Task list overflow. Need to increase "
-                            "Scheduler:tasks_per_cell.");
+  if (ind >= s->size) error("Task list overflow (%d). Need to increase "
+                            "Scheduler:tasks_per_cell.", ind);
 
   /* Get a pointer to the new task. */
   struct task *t = &s->tasks[ind];
-- 
GitLab