Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aladdin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gene
aladdin
Commits
a0025e68
Commit
a0025e68
authored
6 years ago
by
Christian Eichler
Browse files
Options
Downloads
Patches
Plain Diff
bench_input_energy: Improve error handling
parent
ee212333
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Commands/bench_input_energy.py
+20
-16
20 additions, 16 deletions
Commands/bench_input_energy.py
with
20 additions
and
16 deletions
Commands/bench_input_energy.py
+
20
−
16
View file @
a0025e68
...
...
@@ -162,13 +162,10 @@ def gdb_measure(gdb, inp):
return
cycles
def
analyze_thread
(
odir
,
pipe
,
Rshunt
):
hdf
=
h5py
.
File
(
'
{}/measurement.hdf5
'
.
format
(
odir
),
'
w
'
)
def
analyze_thread
(
odir
,
pipe
,
hdf
,
Rshunt
):
while
True
:
measurement
=
pipe
.
recv
()
if
measurement
is
None
:
hdf
.
close
()
break
inp
,
cycles
,
data_per_channel
=
measurement
...
...
@@ -210,15 +207,19 @@ def run(args):
rm
,
devs
=
MSO
.
find_devices
()
mso
=
MSO
.
MSO
(
rm
,
devs
[
0
])
gdb
=
gdb_start
(
"
/home/chris/i4/palladium/results/bench_input_xmc4500.plain_budget
5
0000_seed1431655765_bits32_samples10000_opt0_ofactor25_rev
64c4010eb2f644dc0ea4e551f99de7184b1b570
3+_suitedevice/bench.axf
"
,
"
:2331
"
)
# TODO
gdb
=
gdb_start
(
"
/home/chris/i4/palladium/results/bench_input_xmc4500.plain_budget
2
0000_seed1431655765_bits32_samples10000_opt0_ofactor25_rev
ff42678d10acef590c184a5fa68c5b9b4ded0e6
3+_suitedevice/bench.axf
"
,
"
:2331
"
)
inputs
=
Benchmark
.
get_input
(
args
.
bits
,
args
.
seed
,
args
.
samples
-
1
,
1
,
crafted
=
False
)[
0
]
hdf
=
h5py
.
File
(
'
{}/measurement.hdf5
'
.
format
(
odir
),
'
w
'
)
hdf
.
attrs
[
"
rshunt_ohm
"
]
=
args
.
sr
# start analysis process
pipe_parent
,
pipe_child
=
Pipe
()
p
=
Process
(
target
=
analyze_thread
,
args
=
(
odir
,
pipe_child
,
args
.
sr
))
p
=
Process
(
target
=
analyze_thread
,
args
=
(
odir
,
pipe_child
,
hdf
,
args
.
sr
))
p
.
start
()
try
:
for
i
,
inp
in
enumerate
(
inputs
):
Log
.
info
(
"
({}/{}) Starting measurement for input {}
"
.
format
(
i
,
len
(
inputs
),
inp
))
mso
.
start
()
...
...
@@ -230,9 +231,12 @@ def run(args):
data_per_channel
=
mso
.
get_values
()
pipe_parent
.
send
(
(
inp
,
cycles
,
data_per_channel
)
)
except
Exception
as
e
:
Log
.
fail
(
"
Caught exception during sampling:
\n
{}
"
.
format
(
e
))
pipe_parent
.
send
(
None
)
p
.
join
()
hdf
.
close
()
desc
=
"
Determine energy consumption via shunt-based measurement
"
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