181 timeMonFig = plt.figure(figsize=(35,105))
182 memMonFig = plt.figure(figsize=(35,105))
184 for idx, step
in enumerate(componentLevelData):
186 compNames, vmemVals, cpuTimeVals, wallTimeVals, mallocVals, countVals = [],[],[],[],[],[]
187 for comp, meas
in componentLevelData[step].
items():
189 count = meas[
"count"]
190 cpuTime = meas[
"cpuTime"] * 0.001
191 wallTime = meas[
"wallTime"] * 0.001
192 malloc = meas[
"malloc"] * 0.001
193 vmem = meas[
"vmem"] * 0.001
196 if vmem < 0
or malloc < 0:
201 comp = f
"{comp[:20]}[...]{comp[-20:]}"
203 compNames.append(comp +
" [" +
str(count) +
"]")
204 vmemVals.append(vmem)
205 cpuTimeVals.append(cpuTime)
206 wallTimeVals.append(wallTime)
207 mallocVals.append(malloc)
208 countVals.append(count)
211 "cpuTime": cpuTimeVals,
212 "wallTime": wallTimeVals
217 "malloc": mallocVals,
221 sortedTimeMonCompNames, sortedTimeMonVals =
sortComponents(compNames, timeMonVals, compCountPerPlot)
222 sortedCompNamesMem, sortedMemMonVals =
sortComponents(compNames, memMonVals, compCountPerPlot)
224 timeMonAx = timeMonFig.add_subplot(len(componentLevelData),1,idx+1)
225 memMonAx = memMonFig.add_subplot(len(componentLevelData),1,idx+1)
229 "index": np.arange(len(sortedTimeMonCompNames)),
230 "width": 0.5/len(sortedTimeMonVals),
231 "vals": sortedTimeMonVals,
232 "yTickLabels": sortedTimeMonCompNames,
233 "xlabel":
"Time [sec]",
234 "ylabel":
"Components",
237 "xlabelFontSize": 50,
238 "ylabelFontSize": 50,
244 "index": np.arange(len(sortedCompNamesMem)),
245 "width": 0.5/len(sortedMemMonVals),
246 "vals": sortedMemMonVals,
247 "yTickLabels": sortedCompNamesMem,
248 "xlabel":
"Memory [MB]",
249 "ylabel":
"Components",
252 "xlabelFontSize": 50,
253 "ylabelFontSize": 50,
260 timeMonFig.set_tight_layout(
True )
261 timeMonFig.savefig(
"Component_Level_Time")
263 memMonFig.set_tight_layout(
True )
264 memMonFig.savefig(
"Component_Level_Memory")