Package schrodinger :: Package job :: Module queue :: Class JobControlJob
[hide private]
[frames] | no frames]

Class JobControlJob

object --+    
         |    
   BaseJob --+
             |
            JobControlJob

This class defines a job control job to be run under JobDJ.

Instance Methods [hide private]
 
__init__(self, command, command_dir=None, **kwargs)
Job constructor.
 
getJob(self)
Return the job record as a schrodinger.job.jobcontrol.Job instance.
 
runsLocally(self)
Return True if the job runs on the JobDJ control host, False if not.
 
_readAgain(self)
Update the jobcontrol.Job object from the database.
 
__getstate__(self)
Return the object state to be serialized by pickle.
 
__setstate__(self, state_dict)
Reset state from a pickle.
 
update(self)
Checks for changes in job status, and updates the object appropriately (marks for restart, etc).
 
_markFinished(self, action)
Marks the job as finished.
 
_hasDied(self, action)
Tells JobDJ to restart the job next-time-around.
 
doCommand(self, *args, **kwargs)
Two values are required in the args list, and are used as host and local.
 
getCommand(self)
A hook method that can allow for the command to be generated at run time.
 
cancelSubmitted(self)
If the job is still in the 'submitted' state, cancel it.
 
maxFailuresReached(self, msg)
Print an error summary, including the last 20 lines of the first log file from the LogFiles list in the job record.
 
getStatusStrings(self)
Return a tuple of status strings for printing by JobDJ.
 
__str__(self)
str(x)

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

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

Class Variables [hide private]

Inherited from BaseJob: init_count

Properties [hide private]

Inherited from BaseJob: state

Inherited from object: __class__

Method Details [hide private]

__init__(self, command, command_dir=None, **kwargs)
(Constructor)

 

Job constructor.

Parameters:
  • command (List of strings.) - The command that runs the job.
  • kwargs (dict) - Additional keyword arguments. Provided for consistency of interface in subclasses.
Overrides: object.__init__

getJob(self)

 

Return the job record as a schrodinger.job.jobcontrol.Job instance.

Returns None if the job hasn't been launched.

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: BaseJob.runsLocally
(inherited documentation)

_readAgain(self)

 

Update the jobcontrol.Job object from the database.

Returns:
True if the record was successfully updated, False if not. Failures to update are usually due to high network traffic.
Raises:
  • Runtime - If the job record is missing.

update(self)

 

Checks for changes in job status, and updates the object appropriately (marks for restart, etc). Raises a RuntimeError if an unknown Job Status or ExitStatus is encountered.

Overrides: BaseJob.update

doCommand(self, *args, **kwargs)

 

Two values are required in the args list, and are used as host and local.

Launch job on specified host using jobcontrol.launch_job(). The -LOCAL flag is added to the job invocation command if local is True.

Overrides: BaseJob.doCommand

cancelSubmitted(self)

 

If the job is still in the 'submitted' state, cancel it.

Return True if this was successful, False otherwise.

Overrides: BaseJob.cancelSubmitted

maxFailuresReached(self, msg)

 

Print an error summary, including the last 20 lines of the first log file from the LogFiles list in the job record.

Overrides: BaseJob.maxFailuresReached

getStatusStrings(self)

 

Return a tuple of status strings for printing by JobDJ.

The strings returned are (status, jobid, name, host).

Overrides: BaseJob.getStatusStrings
(inherited documentation)

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)