Package PyFoam :: Package Execution :: Module FoamThread :: Class FoamThread
[hide private]
[frames] | no frames]

Class FoamThread

source code


Thread running an OpenFOAM command

The output of the command can be accessed in a thread-safe manner, line by line

Designed to be used by the BasicRunner-class

Instance Methods [hide private]
 
__init__(self, cmdline, runner)
This constructor should always be called with keyword arguments.
source code
 
check(self)
Returns: False if there is no more output of the command
source code
 
cpuSystemTime(self)
Returns: number of seconds CPU-Time used in system mode
source code
 
cpuTime(self)
Returns: number of seconds CPU-Time used
source code
 
cpuUserTime(self)
Returns: number of seconds CPU-Time used in user mode
source code
 
getLine(self)
gets the last line from the output
source code
 
getReturnCode(self) source code
 
interrupt(self)
A keyboard-interrupt is reported
source code
 
read(self)
read another line from the output
source code
 
run(self)
start the command
source code
 
setState(self, state)
sets the state of the thread (is there any more output)
source code
 
stopTimer(self) source code
 
usedMemory(self)
Returns: maximum resident set size in MegaByte
source code
 
wallTime(self)
Returns: the wall-clock-time needed by the process
source code

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__

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, cmdline, runner)
(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:
  • cmdline - cmdline - Command line of the OpenFOAM command
  • runner - the Runner-object that started this thread
Overrides: object.__init__

check(self)

source code 
Returns:
False if there is no more output of the command

cpuSystemTime(self)

source code 
Returns:
number of seconds CPU-Time used in system mode

cpuTime(self)

source code 
Returns:
number of seconds CPU-Time used

cpuUserTime(self)

source code 
Returns:
number of seconds CPU-Time used in user mode

run(self)

source code 

start the command

Overrides: threading.Thread.run

usedMemory(self)

source code 
Returns:
maximum resident set size in MegaByte

wallTime(self)

source code 
Returns:
the wall-clock-time needed by the process