Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tom Fischer
smallscripts
Commits
ea76ec4d
Commit
ea76ec4d
authored
Aug 07, 2021
by
Tom Fischer
Browse files
Run time comparisons for different processes.
parent
1eacbdb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
plot/evaluateTimeData.py
0 → 100644
View file @
ea76ec4d
#!/bin/python
import
sys
import
pandas
as
pd
import
matplotlib.pyplot
as
plt
header_array
=
[
"branch"
,
"ctest process switch"
,
"run time"
]
df
=
pd
.
read_csv
(
sys
.
argv
[
1
],
sep
=
','
,
names
=
header_array
)
process_array
=
[
"ComponentTransport"
,
"ReactiveMassTransport"
,
"SteadyStateDiffusion"
,
"StokesFlow"
,
"HT"
,
"ThermalConvection"
,
"HeatConduction"
,
"BHE"
,
"HydroMechanics"
,
"LiquidFlow"
,
"LIE"
,
"PhaseField"
,
"ThermoRichardsMechanics"
]
branches
=
[
"master"
,
"MeshLibElementCleanup"
]
master_times
=
[]
MeshLibElementCleanup_times
=
[]
for
process
in
process_array
:
for
branch
in
branches
:
filtered_by_branch
=
df
[
df
[
'branch'
]
==
branch
]
filtered_by_process_switch
=
filtered_by_branch
[
filtered_by_branch
[
'ctest process switch'
]
==
process
]
if
(
branch
==
'master'
):
master_times
.
append
(
filtered_by_process_switch
[
'run time'
].
mean
())
if
(
branch
==
'MeshLibElementCleanup'
):
MeshLibElementCleanup_times
.
append
(
filtered_by_process_switch
[
'run time'
].
mean
())
#print(branch + ' ' + process + ' ' + str(filtered_by_process_switch['run time'].mean()))
print
(
master_times
)
print
(
MeshLibElementCleanup_times
)
final_df
=
pd
.
DataFrame
(
list
(
zip
(
process_array
,
master_times
,
MeshLibElementCleanup_times
)),
columns
=
[
'ctest process switch'
,
'master'
,
'MeshLibElementCleanup'
])
final_df
[
'relative_difference'
]
=
(
final_df
[
'master'
]
-
final_df
[
'MeshLibElementCleanup'
])
/
final_df
[
'master'
]
print
(
final_df
)
ax
=
final_df
.
plot
.
bar
(
x
=
'ctest process switch'
,
y
=
'relative_difference'
)
ax
.
set_ylabel
(
r
'$\frac{t_{branch} - t_{master}}{t_{master}}$'
)
plt
.
grid
()
plt
.
tight_layout
()
plt
.
show
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment