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

Class FoamThread

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        FoamThread

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)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
run(self)
start the command
source code
 
getReturnCode(self) source code
 
stopTimer(self) source code
 
read(self)
read another line from the output
source code
 
getLine(self)
gets the last line from the output
source code
 
interrupt(self)
A keyboard-interrupt is reported
source code
 
setState(self, state)
sets the state of the thread (is there any more output)
source code
 
check(self)
Returns: False if there is no more output of the command
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
 
cpuSystemTime(self)
Returns: number of seconds CPU-Time used in system mode
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, join, setDaemon, setName, start

Inherited from threading.Thread (private): _set_daemon

Inherited from threading._Verbose (private): _note

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cmdline, runner)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • cmdline - cmdline - Command line of the OpenFOAM command
  • runner - the Runner-object that started this thread
Overrides: object.__init__

run(self)

source code 

start the command

Overrides: threading.Thread.run

check(self)

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

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

cpuSystemTime(self)

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

usedMemory(self)

source code 
Returns:
maximum resident set size in MegaByte

wallTime(self)

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