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

Removed non-working 'unfinished-also' flag from 'jman report'; updated documentation setup.

parent 7ed4ee1f
include README.rst buildout.cfg
recursive-include docs *.rst
recursive-include doc *.rst
recursive-include gridtk *.sh
......@@ -6,8 +6,7 @@ develop = .
; optional package: ipdb (for debugging)
eggs = gridtk
recipe = xbob.buildout:scripts
recipe = bob.buildout:scripts
# -*- coding: utf-8 -*-
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Manuel Guenther <>
# Tue Nov 4 18:34:42 CET 2014
# Torch5spro documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 21 18:07:34 2011.
# This file is execfile()d with the current directory set to its containing dir.
# Note that not all possible configuration values are present in this
# autogenerated file.
# All configuration values have a default; values that are commented out
# serve to show the default.
# Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
import os
import sys
import glob
import pkg_resources
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
......@@ -33,6 +31,7 @@ extensions = [
# The viewcode extension appeared only on Sphinx >= 1.0.0
......@@ -61,14 +60,17 @@ project = u'GridTk'
import time
copyright = u'%s, Idiap Research Institute' % time.strftime('%Y')
# Grab the setup entry
distribution = pkg_resources.require('gridtk')[0]
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
# The short X.Y version.
version = '1.1'
version = distribution.version
# The full version, including alpha/beta/rc tags.
release = '1.1.0'
release = distribution.version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......@@ -182,7 +184,7 @@ html_theme = 'default'
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'gridtkdoc'
htmlhelp_basename = 'gridtk_doc'
# -- Options for LaTeX output --------------------------------------------------
......@@ -227,7 +229,6 @@ latex_documents = [
rst_epilog = """
.. Some variables
.. |project| replace:: GridTk
.. |torchweb| replace::
.. |current-year| date:: %Y
......@@ -236,25 +237,15 @@ rst_epilog = """
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'torch5spro', u'GridTk Documentation',
('index', 'idiap', u'GridTk Documentation',
[u'Idiap Research Institute'], 1)
# Skips selected members in auto-generated documentation. Unfortunately, old
# versions of Boost.Python will note generate a __self__ member for static
# methods and that screws-up Sphinx processing
def skip_member(app, what, name, obj, skip, options):
# We don't use this technique if the version of Sphinx is relatively new
if sphinx.__version__ >= "1.0": return False
# Else, we have to remove objects that do not have a __self__ attribute set
import types
if isinstance(obj, types.BuiltinFunctionType) and \
not hasattr(obj, '__self__') and what == 'class':
app.warn("Skipping %s %s (no __self__)" % (what, name))
return True
# Default processing flags for sphinx
autoclass_content = 'both'
autodoc_member_order = 'bysource'
autodoc_default_flags = ['members', 'undoc-members', 'inherited-members', 'show-inheritance']
return False
def setup(app):
app.connect('autodoc-skip-member', skip_member)
......@@ -2,10 +2,12 @@
.. author: Manuel Günther <>
.. date: Fri Aug 30 14:31:49 CEST 2013
Welcome to GridTk's documentation!
.. _gridtk:
The GridTK serves as a tool to submit jobs and keep track of their dependencies and their current statusus.
Parallel Execution of Jobs in the SGE Grid or on a Local Machine
The GridTK serves as a tool to submit jobs and keep track of their dependencies and their current statuses.
These jobs can either be submitted to an SGE grid, or to be run in parallel on the local machine.
There are two main ways to interact with the GridTK.
......@@ -175,7 +175,6 @@ E.g.:
will print the contents of the output and error log file from the job with the desired ID (and only the array job with the given ID).
To report only the output or only the error logs, you can use the ``-o`` or ``-e`` option, respectively.
When some (array-)jobs are still running, use the ``-u`` option to list their current output and/or error logs.
Hopefully, that helps in debugging the problem!
......@@ -232,7 +232,7 @@ class JobManager:
def report(self, job_ids=None, array_ids=None, unfinished=False, output=True, error=True):
def report(self, job_ids=None, array_ids=None, output=True, error=True):
"""Iterates through the output and error files and write the results to command line."""
def _write_contents(job):
# Writes the contents of the output and error files to command line
......@@ -248,13 +248,11 @@ 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(, ("(%s) :"%array_job.machine_name if array_job.machine_name is not None else ":"))
print("Array Job", str(, ("(%s) :"%array_job.machine_name if array_job.machine_name is not None else ":"))
accepted_status = ('failure',) if error and not output else ('success', 'failure')
# check if an array job should be reported
if array_ids:
if len(job_ids) != 1: logger.error("If array ids are specified exactly one job id must be given.")
......@@ -267,14 +265,12 @@ class JobManager:
jobs = self.get_jobs(job_ids)
for job in jobs:
if job.array:
if unfinished or job.status in accepted_status or job.status == 'executing':
if unfinished or job.status in accepted_status:
if job.log_dir is not None and job.status in accepted_status:
if job.log_dir is not None:
......@@ -183,7 +183,7 @@ def communicate(args):
def report(args):
"""Reports the results of the finished (and unfinished) jobs."""
jm = setup(args), array_ids=get_ids(args.array_ids), unfinished=args.unfinished_also, output=not args.errors_only, error=not args.output_only), array_ids=get_ids(args.array_ids), output=not args.errors_only, error=not args.output_only)
def stop(args):
......@@ -325,7 +325,6 @@ def main(command_line_options = None):
report_parser = cmdparser.add_parser('report', aliases=['rep', 'r', 'explain', 'why'], formatter_class=formatter, help='Iterates through the result and error log files and prints out the logs.')
report_parser.add_argument('-e', '--errors-only', action='store_true', help='Only report the error logs (by default, both logs are reported).')
report_parser.add_argument('-o', '--output-only', action='store_true', help='Only report the output logs (by default, both logs are reported).')
report_parser.add_argument('-u', '--unfinished-also', action='store_true', help='Report also the unfinished jobs; use this option also to check error files for jobs with success status.')
report_parser.add_argument('-j', '--job-ids', metavar='ID', nargs='+', help='Report only the jobs with the given ids (by default, all finished jobs are reported)')
report_parser.add_argument('-a', '--array-ids', metavar='ID', nargs='+', help='Report only the jobs with the given array ids. If specified, a single job-id must be given as well.')
......@@ -9,7 +9,7 @@ if sys.version_info[:2] < (2, 7) or ((3,0) <= sys.version_info[:2] < (3,2)):
description='SGE Grid and Local Submission and Monitoring Tools for Idiap',
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