Package src :: Module pyflow :: Class CommandTaskRunner
[hide private]
[frames] | no frames]

Class CommandTaskRunner

source code


Parent to local and SGE TaskRunner specializations for command tasks

Instance Methods [hide private]
 
__init__(self, runStatus, runid, taskStr, cmd, nCores, memMb, retry, isDryRun, outFile, errFile, tmpDir, schedulerArgList, sharedFlowLog, setRunstate)
This constructor should always be called with keyword arguments.
source code
 
initFileSystemItems(self) source code
 
_run(self)
Outer loop of _run() handles task retry behavior:
source code
 
getExitMsg(self)
Attempt to extract exit message from a failed command task, do not complain in case of any errors in task signal file for this case.
source code
 
getWrapFileResult(self)
When the task is theoretically done, go and read the task wrapper to see the actual task exit code.
source code
 
getWrapperErrorMsg(self) source code

Inherited from BaseTaskRunner: errorLog, flowLog, infoLog, run, setInitialRunstate, setRunstate, warningLog

Inherited from StoppableThread: stop, stopped

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, is_alive, join, setDaemon, setName, start

Inherited from threading.Thread (private): _reset_internal_locks, _set_daemon, _set_ident

Inherited from threading._Verbose (private): _note

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

Static Methods [hide private]

Inherited from StoppableThread: stopAll

Class Variables [hide private]
  taskWrapper = '/home/csaunders/devel/pyflow/pyflow/src/pyflowT...

Inherited from StoppableThread (private): _stopAll

Properties [hide private]

Inherited from threading.Thread: daemon, ident, name

Inherited from threading.Thread (private): _block

Inherited from object: __class__

Method Details [hide private]

__init__(self, runStatus, runid, taskStr, cmd, nCores, memMb, retry, isDryRun, outFile, errFile, tmpDir, schedulerArgList, sharedFlowLog, setRunstate)
(Constructor)

source code 

This constructor should always be called with keyword arguments. Arguments are:

*group* should be None; reserved for future extension when a ThreadGroup class is implemented.

*target* is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called.

*name* is the thread name. By default, a unique name is constructed of the form "Thread-N" where N is a small decimal number.

*args* is the argument tuple for the target invocation. Defaults to ().

*kwargs* is a dictionary of keyword arguments for the target invocation. Defaults to {}.

If a subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.__init__()) before doing anything else to the thread.

Parameters:
  • outFile - stdout file
  • errFile - stderr file
  • tmpDir - location to write files containing output from the task wrapper script (and not the wrapped task)
Overrides: object.__init__

getWrapFileResult(self)

source code 

When the task is theoretically done, go and read the task wrapper to see the actual task exit code. This is required because:

1) On SGE or similar: We have no other way to get the exit code

2) On all systems, we can distinguish between a conventional task error and other problems, such as (a) linux OOM killer (b) exception in the task wrapper itself (c) filesystem failures.


Class Variable Details [hide private]

taskWrapper

Value:
'/home/csaunders/devel/pyflow/pyflow/src/pyflowTaskWrapper.py'