Commit 2635bf20 authored by Manuel Günther's avatar Manuel Günther
Browse files

Corrected handling of grid ids.

parent 06e02286
......@@ -191,9 +191,9 @@ class JobManager:
array_format = "{0:>%d} {1:^%d} {2:^%d}" % lengths[:3]
array_format = "{0:^%d} {1:>%d} {2:^%d} {3:^%d}" % lengths[:4]
delimiter = format.format(*['='*k for k in lengths])
array_delimiter = array_format.format(*["-"*k for k in lengths[:3]])
array_delimiter = array_format.format(*["-"*k for k in lengths[:4]])
header = [fields[k].center(lengths[k]) for k in range(len(lengths))]
# print header
......@@ -233,7 +233,7 @@ class JobManager:
def _write_array_jobs(array_jobs):
for array_job in array_jobs:
if unfinished or array_job.status in accepted_status:
print("Array Job", str(array_job.unique), ":")
print("Array Job", str(, ":")
......@@ -57,7 +57,7 @@ class ArrayJob(Base):
queue = self.job.queue_name if self.machine_name is None else self.machine_name
status = "%s" % self.status + (" (%d)" % self.result if self.result is not None else "" )
return format.format(job_id, queue, status)
return format.format("", job_id, queue, status)
class Job(Base):
......@@ -160,7 +160,7 @@ def run_scheduler(args):
def list(args):
"""Lists the jobs in the given database."""
jm = setup(args)
jm.list(job_ids=get_ids(args.job_ids), print_array_jobs=args.print_array_jobs, print_dependencies=args.print_dependencies, status=args.status, long=args.verbose > 1 or args.long, ids_only=args.ids_only, names=args.names)
jm.list(job_ids=get_ids(args.job_ids), print_array_jobs=args.print_array_jobs, print_dependencies=args.print_dependencies, status=args.status, long=args.long, ids_only=args.ids_only, names=args.names)
def communicate(args):
......@@ -10,7 +10,7 @@ from __future__ import print_function
from .manager import JobManager
from .setshell import environ
from .models import add_job
from .models import add_job, Job
from .tools import logger, qsub, qstat, qdel, make_shell
import os, sys
......@@ -155,6 +155,17 @@ class JobManagerSGE(JobManager):
def run_job(self, job_id, array_id = None):
"""Overwrites the run-job command from the manager to extract the correct job id before calling base class implementation."""
# get the unique job id from the given grid id
job = self.session.query(Job).filter( == job_id)
job_id = list(job)[0].unique
# call base class implementation with the corrected job id
return JobManager.run_job(self, job_id, array_id)
def stop_jobs(self, job_ids):
"""Stops the jobs in the grid."""
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