Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
0e69529e
Commit
0e69529e
authored
Aug 05, 2022
by
Jonas Kaufmann
Committed by
Antoine Kaufmann
Aug 23, 2022
Browse files
improve doc strings for class Experiment
parent
756f878b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
experiments/simbricks/experiments.py
experiments/simbricks/experiments.py
+13
-15
No files found.
experiments/simbricks/experiments.py
View file @
0e69529e
...
@@ -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.
C
an for example
be used to
speed up booting a host
simulator by first
Using this property we c
an
,
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 us
in
g
th
is
simulator shut down, a check point created, and finally restored
in th
e
checkpoint."""
accurate mode using this
checkpoint."""
self
.
no_simbricks
=
False
self
.
no_simbricks
=
False
"""`true`
- N
o simbricks adapters are used in the simulators."""
"""
If
`true`
, n
o 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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment