Commit a937c8f1 authored by Manuel Günther's avatar Manuel Günther

Also 'submitted' (e.g. stopped, but not queued) jobs are now resubmitted by...

Also 'submitted' (e.g. stopped, but not queued) jobs are now resubmitted by default; small bug fixes.
parent d79fcc7a
......@@ -206,7 +206,7 @@ class JobManager:
self.lock()
for job in self.get_jobs(job_ids):
job.refresh()
if job.status in status and names is None or job.name in names:
if job.status in status and (names is None or job.name in names):
print(job.format(format, dependency_length, None if long else 43))
if print_array_jobs and job.array:
print(array_delimiter)
......
......@@ -106,13 +106,13 @@ def submit(args):
'name': args.name,
'env': args.env,
'memfree': args.memory,
'hvmem': args.memory,
'io_big': args.io_big,
}
if args.array is not None: kwargs['array'] = get_array(args.array)
if args.log_dir is not None: kwargs['log_dir'] = args.log_dir
if args.dependencies is not None: kwargs['dependencies'] = args.dependencies
if args.queue != 'all.q': kwargs['hvmem'] = args.memory
if args.parallel is not None:
kwargs['pe_opt'] = "pe_mth %d" % args.parallel
kwargs['memfree'] = "%d%s" % (int(args.memory.rstrip(string.ascii_letters)) * args.parallel, args.memory.lstrip(string.digits))
......@@ -136,7 +136,8 @@ def resubmit(args):
kwargs['queue'] = args.qname
if args.memory is not None:
kwargs['memfree'] = args.memory
kwargs['hvmem'] = args.memory
if args.qname not in (None, 'all.q'):
kwargs['hvmem'] = args.memory
if args.parallel is not None:
kwargs['pe_opt'] = "pe_mth %d" % args.parallel
kwargs['memfree'] = "%d%s" % (int(args.memory.rstrip(string.ascii_letters)) * args.parallel, args.memory.lstrip(string.digits))
......
......@@ -131,7 +131,7 @@ class JobManagerSGE(JobManager):
self.lock()
# iterate over all jobs
jobs = self.get_jobs(job_ids)
accepted_old_status = ('success', 'failure') if also_success else ('failure',)
accepted_old_status = ('submitted', 'success', 'failure') if also_success else ('submitted', 'failure',)
for job in jobs:
# check if this job needs re-submission
if running_jobs or job.status in accepted_old_status:
......@@ -142,6 +142,8 @@ class JobManagerSGE(JobManager):
# re-submit job to the grid
arguments = job.get_arguments()
arguments.update(**kwargs)
if ('queue' not in kwargs or kwargs['queue'] == 'all.q') and 'hvmem' in kwargs:
del kwargs['hvmem']
job.set_arguments(kwargs=arguments)
# delete old status and result of the job
job.submit()
......
Markdown is supported
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