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

Fixed bug in resubmission of jobs with no dependencies (which finally were...

Fixed bug in resubmission of jobs with no dependencies (which finally were dependent on all jobs of the database).
parent b777993c
......@@ -81,8 +81,10 @@ class JobManager:
def get_jobs(self, job_ids = None):
"""Returns a list of jobs that are stored in the database."""
if job_ids is not None and len(job_ids) == 0:
return []
q = self.session.query(Job)
if job_ids:
if job_ids is not None:
q = q.filter(Job.unique.in_(job_ids))
return sorted(list(q), key=lambda job: job.unique)
......@@ -289,7 +289,7 @@ class Job(Base):
command_line = "<" + ",".join(["%s=%s" % (key,value) for key,value in grid_opt.iteritems()]) + ">: " + command_line
if dependencies:
deps = str(sorted(list(set([ for dep in self.get_jobs_we_wait_for()]))))
deps = str(sorted(list(set([dep.unique for dep in self.get_jobs_we_wait_for()]))))
if dependencies < len(deps):
deps = deps[:dependencies-3] + '...'
return format.format(self.unique, job_id, queue, status,, deps, command_line)
......@@ -69,7 +69,7 @@ class JobManagerSGE(JobManager):
# set the grid id of the job
job.queue(new_job_id = int(status['job_number']), new_job_name = status['job_name'], queue_name = self._queue(status))"Submitted job '%s' to the SGE grid." % job)"Submitted job '%s' with dependencies '%s' to the SGE grid." % (job, str(deps)))
if 'io_big' in kwargs and kwargs['io_big'] and ('queue' not in kwargs or kwargs['queue'] == 'all.q'):
logger.warn("This job will never be executed since the 'io_big' flag is not available for the 'all.q'.")
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment