Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nrm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
argo
nrm
Commits
991894c8
Commit
991894c8
authored
Feb 25, 2018
by
Valentin Reis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[feature] energy,power,instrumentation reporting
parent
9fe8a58c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
nrm/applications.py
nrm/applications.py
+7
-2
nrm/controller.py
nrm/controller.py
+6
-4
No files found.
nrm/applications.py
View file @
991894c8
...
...
@@ -22,7 +22,8 @@ class Application(object):
def
__init__
(
self
,
uuid
,
container
,
progress
,
threads
):
self
.
uuid
=
uuid
self
.
container_uuid
=
container
self
.
progress
=
1
self
.
progress
=
0
self
.
hardwareprogress
=
0
self
.
threads
=
threads
self
.
thread_state
=
'stable'
...
...
@@ -57,11 +58,15 @@ class Application(object):
def
update_progress
(
self
,
msg
):
"""Update the progress tracking."""
self
.
progress
=
self
.
progress
+
float
(
msg
[
'payload'
])
/
10000.
if
msg
[
'event'
]
==
'progress'
:
self
.
progress
=
self
.
progress
+
float
(
msg
[
'payload'
])
elif
msg
[
'event'
]
==
'hardwareprogress'
:
self
.
hardwareprogress
=
self
.
hardwareprogress
+
float
(
msg
[
'payload'
])
/
10000.
def
reset_progress
(
self
):
"""Update the progress tracking."""
self
.
progress
=
0
self
.
hardwareprogress
=
0
class
ApplicationManager
(
object
):
...
...
nrm/controller.py
View file @
991894c8
...
...
@@ -147,12 +147,13 @@ class BanditController(object):
self
.
enforce
=
enforce
self
.
log_power
=
log_power
if
self
.
log_power
is
not
None
:
self
.
log_power
.
write
(
"
progress power loss a desc
\
n
"
)
self
.
log_power
.
write
(
"
hardwareprogress progress power loss a desc p_inst
\
n
"
)
self
.
log_power
.
flush
()
def
planify
(
self
,
target
,
machineinfo
,
applications
):
"""Plan the next action for the control loop."""
current_e
=
float
(
machineinfo
[
'energy'
][
'energy'
][
'cumulative'
][
'package-0'
])
/
(
1000
*
1000
)
# in joules
current_p
=
float
(
machineinfo
[
'energy'
][
'power'
][
'p0'
])
/
(
1000
*
1000
)
# in joules
if
self
.
last_e
==
0
:
self
.
last_e
=
current_e
return
([],[])
...
...
@@ -169,6 +170,7 @@ class BanditController(object):
return
([],[])
self
.
n
=
self
.
n
+
1
total_progress
=
sum
([
a
.
progress
for
a
in
applications
.
values
()])
total_hardwareprogress
=
sum
([
a
.
hardwareprogress
for
a
in
applications
.
values
()])
for
a
in
applications
.
values
():
a
.
reset_progress
()
logger
.
info
(
"Controller: applications %r"
%
applications
.
values
())
...
...
@@ -189,9 +191,9 @@ class BanditController(object):
logger
.
info
(
"Controller: playing arm id %s (powercap '%s')."
%
(
str
(
a
),
str
([
act
.
command
for
act
in
list
(
action
)])))
if
self
.
log_power
is
not
None
:
self
.
log_power
.
write
(
"%s %s %s %s %s
\
n
"
%
(
str
(
total_progress
),
str
(
total_power
),
str
(
loss
),
str
(
a
),
str
([
act
.
command
for
act
in
list
(
action
)])))
self
.
log_power
.
write
(
"%s %s %s %s %s
%s %s
\
n
"
%
(
str
(
total_
hardwareprogress
),
str
(
total_
progress
),
str
(
total_power
),
str
(
loss
),
str
(
a
),
str
([
act
.
command
for
act
in
list
(
action
)])
,
current_p
))
self
.
log_power
.
flush
()
return
(
list
(
action
),
self
.
actuators
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment