Commit b6798623 authored by Swann Perarnau's avatar Swann Perarnau
Browse files

[fix] Fix power management to make it work on knl

Small fixes to correct for wrong actions on power control over a real
parent 2bfab2b0
......@@ -45,8 +45,8 @@ class ContainerManager(object):
# build context to execute
environ = os.environ
environ['PATH'] = ("/usr/local/sbin:"
# environ['PATH'] = ("/usr/local/sbin:"
# "/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
environ['AC_APP_NAME'] =
environ['AC_METADATA_URL'] = "localhost""run: environ: %r", environ)
......@@ -65,16 +65,16 @@ class PowerActuator(object):"power limits: %r:", pl)
if target == 'i':
for k in pl:
r = range(int(pl[k]['curW']), int(pl[k]['maxW']))
r = range(int(pl[k]['curW'])+1, int(pl[k]['maxW']))
actions.extend([Action(k, s, s - r[0]) for s in r])
elif target == 'd':
for k in pl:
r = range(0, int(pl[k]['curW']))
actions.extend([Action(k, s, s - r[-1]) for s in r])
r = range(1, int(pl[k]['curW']))
actions.extend([Action(k, s, r[-1] - s) for s in r])
return actions
def execute(self, action):"changing power limit: %r", action)"changing power limit: %r, %r", action.command,
self.sensor_manager.set_powerlimit(, action.command)
def update(self, action):
......@@ -105,7 +105,7 @@ class Controller(object):
if actions:
# TODO: better choice
actions.sort(key=lambda x: x[0].delta)
return actions.pop()
return actions.pop(0)
return (None, None)
......@@ -19,7 +19,7 @@ logger = logging.getLogger('nrm')
class Daemon(object):
def __init__(self): = 1.0 = 100.0
def do_downstream_receive(self, parts):"receiving downstream message: %r", parts)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment