Commit e9da98e0 authored by Jonas Kaufmann's avatar Jonas Kaufmann Committed by Antoine Kaufmann
Browse files

orchestration: run updated PyCQA/docformatter

parent 46f817dd
......@@ -51,7 +51,11 @@ class SysbenchMemoryBenchmark(node.AppConfig):
self.disaggregated = disaggregated
"""Whether to use disaggregated memory."""
self.time_limit = time_limit
"""Time limit for sysbench benchmark in seconds. 0 to disable limit."""
"""
Time limit for sysbench benchmark in seconds.
0 to disable limit.
"""
self.num_threads = num_threads
"""Number of cores to run the benchmark on in parallel."""
......
......@@ -40,17 +40,20 @@ class Experiment(object):
def __init__(self, name: str) -> None:
self.name = name
"""
This experiment's name. Can be used to run only a selection of
experiments.
This experiment's name.
Can be used to run only a selection of experiments.
"""
self.timeout: tp.Optional[int] = None
"""Timeout for experiment in seconds."""
self.checkpoint = False
"""Whether to use checkpoint and restore for simulators.
"""
Whether to use checkpoint and restore for simulators.
The most common use-case for this is accelerating host simulator startup
by first running in a less accurate mode, then checkpointing the system
state after boot and running simulations from there."""
state after boot and running simulations from there.
"""
self.no_simbricks = False
"""If `true`, no simbricks adapters are used in any of the
simulators."""
......
......@@ -70,12 +70,14 @@ class NodeConfig():
def __init__(self) -> None:
self.sim = 'qemu'
"""The concrete simulator that runs this node config. This is used to
use execute different commands depending on the concrete simulator,
e.g., which command to use to end the simulation.
"""
The concrete simulator that runs this node config. This is used to use
execute different commands depending on the concrete simulator, e.g.,
which command to use to end the simulation.
TODO(Kaufi-Jonas): This is ugly. Refactor necessary commands to be
provided by the simulator's class directly."""
provided by the simulator's class directly.
"""
self.ip = '10.0.0.1'
"""IP address."""
self.prefix = 24
......@@ -93,7 +95,8 @@ class NodeConfig():
self.tcp_congestion_control = 'bic'
"""TCP Congestion Control algorithm to use."""
self.nockp = 0
"""Do not create a checkpoint in Gem5.
"""
Do not create a checkpoint in Gem5.
TODO(Kaufi-Jonas): Seems we don't need this anymore since we specify
whether to take a checkpoint experiment-wide. Otherwise, refactor this
......
......@@ -51,7 +51,7 @@ class NetProxy(SimProxy):
self.n2ns: tp.List[tp.Tuple[tp.Tuple[Simulator, Simulator], bool]] = []
"""List of tuples ((netL,netC), with_listener)"""
self.shm_size = 2048
"""Shared memory size in GB"""
"""Shared memory size in GB."""
def start_delay(self) -> int:
return 10
......
......@@ -102,7 +102,7 @@ class Runtime(metaclass=ABCMeta):
pass
def interrupt(self) -> None:
"""signals interrupt to runtime."""
"""Signals interrupt to runtime."""
# don't invoke interrupt handler multiple times as this would trigger
# repeated CancelledError
......
......@@ -97,14 +97,21 @@ class PCIDevSim(Simulator):
super().__init__()
self.sync_mode = 0
"""Synchronization mode. 0 is running unsynchronized, 1 synchronized.
Depending on the concrete simulator, there may be additional modes."""
"""
Synchronization mode.
0 is running unsynchronized, 1 synchronized. Depending on the concrete
simulator, there may be additional modes.
"""
self.start_tick = 0
"""The timestamp at which to start the simulation. This is useful when
the simulator is only attached at a later point in time and needs to
synchronize with connected simulators. For example, this could be used
when taking checkpoints to only attach certain simulators after the
checkpoint has been taken."""
"""
The timestamp at which to start the simulation.
This is useful when the simulator is only attached at a later point in
time and needs to synchronize with connected simulators. For example,
this could be used when taking checkpoints to only attach certain
simulators after the checkpoint has been taken.
"""
self.sync_period = 500
"""Period in nanoseconds of sending synchronization messages from this
device to connected components."""
......@@ -182,8 +189,12 @@ class NetSim(Simulator):
self.opt = ''
self.sync_mode = 0
"""Synchronization mode. 0 is running unsynchronized, 1 synchronized.
Depending on the concrete simulator, there may be additional modes."""
"""
Synchronization mode.
0 is running unsynchronized, 1 synchronized. Depending on the concrete
simulator, there may be additional modes.
"""
self.sync_period = 500
"""Synchronization period in nanoseconds from this network to connected
components."""
......@@ -287,7 +298,7 @@ class HostSim(Simulator):
def __init__(self, node_config: NodeConfig) -> None:
super().__init__()
self.node_config = node_config
"""System configuration for this simulated host. """
"""System configuration for this simulated host."""
self.wait = False
"""
`True` - Wait for this simulator to finish execution. `False` - Don't
......@@ -298,8 +309,12 @@ class HostSim(Simulator):
self.cpu_freq = '4GHz'
self.sync_mode = 0
"""Synchronization mode. 0 is running unsynchronized, 1 synchronized.
Depending on the concrete simulator, there may be additional modes."""
"""
Synchronization mode.
0 is running unsynchronized, 1 synchronized. Depending on the concrete
simulator, there may be additional modes.
"""
self.sync_period = 500
"""Period in nanoseconds of sending synchronization messages from this
device to connected components."""
......@@ -444,13 +459,16 @@ class Gem5Host(HostSim):
self.extra_config_args = []
self.variant = 'fast'
self.modify_checkpoint_tick = True
"""Whether to modify the event queue tick before restoring a checkpoint.
"""
Whether to modify the event queue tick before restoring a checkpoint.
When this is enabled, the restored checkpoint will start at event queue
tick 0. This is a performance optimization since now, connected
simulators don't have to simulate and synchronize until the restored
tick before the actual workload can be executed. Disable this if you
need to retain the differences in virtual time between multiple gem5
instances."""
instances.
"""
def resreq_cores(self) -> int:
return 1
......@@ -543,19 +561,30 @@ class SimicsHost(HostSim):
node_config.sim = 'simics'
self.cpu_class = 'x86-cooper-lake'
"""Simics CPU class. Can be obtained by running `list-classes substr =
processor_` inside Simics."""
"""
Simics CPU class.
Can be obtained by running `list-classes substr = processor_` inside
Simics.
"""
self.cpu_freq = 4000 # TODO Don't hide attribute in super class
"""CPU frequency in MHz"""
"""CPU frequency in MHz."""
self.timing = False
"""Whether to run Simics in a more precise timing mode. This adds a
cache model."""
"""
Whether to run Simics in a more precise timing mode.
This adds a cache model.
"""
self.append_cmdline: tp.List[str] = []
"""Additional parameters to append on the command-line when invoking
Simics."""
self.interactive = False
"""Whether to launch Simics in interactive GUI mode. This is helpful for
debugging, e.g. enabling log messages in the mid of the simulation."""
"""
Whether to launch Simics in interactive GUI mode.
This is helpful for debugging, e.g. enabling log messages in the mid of
the simulation.
"""
self.debug_messages = False
"""Whether to enable debug messages of SimBricks adapter devices."""
......@@ -846,7 +875,7 @@ class MemSwitchNet(NetSim):
def __init__(self) -> None:
super().__init__()
self.sync = True
""" AS_ID,VADDR_START,VADDR_END,MEMNODE_MAC,PHYS_START """
"""AS_ID,VADDR_START,VADDR_END,MEMNODE_MAC,PHYS_START."""
self.mem_map = []
def run_cmd(self, env: ExpEnv) -> str:
......
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