1 """Check for Execution-Time information"""
2
3 import re
4
6 """@Return: The regular expression that parses the execution time
7 depending on the OpenFOAM-Version"""
8
9 if foamVersionNumber()>=(1,3):
10 return "^ExecutionTime = (.+) s ClockTime = (.+) s$"
11 else:
12 return "^ExecutionTime = (.+) s$"
13
14
15
16
17 from GeneralLineAnalyzer import GeneralLineAnalyzer
18
19 from PyFoam.FoamInformation import foamVersionNumber
20
22 """Parses lines for the execution time"""
23
24 - def __init__(self,doTimelines=True,doFiles=True):
38
40 self.time=float(match.group(1))
41 if self.hasClock:
42 self.clock=float(match.group(2))
43
45 self.lastTime = self.time
46 if self.hasClock:
47 self.lastClock = self.clock
48
50 self.files.write("executionTime",self.parent.getTime(),(self.time,self.time-self.lastTime))
51
52 if self.hasClock:
53 self.files.write("wallClockTime",self.parent.getTime(),(self.clock,self.clock-self.lastClock))
54
56 self.lines.setValue("cpu",self.time-self.lastTime)
57
58 if self.hasClock:
59 self.lines.setValue("clock",self.clock-self.lastClock)
60
62 """Parses lines for the execution time"""
63
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
82 """Parses lines for the execution time"""
83
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110