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

Source Code for Module PyFoam.Execution.AnalyzedRunner

 1  #  ICE Revision: $Id: /local/openfoam/Python/PyFoam/PyFoam/Execution/AnalyzedRunner.py 7636 2011-11-30T13:54:29.838641Z bgschaid  $  
 2  """Command is run and output is analyzed""" 
 3   
 4  from BasicRunner import BasicRunner 
 5  from StepAnalyzedCommon import StepAnalyzedCommon 
 6   
7 -class AnalyzedRunner(StepAnalyzedCommon,BasicRunner):
8 """The output of a command is analyzed while being run 9 10 Side effects (files written etc) depend on the analyzer""" 11
12 - def __init__(self,analyzer, 13 argv=None, 14 silent=False, 15 logname="PyFoamSolve", 16 server=False, 17 lam=None, 18 compressLog=False, 19 restart=False, 20 noLog=False, 21 logTail=None, 22 remark=None, 23 jobId=None, 24 smallestFreq=60.):
25 """ @param analyzer: the analyzer for the output 26 argv, silent, logname, server, lam, noLog - see BasicRunner""" 27 BasicRunner.__init__(self,argv,silent,logname, 28 server=server, 29 lam=lam, 30 restart=restart, 31 compressLog=compressLog, 32 noLog=noLog, 33 logTail=logTail, 34 remark=remark, 35 jobId=jobId) 36 StepAnalyzedCommon.__init__(self, 37 logname, 38 analyzer, 39 smallestFreq=smallestFreq)
40
41 - def lineHandle(self,line):
42 """Not to be called: calls the analyzer for the current line""" 43 StepAnalyzedCommon.lineHandle(self,line) 44 BasicRunner.lineHandle(self,line)
45
46 - def lastTime(self):
47 return self.getTime()
48
49 - def firstCpuTime(self):
50 exe=self.getAnalyzer("Execution") 51 if exe==None: 52 return None 53 else: 54 return exe.timeFirst()
55
56 - def firstClockTime(self):
57 exe=self.getAnalyzer("Execution") 58 if exe==None: 59 return None 60 else: 61 return exe.clockFirst()
62
63 - def totalCpuTime(self):
64 exe=self.getAnalyzer("Execution") 65 if exe==None: 66 return None 67 else: 68 return exe.timeTotal()
69
70 - def totalClockTime(self):
71 exe=self.getAnalyzer("Execution") 72 if exe==None: 73 return None 74 else: 75 return exe.clockTotal()
76
77 - def stopHandle(self):
82