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
fe223e29
Commit
fe223e29
authored
Sep 05, 2024
by
Hejing Li
Browse files
some error fixes
parent
eb611e2c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
experiments/simbricks/orchestration/simulation/base.py
experiments/simbricks/orchestration/simulation/base.py
+2
-3
experiments/simbricks/orchestration/simulation/host.py
experiments/simbricks/orchestration/simulation/host.py
+2
-2
experiments/simbricks/orchestration/simulation/pcidev.py
experiments/simbricks/orchestration/simulation/pcidev.py
+4
-3
No files found.
experiments/simbricks/orchestration/simulation/base.py
View file @
fe223e29
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
from
__future__
import
annotations
from
__future__
import
annotations
import
abc
import
abc
import
itertools
import
time
import
time
import
typing
as
tp
import
typing
as
tp
import
simbricks.orchestration.system
as
sys_conf
import
simbricks.orchestration.system
as
sys_conf
...
@@ -51,7 +52,7 @@ class Simulator(utils_base.IdObj):
...
@@ -51,7 +52,7 @@ class Simulator(utils_base.IdObj):
self
.
extra_deps
:
list
[
Simulator
]
=
[]
self
.
extra_deps
:
list
[
Simulator
]
=
[]
self
.
name
:
str
=
""
self
.
name
:
str
=
""
self
.
experiment
:
sim_base
.
Simulation
=
simulation
self
.
experiment
:
sim_base
.
Simulation
=
simulation
self
.
_components
:
set
[
sys_conf
.
Component
]
=
[]
self
.
_components
:
set
[
sys_conf
.
Component
]
=
set
()
self
.
_relative_executable_path
:
str
=
relative_executable_path
self
.
_relative_executable_path
:
str
=
relative_executable_path
@
staticmethod
@
staticmethod
...
@@ -311,8 +312,6 @@ class Simulation(utils_base.IdObj):
...
@@ -311,8 +312,6 @@ class Simulation(utils_base.IdObj):
def
all_simulators
(
self
)
->
tp
.
Iterable
[
Simulator
]:
def
all_simulators
(
self
)
->
tp
.
Iterable
[
Simulator
]:
"""Returns all simulators defined to run in this experiment."""
"""Returns all simulators defined to run in this experiment."""
# TODO: FIXME
raise
Exception
(
"needs fixed implementation"
)
return
itertools
.
chain
(
return
itertools
.
chain
(
self
.
hosts
,
self
.
pcidevs
,
self
.
memdevs
,
self
.
netmems
,
self
.
networks
self
.
hosts
,
self
.
pcidevs
,
self
.
memdevs
,
self
.
netmems
,
self
.
networks
)
)
...
...
experiments/simbricks/orchestration/simulation/host.py
View file @
fe223e29
...
@@ -37,7 +37,7 @@ class HostSim(sim_base.Simulator):
...
@@ -37,7 +37,7 @@ class HostSim(sim_base.Simulator):
def
__init__
(
self
,
e
:
sim_base
.
Simulation
):
def
__init__
(
self
,
e
:
sim_base
.
Simulation
):
super
().
__init__
(
e
)
super
().
__init__
(
e
)
self
.
hosts
:
tp
.
List
[
'Host'
]
self
.
hosts
:
tp
.
List
[
'Host'
]
=
[]
self
.
wait
=
True
self
.
wait
=
True
def
full_name
(
self
)
->
str
:
def
full_name
(
self
)
->
str
:
...
@@ -54,7 +54,7 @@ class HostSim(sim_base.Simulator):
...
@@ -54,7 +54,7 @@ class HostSim(sim_base.Simulator):
def
add
(
self
,
host
:
'Host'
):
def
add
(
self
,
host
:
'Host'
):
self
.
hosts
.
append
(
host
)
self
.
hosts
.
append
(
host
)
self
.
name
=
f
'
{
self
.
hosts
.
id
}
'
self
.
name
=
f
'
{
self
.
_
id
}
'
self
.
experiment
.
add_host
(
self
)
self
.
experiment
.
add_host
(
self
)
self
.
experiment
.
sys_sim_map
[
host
]
=
self
self
.
experiment
.
sys_sim_map
[
host
]
=
self
...
...
experiments/simbricks/orchestration/simulation/pcidev.py
View file @
fe223e29
...
@@ -59,14 +59,15 @@ class NICSim(PCIDevSim):
...
@@ -59,14 +59,15 @@ class NICSim(PCIDevSim):
def
__init__
(
self
,
e
:
base
.
Simulation
)
->
None
:
def
__init__
(
self
,
e
:
base
.
Simulation
)
->
None
:
super
().
__init__
(
e
)
super
().
__init__
(
e
)
self
.
experiment
=
e
self
.
experiment
=
e
self
.
nics
:
tp
.
List
[
PCIDevSim
]
=
[]
self
.
nics
:
tp
.
List
[
sys_conf
.
SimplePCIeNIC
]
=
[]
self
.
start_tick
=
0
self
.
start_tick
=
0
def
add
(
self
,
nic
:
PCIDevSim
):
def
add
(
self
,
nic
:
sys_conf
.
SimplePCIeNIC
):
self
.
nics
.
append
(
nic
)
self
.
nics
.
append
(
nic
)
# nic.sim = self
# nic.sim = self
self
.
experiment
.
add_nic
(
self
)
self
.
experiment
.
add_nic
(
self
)
self
.
name
=
f
'
{
nic
.
id
}
'
self
.
experiment
.
sys_sim_map
[
nic
]
=
self
self
.
name
=
f
'
{
nic
.
_id
}
'
def
basic_args
(
self
,
env
:
ExpEnv
,
extra
:
tp
.
Optional
[
str
]
=
None
)
->
str
:
def
basic_args
(
self
,
env
:
ExpEnv
,
extra
:
tp
.
Optional
[
str
]
=
None
)
->
str
:
cmd
=
(
cmd
=
(
...
...
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