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