Class for running commands/jobs in parallel under jobcontrol.
Create an instance of this class, add commands to run with .addJob(),
and then call run(). Alternatively, use the the updatedJobs() iterator to
get access to each job as it changes state.
|
__init__(self,
hosts=None,
local=False,
max_retries=None,
default_max_retries=0,
max_failures=None,
verbosity=' quiet ' ,
job_class=<class 'schrodinger.job.queue.JobControlJob'>,
update_delay=None)
Constructor. |
|
|
|
hasStarted(self)
Returns True if JobDJ has started already |
|
|
|
isComplete(self)
Returns True if JobDJ has completed, False otherwise. |
|
|
|
markForRestart(self,
job,
action)
Mark a job as dead, but make sure that it gets restarted. |
|
|
|
_checkMessaging(self)
Check to see if use of job control messaging is possible. |
|
|
|
__setstate__(self,
state_dict)
Reset state from a pickle. |
|
|
|
|
|
|
|
|
|
|
|
|
|
killJobs(self)
Kill all active jobs |
|
|
|
addJob(self,
job,
add_connected=True,
**kwargs)
Add a job to run. |
|
|
|
_queueJob(self,
job)
Add a job to a queue heap. |
|
|
|
dump(self,
filename)
Pickle the JobDJ instance to the specified file name. |
|
|
|
|
|
|
|
_availableHost(self,
required_procs=1)
Return the next available host name from the host list. |
|
|
|
getActiveProcCounts(self)
Return a dictionary containing the number of active jobs on each
host. |
|
|
|
setHostList(self,
host_list)
Tell JobDJ to use the specified host list. |
|
|
|
printStatus(self,
job=None,
action=None)
Prints the status of JobDJ and the action/status for the
job. |
|
|
|
_start(self,
restart_failed=True)
Perform startup activities for JobDJ , including printing
headers and marking jobs for restart if JobDJ is
restarting. |
|
|
|
run(self,
status_change_callback=None,
periodic_callback=None,
callback_interval=300,
restart_failed=True)
Call this method to run all jobs that have been added. |
|
|
|
updatedJobs(self,
periodic_callback=None,
callback_interval=300,
restart_failed=True)
A generator that starts job distribution and yields each job as its
status changes. |
|
|
|
_checkSubmitted(self,
last_job)
Cancel a job in the 'submitted' state if possible and move it back
into the job queue to be restarted. |
|
|
|
|
|
_monitorJobs(self,
max_starts=5)
A private generator that implements the guts of the updatedJobs
generator. |
|
|
|
_getMessages(self)
Update any messages from jmonitor. |
|
|
|
_jobFailed(self,
job)
A method to keep track of completely failed jobs and die if
max_failures is exceeded. |
|
|
|
_jobFinished(self,
job)
Take some standard steps on successful completion of a job. |
|
|
|
_startJobs(self,
max_starts=None)
A generator to start as many jobs as possible, given the current open
hosts. |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|