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
e9da98e0
Commit
e9da98e0
authored
May 17, 2024
by
Jonas Kaufmann
Committed by
Antoine Kaufmann
May 17, 2024
Browse files
orchestration: run updated PyCQA/docformatter
parent
46f817dd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
34 deletions
+73
-34
experiments/pyexps/sysbench_memory.py
experiments/pyexps/sysbench_memory.py
+5
-1
experiments/simbricks/orchestration/experiments.py
experiments/simbricks/orchestration/experiments.py
+7
-4
experiments/simbricks/orchestration/nodeconfig.py
experiments/simbricks/orchestration/nodeconfig.py
+8
-5
experiments/simbricks/orchestration/proxy.py
experiments/simbricks/orchestration/proxy.py
+1
-1
experiments/simbricks/orchestration/runtime/common.py
experiments/simbricks/orchestration/runtime/common.py
+1
-1
experiments/simbricks/orchestration/simulators.py
experiments/simbricks/orchestration/simulators.py
+51
-22
No files found.
experiments/pyexps/sysbench_memory.py
View file @
e9da98e0
...
@@ -51,7 +51,11 @@ class SysbenchMemoryBenchmark(node.AppConfig):
...
@@ -51,7 +51,11 @@ class SysbenchMemoryBenchmark(node.AppConfig):
self
.
disaggregated
=
disaggregated
self
.
disaggregated
=
disaggregated
"""Whether to use disaggregated memory."""
"""Whether to use disaggregated memory."""
self
.
time_limit
=
time_limit
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
self
.
num_threads
=
num_threads
"""Number of cores to run the benchmark on in parallel."""
"""Number of cores to run the benchmark on in parallel."""
...
...
experiments/simbricks/orchestration/experiments.py
View file @
e9da98e0
...
@@ -40,17 +40,20 @@ class Experiment(object):
...
@@ -40,17 +40,20 @@ class Experiment(object):
def
__init__
(
self
,
name
:
str
)
->
None
:
def
__init__
(
self
,
name
:
str
)
->
None
:
self
.
name
=
name
self
.
name
=
name
"""
"""
This experiment's name. Can be used to run only a selection of
This experiment's name.
experiments.
Can be used to run only a selection of 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 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
The most common use-case for this is accelerating host simulator startup
by first running in a less accurate mode, then checkpointing the system
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
self
.
no_simbricks
=
False
"""If `true`, no simbricks adapters are used in any of the
"""If `true`, no simbricks adapters are used in any of the
simulators."""
simulators."""
...
...
experiments/simbricks/orchestration/nodeconfig.py
View file @
e9da98e0
...
@@ -70,12 +70,14 @@ class NodeConfig():
...
@@ -70,12 +70,14 @@ class NodeConfig():
def
__init__
(
self
)
->
None
:
def
__init__
(
self
)
->
None
:
self
.
sim
=
'qemu'
self
.
sim
=
'qemu'
"""The concrete simulator that runs this node config. This is used to
"""
use execute different commands depending on the concrete simulator,
The concrete simulator that runs this node config. This is used to use
e.g., which command to use to end the simulation.
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
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'
self
.
ip
=
'10.0.0.1'
"""IP address."""
"""IP address."""
self
.
prefix
=
24
self
.
prefix
=
24
...
@@ -93,7 +95,8 @@ class NodeConfig():
...
@@ -93,7 +95,8 @@ class NodeConfig():
self
.
tcp_congestion_control
=
'bic'
self
.
tcp_congestion_control
=
'bic'
"""TCP Congestion Control algorithm to use."""
"""TCP Congestion Control algorithm to use."""
self
.
nockp
=
0
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
TODO(Kaufi-Jonas): Seems we don't need this anymore since we specify
whether to take a checkpoint experiment-wide. Otherwise, refactor this
whether to take a checkpoint experiment-wide. Otherwise, refactor this
...
...
experiments/simbricks/orchestration/proxy.py
View file @
e9da98e0
...
@@ -51,7 +51,7 @@ class NetProxy(SimProxy):
...
@@ -51,7 +51,7 @@ class NetProxy(SimProxy):
self
.
n2ns
:
tp
.
List
[
tp
.
Tuple
[
tp
.
Tuple
[
Simulator
,
Simulator
],
bool
]]
=
[]
self
.
n2ns
:
tp
.
List
[
tp
.
Tuple
[
tp
.
Tuple
[
Simulator
,
Simulator
],
bool
]]
=
[]
"""List of tuples ((netL,netC), with_listener)"""
"""List of tuples ((netL,netC), with_listener)"""
self
.
shm_size
=
2048
self
.
shm_size
=
2048
"""Shared memory size in GB"""
"""Shared memory size in GB
.
"""
def
start_delay
(
self
)
->
int
:
def
start_delay
(
self
)
->
int
:
return
10
return
10
...
...
experiments/simbricks/orchestration/runtime/common.py
View file @
e9da98e0
...
@@ -102,7 +102,7 @@ class Runtime(metaclass=ABCMeta):
...
@@ -102,7 +102,7 @@ class Runtime(metaclass=ABCMeta):
pass
pass
def
interrupt
(
self
)
->
None
:
def
interrupt
(
self
)
->
None
:
"""
s
ignals interrupt to runtime."""
"""
S
ignals interrupt to runtime."""
# don't invoke interrupt handler multiple times as this would trigger
# don't invoke interrupt handler multiple times as this would trigger
# repeated CancelledError
# repeated CancelledError
...
...
experiments/simbricks/orchestration/simulators.py
View file @
e9da98e0
...
@@ -97,14 +97,21 @@ class PCIDevSim(Simulator):
...
@@ -97,14 +97,21 @@ class PCIDevSim(Simulator):
super
().
__init__
()
super
().
__init__
()
self
.
sync_mode
=
0
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
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
The timestamp at which to start the simulation.
synchronize with connected simulators. For example, this could be used
when taking checkpoints to only attach certain simulators after the
This is useful when the simulator is only attached at a later point in
checkpoint has been taken."""
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
self
.
sync_period
=
500
"""Period in nanoseconds of sending synchronization messages from this
"""Period in nanoseconds of sending synchronization messages from this
device to connected components."""
device to connected components."""
...
@@ -182,8 +189,12 @@ class NetSim(Simulator):
...
@@ -182,8 +189,12 @@ class NetSim(Simulator):
self
.
opt
=
''
self
.
opt
=
''
self
.
sync_mode
=
0
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
self
.
sync_period
=
500
"""Synchronization period in nanoseconds from this network to connected
"""Synchronization period in nanoseconds from this network to connected
components."""
components."""
...
@@ -287,7 +298,7 @@ class HostSim(Simulator):
...
@@ -287,7 +298,7 @@ class HostSim(Simulator):
def
__init__
(
self
,
node_config
:
NodeConfig
)
->
None
:
def
__init__
(
self
,
node_config
:
NodeConfig
)
->
None
:
super
().
__init__
()
super
().
__init__
()
self
.
node_config
=
node_config
self
.
node_config
=
node_config
"""System configuration for this simulated host.
"""
"""System configuration for this simulated host."""
self
.
wait
=
False
self
.
wait
=
False
"""
"""
`True` - Wait for this simulator to finish execution. `False` - Don't
`True` - Wait for this simulator to finish execution. `False` - Don't
...
@@ -298,8 +309,12 @@ class HostSim(Simulator):
...
@@ -298,8 +309,12 @@ class HostSim(Simulator):
self
.
cpu_freq
=
'4GHz'
self
.
cpu_freq
=
'4GHz'
self
.
sync_mode
=
0
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
self
.
sync_period
=
500
"""Period in nanoseconds of sending synchronization messages from this
"""Period in nanoseconds of sending synchronization messages from this
device to connected components."""
device to connected components."""
...
@@ -444,13 +459,16 @@ class Gem5Host(HostSim):
...
@@ -444,13 +459,16 @@ class Gem5Host(HostSim):
self
.
extra_config_args
=
[]
self
.
extra_config_args
=
[]
self
.
variant
=
'fast'
self
.
variant
=
'fast'
self
.
modify_checkpoint_tick
=
True
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
When this is enabled, the restored checkpoint will start at event queue
tick 0. This is a performance optimization since now, connected
tick 0. This is a performance optimization since now, connected
simulators don't have to simulate and synchronize until the restored
simulators don't have to simulate and synchronize until the restored
tick before the actual workload can be executed. Disable this if you
tick before the actual workload can be executed. Disable this if you
need to retain the differences in virtual time between multiple gem5
need to retain the differences in virtual time between multiple gem5
instances."""
instances.
"""
def
resreq_cores
(
self
)
->
int
:
def
resreq_cores
(
self
)
->
int
:
return
1
return
1
...
@@ -543,19 +561,30 @@ class SimicsHost(HostSim):
...
@@ -543,19 +561,30 @@ class SimicsHost(HostSim):
node_config
.
sim
=
'simics'
node_config
.
sim
=
'simics'
self
.
cpu_class
=
'x86-cooper-lake'
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
self
.
cpu_freq
=
4000
# TODO Don't hide attribute in super class
"""CPU frequency in MHz"""
"""CPU frequency in MHz
.
"""
self
.
timing
=
False
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
]
=
[]
self
.
append_cmdline
:
tp
.
List
[
str
]
=
[]
"""Additional parameters to append on the command-line when invoking
"""Additional parameters to append on the command-line when invoking
Simics."""
Simics."""
self
.
interactive
=
False
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
self
.
debug_messages
=
False
"""Whether to enable debug messages of SimBricks adapter devices."""
"""Whether to enable debug messages of SimBricks adapter devices."""
...
@@ -846,7 +875,7 @@ class MemSwitchNet(NetSim):
...
@@ -846,7 +875,7 @@ class MemSwitchNet(NetSim):
def
__init__
(
self
)
->
None
:
def
__init__
(
self
)
->
None
:
super
().
__init__
()
super
().
__init__
()
self
.
sync
=
True
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
=
[]
self
.
mem_map
=
[]
def
run_cmd
(
self
,
env
:
ExpEnv
)
->
str
:
def
run_cmd
(
self
,
env
:
ExpEnv
)
->
str
:
...
...
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