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
1af889bd
Commit
1af889bd
authored
5 years ago
by
David Hendriks
Browse files
Options
Downloads
Patches
Plain Diff
did scaling plot with astro2 data
parent
8c47a230
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_scaling_new.py
+14
-4
14 additions, 4 deletions
tests/population/scaling/plot_scaling_new.py
tests/population/scaling/scaling_script.py
+16
-16
16 additions, 16 deletions
tests/population/scaling/scaling_script.py
with
30 additions
and
20 deletions
tests/population/scaling/plot_scaling_new.py
+
14
−
4
View file @
1af889bd
...
...
@@ -8,9 +8,16 @@ import math
scaling_result_dir
=
'
scaling_results
'
filenames
=
[
'
astro2_2500_systems.json
'
,
'
astro2_3000_systems.json
'
,
]
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
'
))
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'))
fig
,
ax1
=
plt
.
subplots
()
ax2
=
ax1
.
twinx
()
...
...
@@ -68,16 +75,19 @@ ax1.set_title(
)
)
ax1
.
plot
([
0
,
max
(
cpus
)],
[
0
,
max
(
cpus
)],
label
=
'
100% scaling
'
)
#
ax1.plot([
1
, max(cpus)], [
1
, 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_xlim(0, max(cpus) + 4)
# ax2.set_ylim(0, 1)
ax1
.
grid
()
ax1
.
legend
(
loc
=
4
)
ax1
.
set_xscale
(
'
log
'
)
ax2
.
set_xscale
(
'
log
'
)
# 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")))
...
...
This diff is collapsed.
Click to expand it.
tests/population/scaling/scaling_script.py
+
16
−
16
View file @
1af889bd
...
...
@@ -32,7 +32,7 @@ for i in range(1, int(amount_of_cpus/stepsize) + 1 ):
# set some info
amt_repeats
=
5
resolution
=
{
'
M_1
'
:
5
,
'
per
'
:
5
}
resolution
=
{
'
M_1
'
:
5
0
,
'
per
'
:
60
}
total_systems
=
int
(
np
.
prod
([
el
for
el
in
resolution
.
values
()]))
result_dir
=
'
scaling_results
'
testcase
=
'
linear vs MP batched
'
...
...
@@ -98,27 +98,27 @@ for repeat in range(amt_repeats):
result_dict
[
'
linear
'
]
=
linear_times
#
#######################################################################################
#
# MP runs
#
mp_dict = {}
#
for cpu_amt in cpu_list:
#######################################################################################
# MP runs
mp_dict
=
{}
for
cpu_amt
in
cpu_list
:
#
mp_times = []
mp_times
=
[]
#
test_pop.set(amt_cores=cpu_amt)
test_pop
.
set
(
amt_cores
=
cpu_amt
)
#
#
#
for repeat in range(amt_repeats):
#
total_mp_start = time.time()
#
evolve_mp_time = test_pop.evolve_population_mp_chunks()
#
total_mp = time.time() - total_mp_start
#
for
repeat
in
range
(
amt_repeats
):
total_mp_start
=
time
.
time
()
evolve_mp_time
=
test_pop
.
evolve_population_mp_chunks
()
total_mp
=
time
.
time
()
-
total_mp_start
#
print("MP ({} nodes) run with {} systems: {} of which {} spent on evolving the systems".format(cpu_amt, total_systems, total_mp, evolve_mp_time))
#
mp_times.append(total_mp)
print
(
"
MP ({} nodes) run with {} systems: {} of which {} spent on evolving the systems
"
.
format
(
cpu_amt
,
total_systems
,
total_mp
,
evolve_mp_time
))
mp_times
.
append
(
total_mp
)
#
mp_dict[cpu_amt] = mp_times
mp_dict
[
cpu_amt
]
=
mp_times
#
result_dict['mp'] = mp_dict
result_dict
[
'
mp
'
]
=
mp_dict
# Write to file
with
open
(
'
scaling_results/{}_{}_systems.json
'
.
format
(
hostname
,
total_systems
),
'
w
'
)
as
f
:
...
...
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