mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-04-21 00:51:31 -04:00
Use shorter, more tolerant work queue
This commit is contained in:
parent
0384815c8b
commit
89581b1a5a
@ -23,7 +23,7 @@ pycuda = None
|
|||||||
|
|
||||||
# The default maximum number of waiting jobs. Also used to determine when a
|
# The default maximum number of waiting jobs. Also used to determine when a
|
||||||
# job has expired.
|
# job has expired.
|
||||||
QUEUE_LENGTH=50
|
QUEUE_LENGTH=10
|
||||||
|
|
||||||
def partition(pred, arg):
|
def partition(pred, arg):
|
||||||
return filter(pred, arg), filter(lambda a: not pred(a), 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)
|
pending.pop(sidx)
|
||||||
else:
|
else:
|
||||||
print 'Got two responses for %d' % sidx
|
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
|
# TODO: ensure that this doesn't happen accidentally; raise an
|
||||||
# appropriate exception when it does
|
# appropriate exception when it does
|
||||||
print "Double retry!"
|
print "Double retry!"
|
||||||
|
Loading…
Reference in New Issue
Block a user