@@ -103,19 +103,19 @@ def get_memlimit_per_process(self, queue):
103
103
if queue not in self .queues :
104
104
raise ValueError ('Unknown queue: {:s}' .format (queue ))
105
105
106
- lim = self ._query ('qconf -sq ' + queue +
107
- '| grep h_vmem | awk {\' print $2\' }' )[0 ]
106
+ lim = self ._query ('qconf -sq ' + queue + (
107
+ '| grep h_vmem | awk {\' print $2\' }' ) )[0 ]
108
108
109
- _ , lim_int , lim_units = re .split ('(\d+)' , lim )
109
+ _ , lim_int , lim_units = re .split (r '(\d+)' , lim )
110
110
assert isinstance (int (lim_int ), int )
111
111
assert isinstance (lim_units , string_types )
112
112
113
113
return (lim )
114
114
115
115
def _check_parallel_env (self , queue , pe_name ):
116
116
"""Check that a PE is in the pe_list for a given queue"""
117
- pes = self ._query ('qconf -sq ' + queue +
118
- '| grep pe_list' )[0 ] # just one line
117
+ pes = self ._query ('qconf -sq ' + queue + (
118
+ '| grep pe_list' )) [0 ] # just one line
119
119
pe_list = pes .split ()[1 :]
120
120
if pe_name not in pe_list :
121
121
raise ValueError ('Queue \' {0}\' does not support the \' {1}\' '
@@ -238,14 +238,14 @@ def __init__(self,
238
238
'Maximum number of parallel threads is one (1) when total '
239
239
'memory consumption is specified.' )
240
240
# XXX would be nice with some sanity checking here...
241
- _ , totmem , totmem_unit = re .split ('(\d+)' , self .total_memory )
242
- _ , memlim , memlim_unit = re .split ('(\d+)' , h_vmem )
241
+ _ , totmem , totmem_unit = re .split (r '(\d+)' , self .total_memory )
242
+ _ , memlim , memlim_unit = re .split (r '(\d+)' , h_vmem )
243
243
244
244
if totmem_unit != memlim_unit :
245
245
units = dict (k = 1e3 , m = 1e6 , g = 1e9 , t = 1e12 )
246
246
try :
247
247
ratio = units [totmem_unit .lower ()] / \
248
- units [memlim_unit .lower ()]
248
+ units [memlim_unit .lower ()]
249
249
except KeyError :
250
250
raise ValueError ('Something is wrong with the memory units'
251
251
', likely {:s}' .format (self .total_memory ))
@@ -310,9 +310,9 @@ def _initialise_cmd(self, value):
310
310
def _create_qsub_script (self , job_name , cwd_flag , opt_threaded_flag ,
311
311
opt_h_vmem_flag , log_name_prefix ):
312
312
"""All variables should be defined"""
313
- if (self .cmd is None or self .queue is None or job_name is None
314
- or cwd_flag is None or opt_threaded_flag is None
315
- or opt_h_vmem_flag is None ):
313
+ if (self .cmd is None or self .queue is None or job_name is None or
314
+ cwd_flag is None or opt_threaded_flag is None or
315
+ opt_h_vmem_flag is None ):
316
316
raise ValueError ('This should not happen, please report an Issue!' )
317
317
318
318
self ._qsub_script = \
@@ -367,7 +367,7 @@ def submit(self, fake=False, sh_file='~/submit_job.sh'):
367
367
else :
368
368
# py2-3 safety
369
369
output = output .decode ('ascii' , 'ignore' ).rstrip ()
370
- m = re .search ('(\d+)' , output )
370
+ m = re .search (r '(\d+)' , output )
371
371
self ._jobid = m .group (1 )
372
372
if self ._cleanup_qsub_job :
373
373
self ._delete_qsub_job ()
@@ -387,8 +387,8 @@ def _check_status(self):
387
387
' | awk \' {print $5, $8}\' ' )[0 ] # ONLY
388
388
389
389
if len (output ) == 0 :
390
- if (self ._submitted and not self ._running and not self . _completed
391
- and not self ._waiting ):
390
+ if (self ._submitted and not self ._running and not
391
+ self . _completed and not self ._waiting ):
392
392
self ._status_msg = ('Submission failed, see log for'
393
393
' output errors!' )
394
394
elif self ._submitted and not self ._completed :
@@ -485,8 +485,8 @@ def verbose(self, value):
485
485
def kill (self , jobid = None ):
486
486
"""Kill (delete) all the jobs in the batch."""
487
487
for job in self ._joblist :
488
- if (jobid is None
489
- or ( jobid is not None and int (job ._jobid ) == int (jobid ))):
488
+ if (jobid is None or (
489
+ jobid is not None and int (job ._jobid ) == int (jobid ))):
490
490
job .kill ()
491
491
492
492
def build_cmd (self ):
0 commit comments