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

Class TestQueue

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.
 
printStatus(self, job=None, action=None)
Prints the status of JobDJ and the action/status for the job.
 
printHeader(self)
Print the header
None
formatStatus(self, job=None, action=None)
Override to print script ID.
 
_setLoggerVerbosity(self)
 
_start(self)
Perform startup activities for JobDJ, including printing headers and marking jobs for restart if JobDJ is restarting.
 
addJob(self, job, add_connected=True, timeout=None, **kwargs)
Add a job to run.
 
slowJobKiller(self)
Kills slow jobs.
 
_jobFailed(self, job)
A method to keep track of completely failed jobs and die if max_failures is exceeded.

Inherited from job.queue.JobDJ: __setstate__, active_jobs, all_jobs, disableSmartDistribution, dump, failed_jobs, getActiveProcCounts, hasStarted, isComplete, killJobs, markForRestart, run, setHostList, total_added, updatedJobs

Class Variables [hide private]

Inherited from job.queue.JobDJ: done_jobs, waiting_jobs

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 altogether, 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: job.queue.JobDJ.__init__

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

 

Prints the status of JobDJ and the action/status for the job.

If no job is specified, prints the status header.

If no action is specified, the status_string attribute of the job is used.

Overrides: job.queue.JobDJ.printStatus
(inherited documentation)

formatStatus(self, job=None, action=None)

 

Override to print script ID.

Parameters:
Returns: None

_start(self)

 

Perform startup activities for JobDJ, including printing headers and marking jobs for restart if JobDJ is restarting.

Raises:
  • RuntimeError - If no jobs have been added to JobDJ.
Overrides: job.queue.JobDJ._start
(inherited documentation)

addJob(self, job, add_connected=True, timeout=None, **kwargs)

 

Add a job to run. If job is not a BaseJob instance, a BaseJob instance is constructed with job as the first argument. The default BaseJob class for the JobDJ instance can be specified in the constructor.

Additional keyword arguments are passed on to the Job constructor.

All job prerequisites and dependencies need to be specified before adding a job to JobDJ.

Parameters:
  • add_connected - If True, for jobs with dependencies only one job per connected group should be added and all connected jobs will be discovered and added automatically. If False, it is the user's responsibility to make sure that any prerequisites of a job are also added.
Overrides: job.queue.JobDJ.addJob
(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.

_jobFailed(self, job)

 

A method to keep track of completely failed jobs and die if max_failures is exceeded.

Overrides: job.queue.JobDJ._jobFailed