Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpvm-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
hpvm-release
Commits
41ad2b90
Commit
41ad2b90
authored
5 years ago
by
Elizabeth
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug in results file generator
parent
bd1f0938
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/projects/soc_simulator/src/driver.py
+6
-12
6 additions, 12 deletions
llvm/projects/soc_simulator/src/driver.py
with
6 additions
and
12 deletions
llvm/projects/soc_simulator/src/driver.py
+
6
−
12
View file @
41ad2b90
...
@@ -248,7 +248,6 @@ def run_simulations(config_filename):
...
@@ -248,7 +248,6 @@ def run_simulations(config_filename):
prev_layer
=
curr_layer
prev_layer
=
curr_layer
config_count
+=
1
config_count
+=
1
print
(
"
\n
"
)
print
(
"
\n
"
)
config_count
+=
1
# because we're storing the count and not the index
config_file
.
close
()
config_file
.
close
()
...
@@ -257,10 +256,8 @@ def display_results(results_filename):
...
@@ -257,10 +256,8 @@ def display_results(results_filename):
attributes_to_print
=
[
results_time_key
,
results_energy_key
]
attributes_to_print
=
[
results_time_key
,
results_energy_key
]
for
attribute
in
attributes_to_print
:
for
attribute
in
attributes_to_print
:
attribute_data
=
[]
# Store as list and then write to file once bc syscalls are slow
results_file
.
write
(
"
%s
\n
"
%
attribute
)
attribute_data
.
append
(
attribute
)
results_file
.
write
(
"
Configuration,Total,Improvement
\n
"
)
attribute_data
.
append
(
"
Configuration,Total,Improvement
"
)
# header
baseline_val
=
aggregate_results
[
attribute
][
0
]
baseline_val
=
aggregate_results
[
attribute
][
0
]
print
(
baseline_val
)
print
(
baseline_val
)
...
@@ -268,18 +265,15 @@ def display_results(results_filename):
...
@@ -268,18 +265,15 @@ def display_results(results_filename):
best_result
=
None
best_result
=
None
for
config_ind
in
range
(
config_count
):
for
config_ind
in
range
(
config_count
):
config_data
=
[
"
c%d
"
%
config_ind
]
results_file
.
write
(
"
c%d
"
%
config_ind
)
time_or_energy_val
=
aggregate_results
[
attribute
][
config_ind
]
time_or_energy_val
=
aggregate_results
[
attribute
][
config_ind
]
config_data
.
append
(
str
(
time_or_energy_val
))
results_file
.
write
(
"
,%f
"
%
time_or_energy_val
)
config_data
.
append
(
str
(
baseline_val
/
(
time_or_energy_val
+
0.0001
)))
results_file
.
write
(
"
,%f
\n
"
%
(
baseline_val
/
(
time_or_energy_val
+
0.0001
)))
attribute_data
.
append
(
'
,
'
.
join
(
config_data
))
if
not
best_result
or
time_or_energy_val
<
best_result
:
if
not
best_result
or
time_or_energy_val
<
best_result
:
best_result
=
time_or_energy_val
best_result
=
time_or_energy_val
best_config
=
config_ind
best_config
=
config_ind
attribute_data
.
append
(
"
c%d,%d
"
%
(
best_config
,
aggregate_results
[
attribute
][
best_config
]))
results_file
.
write
(
"
\n
c%d,%f
\n\n
"
%
(
best_config
,
aggregate_results
[
attribute
][
best_config
]))
attribute_data
.
append
(
""
)
# To add an additional new line
results_file
.
write
(
'
\n
'
.
join
(
attribute_data
))
results_file
.
close
()
results_file
.
close
()
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
...
...
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