From 89581b1a5aab5cb69eb47b86bd6536b8acd6288b Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Fri, 16 Mar 2012 20:34:34 -0700 Subject: [PATCH] Use shorter, more tolerant work queue --- worker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker.py b/worker.py index a0fddd9..45c57b5 100644 --- a/worker.py +++ b/worker.py @@ -23,7 +23,7 @@ pycuda = None # The default maximum number of waiting jobs. Also used to determine when a # job has expired. -QUEUE_LENGTH=50 +QUEUE_LENGTH=10 def partition(pred, arg): return filter(pred, arg), filter(lambda a: not pred(a), arg) @@ -212,7 +212,7 @@ def run_jobs(r, rev, jobs): pending.pop(sidx) else: print 'Got two responses for %d' % sidx - if retry and retry[0] < sidx - 2 * QUEUE_LENGTH: + if retry and retry[0] < sidx - 4 * QUEUE_LENGTH: # TODO: ensure that this doesn't happen accidentally; raise an # appropriate exception when it does print "Double retry!"