diff --git a/gridtk/script/jman.py b/gridtk/script/jman.py index be55011a1de466842d6b92a6fdfa348ea7a82148..6de271209913078e1ea6bc7664f09e4b84b6c2c3 100644 --- a/gridtk/script/jman.py +++ b/gridtk/script/jman.py @@ -205,6 +205,9 @@ def run_scheduler(args): def list(args): """Lists the jobs in the given database.""" jm = setup(args) + if not args.local: + # update the status of jobs from SGE before listing them. + jm.communicate(job_ids=get_ids(args.job_ids)) 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, print_times=args.print_times, ids_only=args.ids_only, names=args.names) diff --git a/gridtk/sge.py b/gridtk/sge.py index 2d5255c328ff5f50f7dcfa9346e5145fef2a779b..95945dafed1a1f111b1659fdc74858b6c4e6e99b 100644 --- a/gridtk/sge.py +++ b/gridtk/sge.py @@ -200,7 +200,7 @@ class JobManagerSGE(JobManager): if job.status in ('executing', 'queued', 'waiting'): qdel(job.id, context=self.context) logger.info("Stopped job '%s' in the SGE grid." % job) - job.submit() + job.submit() self.session.commit() self.unlock()