Package schrodinger :: Package test :: Package stu :: Module run :: Class TestQueue
[hide private]
[frames] | no frames]

Class TestQueue

     object --+    
              |    
job.queue.JobDJ --+
                  |
                 TestQueue

Like a normal JobDJ, but:


To Do:
Instance Methods [hide private]
 
__init__(self, hosts=None, verbosity='quiet', timeout=None)
Override to add typical defaults.
None
printStatus(self, job=None, action=None, debug=False)
Override to print script ID.
 
updatedJobs(self, periodic_callback=None, callback_interval=300)
A generator that starts job distribution and yields each job as its status changes.
 
slowJobKiller(self)
Kills slow jobs.

Inherited from job.queue.JobDJ: __setstate__, addJob, disableSmartDistribution, dump, getActiveProcCounts, hasStarted, isComplete, killJobs, markForRestart, run, setHostList

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from job.queue.JobDJ: active_jobs, all_jobs, done_jobs, failed_jobs, total_added, waiting_jobs

Inherited from job.queue.JobDJ (private): _host_list

Inherited from object: __class__

Method Details [hide private]

__init__(self, hosts=None, verbosity='quiet', timeout=None)
(Constructor)

 

Override to add typical defaults.

Parameters:
  • hosts - A host list specification. To convert a string representation from -HOST to a list, use the jobcontrol.host_str_to_list() function. If no hosts argument is specified, the hosts will be read from the job control SCHRODINGER_NODEFILE environment variable.
  • local - If True, then all jobs will run with -LOCAL. Default is False.
  • max_retries - Number of allowed retries per subjob. If this is set, it is never overridden by the SCHRODINGER_MAX_RETRIES environment variable. If it is not set, the value in default_max_retries is used, and SCHRODINGER_MAX_RETRIES is allowed to override. If you wish to disable restarting altogther, set this value to zero.
  • default_max_retries - Number of allowed retries per subjob. This value can always be overridden by the SCHRODINGER_MAX_RETRIES environment variable. Default is zero.
  • max_failures - Total number of allowed subjob failures before JobDJ exits. If it is not defined, a default of zero will be used (exit on any failure after attempting to restart), but this can be overridden with the SCHRODINGER_MAX_FAILURES environment variable. To allow an unlimited number of subjob failures, set max_failures to the module level NOLIMIT constant.
  • verbosity - There are three allowed verbosity levels: "quiet" - only warnings and errors are printed; "normal" - JobDJ progress is printed; and "verbose" - additional debugging info is printed. Default is "quiet".
  • job_class - The class to use as the default job constructor when the addJob argument is not a BaseJob instance.
  • update_delay - The number of seconds to wait between job control database reads for JobControlJob jobs. (This delay is for an individual job, not for any job database read.) Default is None, which causes the module level constant UPDATE_DELAY to be used.
Overrides: object.__init__

printStatus(self, job=None, action=None, debug=False)

 

Override to print script ID.

Parameters:
Returns: None
Overrides: job.queue.JobDJ.printStatus

updatedJobs(self, periodic_callback=None, callback_interval=300)

 

A generator that starts job distribution and yields each job as its status changes. A status change occurs when a job is started, when it finishes, or fails. The state property of the yielded job can be examined to determine its current state.

Use as:

   for job in jobdj.updatedJobs():
       if job.state == DONE and isinstance(job, JobControlJob):
           print "%s is done." % job.getJob().JobId
Overrides: job.queue.JobDJ.updatedJobs
(inherited documentation)

slowJobKiller(self)

 

Kills slow jobs. Intended to be set as a periodic callback. Uses the self.timeout attribute to determine the maximum allowed job duration.