Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary_c-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Izzard, Robert Dr (Maths & Physics)
binary_c-python
Commits
7723404e
Commit
7723404e
authored
5 years ago
by
David Hendriks
Browse files
Options
Downloads
Patches
Plain Diff
improved scaling tests
parent
abcc5d07
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/population/scaling/plot_scaling_new.py
+26
-14
26 additions, 14 deletions
tests/population/scaling/plot_scaling_new.py
tests/population/scaling/scaling_script.py
+1
-1
1 addition, 1 deletion
tests/population/scaling/scaling_script.py
with
27 additions
and
15 deletions
tests/population/scaling/plot_scaling_new.py
+
26
−
14
View file @
7723404e
...
...
@@ -4,14 +4,13 @@ import matplotlib.pyplot as plt
import
pandas
as
pd
import
numpy
as
np
import
json
import
math
scaling_result_dir
=
'
scaling_results
'
result_jsons
=
[]
result_jsons
.
append
(
os
.
path
.
join
(
os
.
path
.
abspath
(
scaling_result_dir
),
'
david-Lenovo-IdeaPad-S340-14IWL_100_systems.json
'
))
result_jsons
.
append
(
os
.
path
.
join
(
os
.
path
.
abspath
(
scaling_result_dir
),
'
david-Lenovo-IdeaPad-S340-14IWL_2500_systems.json
'
))
fig
,
ax1
=
plt
.
subplots
()
ax2
=
ax1
.
twinx
()
...
...
@@ -27,9 +26,9 @@ for jsonfile in result_jsons:
linear_stdev
=
np
.
std
(
linear_data
)
cpus
=
[]
mp_
speedups
=
[]
mp_
efficiencies
=
[]
stddevs
=
[]
speedups
=
[]
efficiencies
=
[]
stddev
_speedup
s
=
[]
for
amt_cpus
in
result_data
[
'
mp
'
]:
# Get mp data
...
...
@@ -37,39 +36,52 @@ for jsonfile in result_jsons:
mp_mean
=
np
.
mean
(
mp_data
)
mp_stdev
=
np
.
std
(
mp_data
)
# Calc
and append info
# Calc
amt_cpus
=
int
(
amt_cpus
)
speedup
=
linear_mean
/
mp_mean
stddev_speedup
=
math
.
sqrt
((
linear_stdev
/
linear_mean
)
**
2
+
(
mp_stdev
/
mp_mean
)
**
2
)
*
speedup
efficiency
=
speedup
/
int
(
amt_cpus
)
# Add to lists
cpus
.
append
(
amt_cpus
)
mp_speedups
.
append
(
speedup
)
mp_efficiencies
.
append
(
efficiency
)
stddevs
.
append
(
mp_
stdev
)
efficiencies
.
append
(
efficiency
)
speedups
.
append
(
speedup
)
stddev
_speedup
s
.
append
(
std
d
ev
_speedup
)
# Plot
ax1
.
errorbar
(
cpus
,
mp_
speedups
,
stddevs
,
speedups
,
stddev
_speedup
s
,
linestyle
=
"
None
"
,
marker
=
"
^
"
,
label
=
"
Speed up & efficiency of {} systems
"
.
format
(
result_data
[
'
amt_systems
'
]),
)
ax2
.
plot
(
cpus
,
efficiencies
,
alpha
=
0.5
)
# x_position_shift += 0.1
ax1
.
set_title
(
"
Speed up ratio vs amount of cores for different amounts of systems on {}
"
.
format
(
'
name_testcase
'
)
)
ax1
.
plot
([
0
,
max
(
cpus
)],
[
0
,
max
(
cpus
)],
label
=
'
100% scaling
'
)
ax1
.
set_xlabel
(
"
Amount of cores used
"
)
ax1
.
set_ylabel
(
"
Speed up ratio (time_linear/time_parallel)
"
)
ax1
.
set_xlim
(
0
,
max
(
cpus
)
+
4
)
# ax1.set_ylim(0, max_speedup + 2)
ax2
.
set_ylim
(
0
,
1
)
# ax2.set_ylim(0, 1)
ax1
.
grid
()
ax1
.
legend
(
loc
=
4
)
plt
.
show
()
# fig.savefig(os.path.join(img_dir, "speedup_scaling_{}.{}".format(name_testcase, "png")))
# fig.savefig(os.path.join(img_dir, "speedup_scaling_{}.{}".format(name_testcase, "pdf")))
# fig.savefig(os.path.join(img_dir, "speedup_scaling_{}.{}".format(name_testcase, "eps")))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/population/scaling/scaling_script.py
+
1
−
1
View file @
7723404e
...
...
@@ -30,7 +30,7 @@ for i in range(1, int(amount_of_cpus/stepsize) + 1 ):
amt_repeats
=
5
resolution
=
{
'
M_1
'
:
1
0
,
'
per
'
:
1
0
}
resolution
=
{
'
M_1
'
:
5
0
,
'
per
'
:
5
0
}
total_systems
=
int
(
np
.
prod
([
el
for
el
in
resolution
.
values
()]))
result_dir
=
'
scaling_results
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment