Skip to content

Commit

Permalink
adress comments
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-merzky committed Jul 28, 2023
1 parent 43392ff commit e56aff3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 314 deletions.
271 changes: 0 additions & 271 deletions bin/radical-pilot-agent-funcs

This file was deleted.

30 changes: 4 additions & 26 deletions bin/radical-pilot-agent_n
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ def wrapped_main(sid, reg_addr, uid, log, prof):

reg.close()

if uid == 'agent_0':
agent = run_agent_0(sid, reg_addr, uid, log, prof)
else:
agent = run_agent_n(sid, reg_addr, uid, log, prof)
agent = run_agent_n(sid, reg_addr, uid, log, prof)

agent.start()

Expand Down Expand Up @@ -108,34 +105,15 @@ def wrapped_main(sid, reg_addr, uid, log, prof):
time.sleep(1)


# ------------------------------------------------------------------------------
#
def run_agent_0(sid, reg_addr, uid, log, prof):

session = rp.Session(uid=sid, cfg=s_cfg,
_role=rp.Session._AGENT_0, _reg_addr=reg_addr)

# session just started a registry - populate it further with agent related
# config sections
reg = ru.zmq.RegistryClient(url=reg_addr)

reg['agent.%s.cfg' % uid] = a_cfg

reg.close()

agent = rp.Agent_0(a_cfg, session)

return agent


# ------------------------------------------------------------------------------
#
def run_agent_n(sid, reg_addr, uid, log, prof):

reg = ru.zmq.RegistryClient(url=reg_addr)

hb_cfg = ru.TypedDict(reg['heartbeat'])
a_cfg = ru.TypedDict(reg['agent.%s.cfg' % uid])
hb_cfg = ru.Config(cfg=reg['heartbeat'])
s_cfg = ru.Config(cfg=reg['cfg'])
a_cfg = ru.Config(cfg=reg['agent.%s.cfg' % uid])

reg.close()

Expand Down
1 change: 0 additions & 1 deletion bin/radical-pilot-bridge
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ def wrapped_main(sid, reg_addr, uid, log, prof):

if 'pubsub' in uid:
d = ru.zmq.test_pubsub(bridge.channel, bridge.addr_pub, bridge.addr_sub)
print('%.1f' % time.time(), d)

sys.stdout.flush()
sys.stderr.flush()
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ def run(self):
'bin/radical-pilot-agent_0',
'bin/radical-pilot-agent_n',
# 'bin/radical-pilot-agent-bridge',
'bin/radical-pilot-agent-funcs',
'bin/radical-pilot-agent-statepush',
'bin/radical-pilot-bridge',
'bin/radical-pilot-bson2json',
Expand Down
18 changes: 3 additions & 15 deletions src/radical/pilot/agent/agent_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,6 @@ def _configure_app_comm(self):
self._rcfg['task_environment']['RP_%s_IN' % AC] = ac['addr_in']
self._rcfg['task_environment']['RP_%s_OUT' % AC] = ac['addr_out']

# some of the bridge addresses also need to be exposed to the workload
if app_comm:
if 'task_environment' not in self._cfg:
self._cfg['task_environment'] = dict()
for ac in app_comm:
if ac not in self._reg['bridges']:
raise RuntimeError('missing app_comm %s' % ac)
self._cfg['task_environment']['RP_%s_IN' % ac.upper()] = \
self._reg['bridges.%s.ac' % ac]['addr_in']
self._cfg['task_environment']['RP_%s_OUT' % ac.upper()] = \
self._reg['bridges.%s.addr_out' % ac]



# --------------------------------------------------------------------------
#
Expand Down Expand Up @@ -493,7 +480,7 @@ def _start_sub_agents(self):
'ranks' : 1,
'cores_per_rank': self._rm.info.cores_per_node,
'executable' : '/bin/sh',
'arguments' : [bs_name, sa]
'arguments' : [bs_name, self._sid, self.cfg.reg_addr, sa]
}).as_dict(),
'slots': {'ranks' : [{'node_name': node['node_name'],
'node_id' : node['node_id'],
Expand Down Expand Up @@ -525,7 +512,8 @@ def _start_sub_agents(self):

tmp = '#!/bin/sh\n\n'
tmp += '. ./env/agent.env\n'
tmp += '/bin/sh -l ./bootstrap_2.sh %s\n\n' % sa
tmp += '/bin/sh -l ./bootstrap_2.sh %s %s %s\n\n' \
% (self._sid, self.cfg.reg_addr, sa)

with ru.ru_open(exec_script, 'w') as fout:
fout.write(tmp)
Expand Down

0 comments on commit e56aff3

Please sign in to comment.