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
98bdd3ad
Commit
98bdd3ad
authored
Nov 16, 2020
by
Antoine Kaufmann
Browse files
experiments: move mem, disk_image, cores into node_config from host
parent
5dd4a6b0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
19 deletions
+21
-19
experiments/modes/nodeconfig.py
experiments/modes/nodeconfig.py
+5
-0
experiments/modes/simulators.py
experiments/modes/simulators.py
+4
-8
experiments/pyexps/qemu_nopaxos_ehseq.py
experiments/pyexps/qemu_nopaxos_ehseq.py
+8
-7
experiments/pyexps/qemu_nopaxos_swseq.py
experiments/pyexps/qemu_nopaxos_swseq.py
+4
-4
No files found.
experiments/modes/nodeconfig.py
View file @
98bdd3ad
...
@@ -8,6 +8,7 @@ class NodeConfig(object):
...
@@ -8,6 +8,7 @@ class NodeConfig(object):
prefix
=
24
prefix
=
24
cores
=
1
cores
=
1
memory
=
512
memory
=
512
disk_image
=
'base'
app
=
None
app
=
None
def
config_str
(
self
):
def
config_str
(
self
):
...
@@ -112,7 +113,9 @@ class CorundumLinuxNode(LinuxNode):
...
@@ -112,7 +113,9 @@ class CorundumLinuxNode(LinuxNode):
class
MtcpNode
(
NodeConfig
):
class
MtcpNode
(
NodeConfig
):
disk_image
=
'mtcp'
pci_dev
=
'0000:00:02.0'
pci_dev
=
'0000:00:02.0'
memory
=
16
*
1024
num_hugepages
=
4096
num_hugepages
=
4096
def
prepare_pre_cp
(
self
):
def
prepare_pre_cp
(
self
):
...
@@ -154,7 +157,9 @@ class MtcpNode(NodeConfig):
...
@@ -154,7 +157,9 @@ class MtcpNode(NodeConfig):
return
{
**
m
,
**
super
().
config_files
()}
return
{
**
m
,
**
super
().
config_files
()}
class
TASNode
(
NodeConfig
):
class
TASNode
(
NodeConfig
):
disk_image
=
'tas'
pci_dev
=
'0000:00:02.0'
pci_dev
=
'0000:00:02.0'
memory
=
16
*
1024
num_hugepages
=
4096
num_hugepages
=
4096
fp_cores
=
1
fp_cores
=
1
preload
=
True
preload
=
True
...
...
experiments/modes/simulators.py
View file @
98bdd3ad
...
@@ -15,7 +15,6 @@ class Simulator(object):
...
@@ -15,7 +15,6 @@ class Simulator(object):
class
HostSim
(
Simulator
):
class
HostSim
(
Simulator
):
node_config
=
None
node_config
=
None
disk_image
=
'base'
name
=
''
name
=
''
wait
=
False
wait
=
False
sleep
=
0
sleep
=
0
...
@@ -61,8 +60,6 @@ class NetSim(Simulator):
...
@@ -61,8 +60,6 @@ class NetSim(Simulator):
class
QemuHost
(
HostSim
):
class
QemuHost
(
HostSim
):
mem
=
16
*
1024
# 16G
def
resreq_cores
(
self
):
def
resreq_cores
(
self
):
return
self
.
node_config
.
cores
+
1
return
self
.
node_config
.
cores
+
1
...
@@ -72,7 +69,7 @@ class QemuHost(HostSim):
...
@@ -72,7 +69,7 @@ class QemuHost(HostSim):
def
prep_cmds
(
self
,
env
):
def
prep_cmds
(
self
,
env
):
to_path
=
env
.
hdcopy_path
(
self
)
to_path
=
env
.
hdcopy_path
(
self
)
return
[
f
'
{
env
.
qemu_img_path
}
create -f qcow2 -o '
return
[
f
'
{
env
.
qemu_img_path
}
create -f qcow2 -o '
f
'backing_file="
{
env
.
hd_path
(
self
.
disk_image
)
}
" '
f
'backing_file="
{
env
.
hd_path
(
self
.
node_config
.
disk_image
)
}
" '
f
'
{
env
.
hdcopy_path
(
self
)
}
'
]
f
'
{
env
.
hdcopy_path
(
self
)
}
'
]
def
run_cmd
(
self
,
env
):
def
run_cmd
(
self
,
env
):
...
@@ -84,7 +81,7 @@ class QemuHost(HostSim):
...
@@ -84,7 +81,7 @@ class QemuHost(HostSim):
'driver=raw '
'driver=raw '
'-append "earlyprintk=ttyS0 console=ttyS0 root=/dev/sda1 '
'-append "earlyprintk=ttyS0 console=ttyS0 root=/dev/sda1 '
'init=/home/ubuntu/guestinit.sh rw" '
'init=/home/ubuntu/guestinit.sh rw" '
f
'-m
{
self
.
mem
}
-smp
{
self
.
node_config
.
cores
}
'
)
f
'-m
{
self
.
node_config
.
memory
}
-smp
{
self
.
node_config
.
cores
}
'
)
if
len
(
self
.
nics
)
>
0
:
if
len
(
self
.
nics
)
>
0
:
assert
len
(
self
.
nics
)
==
1
assert
len
(
self
.
nics
)
==
1
cmd
+=
f
'-chardev socket,path=
{
env
.
nic_pci_path
(
self
.
nics
[
0
])
}
,'
cmd
+=
f
'-chardev socket,path=
{
env
.
nic_pci_path
(
self
.
nics
[
0
])
}
,'
...
@@ -93,7 +90,6 @@ class QemuHost(HostSim):
...
@@ -93,7 +90,6 @@ class QemuHost(HostSim):
return
cmd
return
cmd
class
Gem5Host
(
HostSim
):
class
Gem5Host
(
HostSim
):
mem
=
16
*
1024
# 16G
cpu_type_cp
=
'X86KvmCPU'
cpu_type_cp
=
'X86KvmCPU'
cpu_type
=
'TimingSimpleCPU'
cpu_type
=
'TimingSimpleCPU'
...
@@ -121,9 +117,9 @@ class Gem5Host(HostSim):
...
@@ -121,9 +117,9 @@ class Gem5Host(HostSim):
'--cacheline_size=64 --cpu-clock=3GHz '
'--cacheline_size=64 --cpu-clock=3GHz '
f
'--checkpoint-dir=
{
env
.
gem5_cpdir
(
self
)
}
'
f
'--checkpoint-dir=
{
env
.
gem5_cpdir
(
self
)
}
'
f
'--kernel=
{
env
.
gem5_kernel_path
}
'
f
'--kernel=
{
env
.
gem5_kernel_path
}
'
f
'--disk-image=
{
env
.
hd_raw_path
(
self
.
disk_image
)
}
'
f
'--disk-image=
{
env
.
hd_raw_path
(
self
.
node_config
.
disk_image
)
}
'
f
'--disk-image=
{
env
.
cfgtar_path
(
self
)
}
'
f
'--disk-image=
{
env
.
cfgtar_path
(
self
)
}
'
f
'--cpu-type=
{
cpu_type
}
--mem-size=
{
self
.
mem
}
MB '
f
'--cpu-type=
{
cpu_type
}
--mem-size=
{
self
.
node_config
.
memory
}
MB '
'--ddio-enabled --ddio-way-part=8 --mem-type=DDR4_2400_16x4 '
)
'--ddio-enabled --ddio-way-part=8 --mem-type=DDR4_2400_16x4 '
)
if
env
.
restore_cp
:
if
env
.
restore_cp
:
...
...
experiments/pyexps/qemu_nopaxos_ehseq.py
View file @
98bdd3ad
...
@@ -6,18 +6,19 @@ e = exp.Experiment('qemu-nopaxos-ehseq')
...
@@ -6,18 +6,19 @@ e = exp.Experiment('qemu-nopaxos-ehseq')
net
=
sim
.
NS3SequencerNet
()
net
=
sim
.
NS3SequencerNet
()
e
.
add_network
(
net
)
e
.
add_network
(
net
)
class
NOPaxos
Host
(
sim
.
QemuHost
):
class
NOPaxos
Node
(
node
.
CorundumLinuxNode
):
disk_image
=
'nopaxos'
disk_image
=
'nopaxos'
sequencer
=
sim
.
create_basic_hosts
(
e
,
1
,
'sequencer'
,
net
,
sim
.
CorundumBMNIC
,
NOPaxosHost
,
sequencer
=
sim
.
create_basic_hosts
(
e
,
1
,
'sequencer'
,
net
,
sim
.
CorundumBMNIC
,
node
.
CorundumLinux
Node
,
node
.
NOPaxosSequencer
,
ip_start
=
100
)
sim
.
QemuHost
,
NOPaxos
Node
,
node
.
NOPaxosSequencer
,
ip_start
=
100
)
replicas
=
sim
.
create_basic_hosts
(
e
,
3
,
'replica'
,
net
,
sim
.
CorundumBMNIC
,
NOPaxosHost
,
replicas
=
sim
.
create_basic_hosts
(
e
,
3
,
'replica'
,
net
,
sim
.
CorundumBMNIC
,
node
.
CorundumLinux
Node
,
node
.
NOPaxosReplica
)
sim
.
QemuHost
,
NOPaxos
Node
,
node
.
NOPaxosReplica
)
clients
=
sim
.
create_basic_hosts
(
e
,
1
,
'client'
,
net
,
sim
.
CorundumBMNIC
,
NOPaxosHost
,
clients
=
sim
.
create_basic_hosts
(
e
,
1
,
'client'
,
net
,
sim
.
CorundumBMNIC
,
node
.
CorundumLinux
Node
,
node
.
NOPaxosClient
,
ip_start
=
4
)
sim
.
QemuHost
,
NOPaxos
Node
,
node
.
NOPaxosClient
,
ip_start
=
4
)
sequencer
[
0
].
sleep
=
1
sequencer
[
0
].
sleep
=
1
for
i
in
range
(
len
(
replicas
)):
for
i
in
range
(
len
(
replicas
)):
replicas
[
i
].
node_config
.
app
.
index
=
i
replicas
[
i
].
node_config
.
app
.
index
=
i
replicas
[
i
].
sleep
=
1
replicas
[
i
].
sleep
=
1
...
...
experiments/pyexps/qemu_nopaxos_swseq.py
View file @
98bdd3ad
...
@@ -9,10 +9,10 @@ e.add_network(net)
...
@@ -9,10 +9,10 @@ e.add_network(net)
class
NOPaxosHost
(
sim
.
QemuHost
):
class
NOPaxosHost
(
sim
.
QemuHost
):
disk_image
=
'nopaxos'
disk_image
=
'nopaxos'
replicas
=
sim
.
create_basic_hosts
(
e
,
3
,
'replica'
,
net
,
sim
.
CorundumBMNIC
,
NOPaxosHost
,
replicas
=
sim
.
create_basic_hosts
(
e
,
3
,
'replica'
,
net
,
sim
.
CorundumBMNIC
,
node
.
CorundumLinux
Node
,
node
.
NOPaxosReplica
)
sim
.
QemuHost
,
NOPaxos
Node
,
node
.
NOPaxosReplica
)
clients
=
sim
.
create_basic_hosts
(
e
,
1
,
'client'
,
net
,
sim
.
CorundumBMNIC
,
NOPaxosHost
,
clients
=
sim
.
create_basic_hosts
(
e
,
1
,
'client'
,
net
,
sim
.
CorundumBMNIC
,
node
.
CorundumLinuxNode
,
node
.
NOPaxos
Clien
t
,
ip_start
=
4
)
sim
.
QemuHost
,
node
.
CorundumLinuxNode
,
NOPaxos
Hos
t
,
ip_start
=
4
)
for
i
in
range
(
len
(
replicas
)):
for
i
in
range
(
len
(
replicas
)):
replicas
[
i
].
node_config
.
app
.
index
=
i
replicas
[
i
].
node_config
.
app
.
index
=
i
...
...
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