Commit abfc0921 authored by Marvin Meiers's avatar Marvin Meiers Committed by Hejing Li
Browse files

experiments: pass parameters for ns3 end-to-end framework through a file

Instead of passing all parameters using the command line, we write them
first into a file and then pass the filename to the end-to-end
framework.
parent 09286381
......@@ -111,3 +111,6 @@ class ExpEnv(object):
def simics_cpfile(self, sim: 'simulators.Simulator') -> str:
return f'{self.cpdir}/simics-cp.{sim.name}'
def ns3_e2e_params_file(self, sim: 'simulators.NS3E2ENet') -> str:
return f'{self.workdir}/ns3_e2e_params.{sim.name}'
......@@ -909,6 +909,7 @@ class NS3E2ENet(NetSim):
self.e2e_components: tp.List[tp.Union[e2e.E2ETopologyNode,
e2e.E2ETopologyChannel]] = []
self.e2e_topologies: tp.List[E2ETopology] = []
self.use_file = True
def add_component(
self,
......@@ -947,10 +948,21 @@ class NS3E2ENet(NetSim):
for component in self.e2e_components:
params.append(component.ns3_config())
cmd = (
f'{env.repodir}/sims/external/ns-3'
f'/simbricks-run.sh e2e-cc-example {" ".join(params)} {self.opt}'
)
params_str = f'{" ".join(params)} {self.opt}'
if self.use_file:
file_path = env.ns3_e2e_params_file(self)
with open(file_path, 'w', encoding='utf-8') as f:
f.write(params_str)
cmd = (
f'{env.repodir}/sims/external/ns-3'
f'/simbricks-run.sh e2e-cc-example --ConfigFile={file_path}'
)
else:
cmd = (
f'{env.repodir}/sims/external/ns-3'
f'/simbricks-run.sh e2e-cc-example {params_str}'
)
print(cmd)
return cmd
......
Subproject commit 01ecaf4cc502e1de4fc68f75b27d35fbd62c1714
Subproject commit bd27d486bc9d0cfdcbee5b74beda2dd4fab02058
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