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