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

improve doc strings for class Experiment

parent 756f878b
...@@ -37,34 +37,32 @@ from simbricks.utils import graphlib ...@@ -37,34 +37,32 @@ from simbricks.utils import graphlib
class Experiment(object): class Experiment(object):
""" """Base class for all simulation experiments."""
Describes a simulation experiment.
Holds information about the simulators to run and paramaters to configure
the experiment.
"""
def __init__(self, name: str): def __init__(self, name: str):
self.name = name self.name = name
""" """
This experiment's name. Can be used to filter multiple experiments to be This experiment's name. Can be used to run only a selection of
run. experiments.
""" """
self.timeout: tp.Optional[int] = None self.timeout: tp.Optional[int] = None
"""Timeout for experiment in seconds.""" """Timeout for experiment in seconds."""
self.checkpoint = False self.checkpoint = False
"""Whether to use checkpoints in experiment. """Whether to use checkpoints in experiment.
Can for example be used to speed up booting a host simulator by first Using this property we can, for example, speed up booting a host
running in a less accurate mode. Before we then start the application we simulator by first running in a less accurate mode. Before we then start
are interested in, a checkpoint is taken and the simulator shut down. the measurement we are interested in, a checkpoint is taken and the
Then, the simulator is restored in the accurate mode using this simulator shut down, a check point created, and finally restored in the
checkpoint.""" accurate mode using this checkpoint."""
self.no_simbricks = False self.no_simbricks = False
"""`true` - No simbricks adapters are used in the simulators.""" """If `true`, no simbricks adapters are used in any of the simulators."""
self.hosts: tp.List[HostSim] = [] self.hosts: tp.List[HostSim] = []
"""The host simulators to run."""
self.pcidevs: tp.List[PCIDevSim] = [] self.pcidevs: tp.List[PCIDevSim] = []
"""The PCIe device simulators to run."""
self.networks: tp.List[NetSim] = [] self.networks: tp.List[NetSim] = []
"""The network simulators to run."""
self.metadata = {} self.metadata = {}
def add_host(self, sim: HostSim): def add_host(self, sim: HostSim):
...@@ -150,7 +148,7 @@ T = tp.TypeVar('T', bound=Experiment) ...@@ -150,7 +148,7 @@ T = tp.TypeVar('T', bound=Experiment)
class ExperimentBaseRunner(tp.Generic[T]): class ExperimentBaseRunner(tp.Generic[T]):
def __init__(self, exp: T, env: ExpEnv, verbose: bool): def __init__(self, exp: T, env: ExpEnv, verbose: bool):
self.exp: T = exp self.exp = exp
self.env = env self.env = env
self.verbose = verbose self.verbose = verbose
self.out = ExpOutput(exp) self.out = ExpOutput(exp)
......
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