99 Extract data from a logfile.
104 rawfilename = self.
file.strip(
".log")
105 rawfilename = rawfilename.strip(
"output_")
107 n, cmax, cmin = rawfilename.split(
"-")
108 self.
npart = int(n.strip(
"N"))
112 f = open(self.
file,
"r")
113 lines = f.readlines()
115 timing = timing.strip()
116 avmem, maxmem, walltime, cputime, usertime, cpupercent = timing.split(
",")
118 self.
maxmem = float(maxmem)
122 termline = lines[-11]
123 tl = termline.strip()
125 tl =
" ".join(tl.split())
126 _, _, _, _, _, _, terminated, successfully = tl.split()
127 if terminated !=
"terminated" or successfully !=
"successfully":
128 raise ValueError(
"Reading wrong 'terminated successfully' line:", termline)
130 gridline = lines[-10]
131 gl = gridline.strip()
132 gl =
" ".join(gl.split())
133 _, _, _, _, _, _, grid, construction, timing, _, _, _ = gl.split()
134 if grid !=
"grid" or construction !=
"construction:":
135 raise ValueError(
"Reading wrong 'grid construction' line", gridline)
136 gridtime = float(timing.strip(
"s"))
141 icl =
" ".join(icl.split())
142 _, _, _, _, _, _, initial, conditions, timing, _, _, _ = icl.split()
143 if initial !=
"initial" or conditions !=
"conditions:":
144 raise ValueError(
"Reading wrong 'initial conditions' line", icline)
145 ictime = float(timing.strip(
"s"))
149 il = initline.strip()
150 il =
" ".join(il.split())
151 _, _, _, _, _, _, initialisation, timing, _, _, _ = il.split()
152 if initialisation !=
"initialisation:":
153 raise ValueError(
"Reading wrong 'initialalisation' line", initline)
154 inittime = float(timing.strip(
"s"))
158 pl = plotline.strip()
159 pl =
" ".join(pl.split())
160 _, _, _, _, _, _, plotting, timing, _, _, _ = pl.split()
161 if plotting !=
"plotting:":
162 raise ValueError(
"Reading wrong 'plotting' line", plotline)
163 plottime = float(timing.strip(
"s"))
168 cl =
" ".join(cl.split())
169 _, _, _, _, _, _, cleanup, timing, _, _, _ = cl.split()
170 if cleanup !=
"cleanup:":
171 raise ValueError(
"Reading wrong 'cleanup' line", cleanup)
172 cleantime = float(timing.strip(
"s"))
175 timestepping = lines[-5]
176 tl = timestepping.strip()
177 tl =
" ".join(tl.split())
178 _, _, _, _, _, _, time, stepping, timing, _, _, _ = tl.split()
179 if time !=
"time" and stepping !=
"stepping:":
180 raise ValueError(
"Reading wrong 'time stepping' line", timestepping)
181 tstime = float(timing.strip(
"s"))