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

Class TestJCJob

  job.queue.BaseJob --+    
                      |    
job.queue.JobControlJob --+
                          |
             object --+   |
                      |   |
                TestJob --+
                          |
                         TestJCJob

Like a normal JobControlJob, but:

   - Ignore failures to launch.
   - Be aware of scriptID.
   - Easily access job duration and exit status.
Instance Methods [hide private]
 
__init__(self, command, command_dir, test_id=None, timeout=None, runs_locally=False, **kwargs)
Overridden to add the test_id.
 
doCommand(self, host='localhost', local=False)
Overridden to ignore errors.
 
update(self)
Update the job.
 
runsLocally(self)
Return True if the job runs on the JobDJ control host, False if not.
float
duration(self)
Duration of the job, according to the job record.
str
exit_status(self)
Exit status of the job, according to the job record.

Inherited from job.queue.JobControlJob: __getstate__, __setstate__, __str__, cancelSubmitted, getCommand, getJob, getStatusStrings, kill, maxFailuresReached, retryFailure

Inherited from job.queue.BaseJob: __lt__, addFinalizer, addGroupPrereq, addPrereq, finalize, genAllJobs, genAllPrereqs, getCommandDir, getJobDJ, getPrereqs, hasStarted, isComplete, postCommand, preCommand, run, setup

Inherited from job.queue.BaseJob (private): _getState, _pruneGraph, _setState

Inherited from TestJob: debugStatus, infoStatus, is_done, setupTestEnvironment, test_id, warnStatus

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

Class Variables [hide private]

Inherited from job.queue.BaseJob: init_count, state

Instance Variables [hide private]
  _test_id
The test number in the database (or the directory name in validate mode.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, command, command_dir, test_id=None, timeout=None, runs_locally=False, **kwargs)
(Constructor)

 

Overridden to add the test_id.

Parameters:
  • command (list) - Command to be run.
  • command_dir (str) - Directory to run in.
  • test_id (int or str) - Unique identifier of script.
  • timeout (int or None) - Duration in seconds after which to kill the job. None is never.
  • runs_locally (bool) - Should this job be launched on localhost (never remote hosts)?
Overrides: object.__init__

doCommand(self, host='localhost', local=False)

 

Overridden to ignore errors. Executes the command described by self._command. The parent class has two required arguments, but has the call signature doCommand(*args, **kwargs), hence its usage here.

Parameters:
  • args - Required by parent: host, local
  • kwargs - All ignored
Overrides: job.queue.BaseJob.doCommand

update(self)

 

Update the job. Includes timeout logic.

Overrides: job.queue.BaseJob.update

runsLocally(self)

 

Return True if the job runs on the JobDJ control host, False if not. Jobs that run locally don't need hosts.

There is no limit on the number of locally run jobs.

Overrides: job.queue.BaseJob.runsLocally
(inherited documentation)

duration(self)

 

Duration of the job, according to the job record. Implemented as a property to provide consistent interface with TestSPJob. Also gives duration for RUNNING jobs, so as to be consistent with TestSPJob.

Returns: float
Decorators:
  • @property
Overrides: TestJob.duration

exit_status(self)

 

Exit status of the job, according to the job record. Implemented as a property to provide consistent interface with TestSPJob.

Returns: str
Decorators:
  • @property
Overrides: TestJob.exit_status