From 8d104aef5465cde8c58ce36a5a018b4ef5b7950a Mon Sep 17 00:00:00 2001
From: Pedro Gonnet <pedro.gonnet@durham.ac.uk>
Date: Sat, 20 Oct 2012 17:48:11 +0000
Subject: [PATCH] fix task acceptance criteria.

Former-commit-id: 9d976c58a7f5984d4e081dbcd211b799e61ab6f6
---
 src/queue.c  | 3 ++-
 src/queue.h  | 4 ++++
 src/runner.c | 2 +-
 src/runner.h | 3 ---
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/queue.c b/src/queue.c
index f1845b3a2c..f14db6a569 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -343,7 +343,8 @@ struct task *queue_gettask_new ( struct queue *q , int rid , int blocking , int
             score_best = score;
             
             /* Should we bother looking any farther? */
-            if ( score_best == 2 )
+            if ( ( qtasks[ qtid[ ind_best ] ].cj == NULL && score_best == 1 ) ||
+                score_best == 2 );
                 break;
         
             } /* loop over the task IDs. */
diff --git a/src/queue.h b/src/queue.h
index 5c872e9940..e8fc4930ee 100644
--- a/src/queue.h
+++ b/src/queue.h
@@ -18,6 +18,10 @@
  ******************************************************************************/
 
 
+/* Some constants. */
+#define queue_maxhits            10
+
+
 /* The queue timers themselves. */
 enum {
     queue_timer_none = 0,
diff --git a/src/runner.c b/src/runner.c
index daaf68ea84..f224eef17b 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -1079,7 +1079,7 @@ void *runner_main ( void *data ) {
             TIMER_TIC
             t = NULL;
             if ( r->nr_queues == 1 ) {
-                t = queue_gettask_new( &r->queues[0] , rt->id , 1 , 0 );
+                t = queue_gettask( &r->queues[0] , 1 , 0 );
                 }
             else if ( r->policy & runner_policy_steal ) {
                 if ( ( myq->next == myq->count ) ||
diff --git a/src/runner.h b/src/runner.h
index 1549fe7e16..c06a24aca8 100644
--- a/src/runner.h
+++ b/src/runner.h
@@ -37,9 +37,6 @@ enum {
     runner_timer_dopair,
     runner_timer_dosub,
     runner_timer_getpair,
-    runner_timer_queue,
-    runner_timer_tree,
-    runner_timer_bubble,
     runner_timer_steal,
     runner_timer_stalled,
     runner_timer_count,
-- 
GitLab