Commit ce7985e5 authored by Laurent EL SHAFEY's avatar Laurent EL SHAFEY
Browse files

Fix queue specification

parent 53629cad
......@@ -133,11 +133,12 @@ class Job:
return "%d %s%s" % (value, translate[unit], plural)
def queue(self):
"""The hard resource_list comes like this: 'qname=all.q mem=128M'. To
"""The hard resource_list comes like this: '<qname>=TRUE mem=128M'. To
process it we have to split it twice (spaces and then on '='), create a
dictionary and extract just the qname"""
return dict([k.split('=') for k in self.data['hard resource_list'].split()])['qname']
if not 'hard resource_list' in self.data: return 'all.q'
return dict([reversed(k.split('=')) for k in self.data['hard resource_list'].split()])['TRUE']
def __std_filename__(self, indicator, instance):
......
......@@ -33,7 +33,7 @@ def makedirs_safe(fulldir):
if exc.errno == errno.EEXIST: pass
else: raise
def qsub(command, queue='all.q', cwd=True, name=None, deps=[], stdout='',
def qsub(command, queue=None, cwd=True, name=None, deps=[], stdout='',
stderr='', env=[], array=None, context='grid'):
"""Submits a shell job to a given grid queue
......@@ -95,7 +95,10 @@ def qsub(command, queue='all.q', cwd=True, name=None, deps=[], stdout='',
Returns a list of job ids assigned to this job (integers)
"""
scmd = ['qsub', '-l', 'qname=%s' % queue]
scmd = ['qsub']
if queue and (queue != 'all.q') and (queue != 'default'):
scmd += ['-l', queue]
if cwd: scmd += ['-cwd']
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment