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

Source Code for Module PyFoam.Execution.AnalyzedRunner

 1  #  ICE Revision: $Id$ 
 2  """Command is run and output is analyzed""" 
 3   
 4  from PyFoam.Execution.BasicRunner import BasicRunner 
 5  from PyFoam.Execution.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 parameters=None, 24 jobId=None, 25 smallestFreq=60., 26 echoCommandLine=None):
27 """ @param analyzer: the analyzer for the output 28 argv, silent, logname, server, lam, noLog - see BasicRunner""" 29 BasicRunner.__init__(self,argv,silent,logname, 30 server=server, 31 lam=lam, 32 restart=restart, 33 compressLog=compressLog, 34 noLog=noLog, 35 logTail=logTail, 36 remark=remark, 37 parameters=parameters, 38 echoCommandLine=echoCommandLine, 39 jobId=jobId) 40 StepAnalyzedCommon.__init__(self, 41 logname, 42 analyzer, 43 smallestFreq=smallestFreq) 44 45 self.writeToStateFile("LogDir",self.logDir)
46
47 - def lineHandle(self,line):
48 """Not to be called: calls the analyzer for the current line""" 49 StepAnalyzedCommon.lineHandle(self,line) 50 BasicRunner.lineHandle(self,line)
51
52 - def lastTime(self):
53 return self.getTime()
54
55 - def firstCpuTime(self):
56 exe=self.getAnalyzer("Execution") 57 if exe==None: 58 return None 59 else: 60 return exe.timeFirst()
61
62 - def firstClockTime(self):
63 exe=self.getAnalyzer("Execution") 64 if exe==None: 65 return None 66 else: 67 return exe.clockFirst()
68
69 - def totalCpuTime(self):
70 exe=self.getAnalyzer("Execution") 71 if exe==None: 72 return None 73 else: 74 return exe.timeTotal()
75
76 - def totalClockTime(self):
77 exe=self.getAnalyzer("Execution") 78 if exe==None: 79 return None 80 else: 81 return exe.clockTotal()
82
83 - def stopHandle(self):
88