Package schrodinger :: Package pipeline :: Module pipeline :: Class StageJob
[hide private]
[frames] | no frames]

Class StageJob

A "Job" that is used by Pipeline to run a Stage.

Each StageJob has a Stage object associated with it. This object is periodically dumped to a file in order to support restartability. The process is called "dumping" and the file is the dump file. When Pipeline is restarted, each stage object is recovered from the associated dump file to get the latest state.

Instance Methods [hide private]
 
__init__(self, stageobj, pipeline, module)
 
_setHostPool(self)
Set the self.host_pool variable based on the stage's product.
 
setUsedHosts(self, new_host_list)
 
getUnusedHostList(self)
 
updateStageCpus(self)
Based on current host usage and number of needed cpus, determine which hosts this stage should use and send them to it in a message.
 
sendHostsToUse(self)
Send a message to the stage job telling it how many CPUS to use.
 
restart(self, action)
Mark this job to be restarted by the Pipeline.
 
finish(self)
Sets the pipe's stage object to the final finished stage object from the dump file, and parses all of the outputs.
 
readyToRun(self, objects)
Return True if this StageJob has all inputs that are required for it to start.
 
printAction(self, action)
Call the Pipeline's printAction method.
 
died(self, action)
Print error messages and the last few lines from the stage log file, then exit the Pipeline.
 
updateFromDump(self, quiet=False)
Update this stage of the pipeline to the latest state from the dump file.
 
_writeStageExecutable(self, destination)
Write a Stage executable python script that will be submitted under jobcontrol, and save it to destination.
Method Details [hide private]

__init__(self, stageobj, pipeline, module)
(Constructor)

 
Parameters:
  • pipeline - Reference to the Pipeline object.
  • stageobj (Stage) - Stage to run.
  • module - The module where the above stage is defined.

sendHostsToUse(self)

 

Send a message to the stage job telling it how many CPUS to use. Gets called periodically in case messages don't go through.

died(self, action)

 

Print error messages and the last few lines from the stage log file, then exit the Pipeline.

This gets called every time a StageJob dies and causes the Pipeline to die by raising a RuntimeError exception.

_writeStageExecutable(self, destination)

 

Write a Stage executable python script that will be submitted under jobcontrol, and save it to destination.

Parameters:
  • destination (str) - The filename to write the stage executable python script to.