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
96b9d832
Commit
96b9d832
authored
Sep 05, 2017
by
Srinivasan Ramesh
Committed by
Swann Perarnau
Dec 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Publish node local power data to NRM channel
parent
f533a8f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
nrm/daemon.py
nrm/daemon.py
+19
-1
No files found.
nrm/daemon.py
View file @
96b9d832
...
...
@@ -102,6 +102,11 @@ class Daemon(object):
def do_control(self):
total_power = self.machine_info['energy']['power']['total']
# Publish the power values so that GRM can pick it up
self.nrm_publish_sock.send("
%
f" % (total_power))
self.logger.info("
Sending
power
values
:
" + str(total_power))
self.target = random.randrange(0, 34)
self.logger.info("
target
measure
:
" + str(self.target))
...
...
@@ -126,16 +131,29 @@ class Daemon(object):
ioloop.IOLoop.current().stop()
def main(self):
# read config
# read config
for the port numbers
bind_port = 1234
# NRM publish port is the port to which NRM publishes node power info
nrm_publish_port = 2345
# GRM publish port is the port to which GRM publishes the new power allocation
grm_publish_port = 3456
bind_address = '*'
# setup application listening socket
context = zmq.Context()
socket = context.socket(zmq.STREAM)
self.nrm_publish_sock = context.socket(zmq.PUB)
bind_param = "
tcp
:
//%
s
:
%
d
" % (bind_address, bind_port)
nrm_bind_param = "
tcp
:
//%
s
:
%
d
" % (bind_address, nrm_publish_port)
socket.bind(bind_param)
self.nrm_publish_sock.bind(nrm_bind_param)
self.logger.info("
socket
bound
to
:
" + bind_param)
self.logger.info("
NRM
publish
socket
bound
to
:
" + nrm_bind_param)
self.stream = zmqstream.ZMQStream(socket)
self.stream.on_recv(self.do_application_receive)
...
...
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