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
3acaa902
Commit
3acaa902
authored
5 years ago
by
David Hendriks
Browse files
Options
Downloads
Patches
Plain Diff
updating scaling routines
parent
0d416661
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/population/scaling/plot_amdahl.py
+19
-0
19 additions, 0 deletions
tests/population/scaling/plot_amdahl.py
tests/population/scaling/plot_scaling_new.py
+36
-9
36 additions, 9 deletions
tests/population/scaling/plot_scaling_new.py
with
55 additions
and
9 deletions
tests/population/scaling/plot_amdahl.py
0 → 100644
+
19
−
0
View file @
3acaa902
import
matplotlib.pyplot
as
plt
import
numpy
as
np
def
amdahl
(
f
,
n
):
return
1.0
/
((
1
-
f
)
+
(
f
/
n
))
cores
=
np
.
arange
(
1
,
10
,
0.1
)
values_list
=
[]
par_vals
=
np
.
arange
(
0
,
1.1
,
0.1
)
for
par_val
in
par_vals
:
values
=
amdahl
(
par_val
,
cores
)
values_list
.
append
(
values
)
for
values
in
values_list
:
plt
.
plot
(
cores
,
values
,
'
b-
'
)
plt
.
show
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/population/scaling/plot_scaling_new.py
+
36
−
9
View file @
3acaa902
...
...
@@ -6,19 +6,22 @@ import numpy as np
import
json
import
math
scaling_result_dir
=
'
scaling_results
'
def
amdahl
(
f
,
n
):
return
1.0
/
((
1
-
f
)
+
(
f
/
n
))
#################################
# Files
scaling_result_dir
=
'
scaling_results
'
filenames
=
[
'
astro2_2500_systems.json
'
,
'
astro2_3000_systems.json
'
,
]
result_jsons
=
[]
for
filename
in
filenames
:
result_jsons
.
append
(
os
.
path
.
join
(
os
.
path
.
abspath
(
scaling_result_dir
),
filename
))
# 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'))
#################################
# Plotting of the scaling results
fig
,
ax1
=
plt
.
subplots
()
ax2
=
ax1
.
twinx
()
for
jsonfile
in
result_jsons
:
...
...
@@ -32,11 +35,7 @@ for jsonfile in result_jsons:
linear_mean
=
np
.
mean
(
linear_data
)
linear_stdev
=
np
.
std
(
linear_data
)
cpus
=
[]
speedups
=
[]
efficiencies
=
[]
stddev_speedups
=
[]
cpus
,
speedups
,
efficiencies
,
stddev_speedups
=
[],
[],
[],
[]
for
amt_cpus
in
result_data
[
'
mp
'
]:
# Get mp data
mp_data
=
result_data
[
'
mp
'
][
amt_cpus
]
...
...
@@ -69,6 +68,25 @@ for jsonfile in result_jsons:
# x_position_shift += 0.1
# Do Amdahls law fitting
# cores = np.arange(1, 48, 0.1)
# values_list = []
# par_step = 0.005
# par_vals = np.arange(.95, 1, par_step)
# for par_val in par_vals:
# values = amdahl(par_val, cores)
# values_list.append(values)
# for i, values in enumerate(values_list):
# ax1.plot(cores, values, label="par_val={}".format(par_vals[i]))
#################################
# Adding plot make up
ax1
.
set_title
(
"
Speed up ratio vs amount of cores for different amounts of systems on {}
"
.
format
(
'
name_testcase
'
...
...
@@ -83,6 +101,15 @@ ax1.set_ylabel("Speed up ratio (time_linear/time_parallel)")
# ax1.set_xlim(0, max(cpus) + 4)
# ax2.set_ylim(0, 1)
ax1
.
grid
()
ax1
.
legend
(
loc
=
4
)
ax1
.
set_xscale
(
'
log
'
)
...
...
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