Unverified Commit aa1fda22 authored by Jakob Görgen's avatar Jakob Görgen
Browse files

wait_terminate as simulator property

parent 0d56918d
...@@ -98,6 +98,7 @@ for host_type in host_types: ...@@ -98,6 +98,7 @@ for host_type in host_types:
host_inst0 = host_sim(simulation) host_inst0 = host_sim(simulation)
host_inst0.add(host0) host_inst0.add(host0)
host_inst0.wait_terminate = True
host_inst1 = host_sim(simulation) host_inst1 = host_sim(simulation)
host_inst1.add(host1) host_inst1.add(host1)
......
...@@ -103,7 +103,7 @@ class ExperimentBaseRunner(abc.ABC): ...@@ -103,7 +103,7 @@ class ExperimentBaseRunner(abc.ABC):
if delay > 0: if delay > 0:
await asyncio.sleep(delay) await asyncio.sleep(delay)
if sim.wait_terminate(): if sim.wait_terminate:
self._wait_sims.append(sc) self._wait_sims.append(sc)
if self._verbose: if self._verbose:
......
...@@ -75,6 +75,15 @@ class Simulator(utils_base.IdObj): ...@@ -75,6 +75,15 @@ class Simulator(utils_base.IdObj):
def extra_args(self, extra_args: str): def extra_args(self, extra_args: str):
self._extra_args = extra_args self._extra_args = extra_args
@property
def wait_terminate(self) -> bool:
# TODO: FIXME If in the system config for e.g. an application is set that one has to wait for the app, we need to wait for the simulator as well!!!
return self._wait
@wait_terminate.setter
def wait_terminate(self, wait: bool):
self._wait = wait
@staticmethod @staticmethod
def filter_sockets( def filter_sockets(
sockets: list[inst_base.Socket], sockets: list[inst_base.Socket],
...@@ -266,10 +275,6 @@ class Simulator(utils_base.IdObj): ...@@ -266,10 +275,6 @@ class Simulator(utils_base.IdObj):
def start_delay(self) -> int: def start_delay(self) -> int:
return 5 return 5
# TODO: FIXME
def wait_terminate(self) -> bool:
return self._wait
def supports_checkpointing(self) -> bool: def supports_checkpointing(self) -> bool:
return False return False
......
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