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
5f2549b6
Commit
5f2549b6
authored
Dec 03, 2020
by
Hejing Li
Browse files
nopaxos.py add intel nic and change naming
parent
3ff6bad1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
35 deletions
+63
-35
experiments/pyexps/nopaxos.py
experiments/pyexps/nopaxos.py
+63
-35
No files found.
experiments/pyexps/nopaxos.py
View file @
5f2549b6
...
@@ -2,43 +2,71 @@ import modes.experiments as exp
...
@@ -2,43 +2,71 @@ import modes.experiments as exp
import
modes.simulators
as
sim
import
modes.simulators
as
sim
import
modes.nodeconfig
as
node
import
modes.nodeconfig
as
node
host_configs
=
[
'
bm'
,
'cycle
'
]
host_configs
=
[
'
qemu'
,
'gt
'
]
seq_configs
=
[
'swseq'
,
'ehseq'
]
seq_configs
=
[
'swseq'
,
'ehseq'
]
nic_configs
=
[
'ib'
,
'cb'
,
'cv'
]
experiments
=
[]
experiments
=
[]
link_rate_opt
=
'--LinkRate=100Gb/s '
# don't forget space at the end
link_latency_opt
=
'--LinkLatency=500ns '
for
host_config
in
host_configs
:
for
host_config
in
host_configs
:
for
seq_config
in
seq_configs
:
for
seq_config
in
seq_configs
:
e
=
exp
.
Experiment
(
'nopaxos-'
+
host_config
+
'-'
+
seq_config
)
for
nic_config
in
nic_configs
:
net
=
sim
.
NS3SequencerNet
()
e
=
exp
.
Experiment
(
'nopaxos-'
+
host_config
+
'-'
+
nic_config
+
'-'
+
seq_config
)
e
.
add_network
(
net
)
net
=
sim
.
NS3SequencerNet
()
net
.
opt
=
link_rate_opt
+
link_latency_opt
if
host_config
==
'bm'
:
e
.
add_network
(
net
)
host_class
=
sim
.
QemuHost
nic_class
=
sim
.
CorundumBMNIC
# host
nc_class
=
node
.
CorundumLinuxNode
if
host_config
==
'qemu'
:
elif
host_config
==
'cycle'
:
host_class
=
sim
.
QemuHost
host_class
=
sim
.
Gem5Host
# nic
nic_class
=
sim
.
CorundumVerilatorNIC
if
nic_config
==
'ib'
:
nc_class
=
node
.
CorundumLinuxNode
nic_class
=
sim
.
I40eNIC
else
:
nc_class
=
node
.
I40eLinuxNode
raise
NameError
(
host_config
)
elif
nic_config
==
'cb'
:
nc_class
.
disk_image
=
'nopaxos'
nic_class
=
sim
.
CorundumBMNIC
nc_class
=
node
.
CorundumLinuxNode
if
seq_config
==
'ehseq'
:
else
:
sequencer
=
sim
.
create_basic_hosts
(
e
,
1
,
'sequencer'
,
net
,
nic_class
,
continue
host_class
,
nc_class
,
node
.
NOPaxosSequencer
,
ip_start
=
100
)
sequencer
[
0
].
sleep
=
1
elif
host_config
==
'gt'
:
host_class
=
sim
.
Gem5Host
replicas
=
sim
.
create_basic_hosts
(
e
,
3
,
'replica'
,
net
,
nic_class
,
e
.
checkpoint
=
False
host_class
,
nc_class
,
node
.
NOPaxosReplica
)
# nic
for
i
in
range
(
len
(
replicas
)):
if
nic_config
==
'ib'
:
replicas
[
i
].
node_config
.
app
.
index
=
i
nic_class
=
sim
.
I40eNIC
replicas
[
i
].
sleep
=
1
nc_class
=
node
.
I40eLinuxNode
elif
nic_config
==
'cb'
:
clients
=
sim
.
create_basic_hosts
(
e
,
1
,
'client'
,
net
,
nic_class
,
nic_class
=
sim
.
CorundumBMNIC
host_class
,
nc_class
,
node
.
NOPaxosClient
,
ip_start
=
4
)
nc_class
=
node
.
CorundumLinuxNode
for
c
in
clients
:
elif
nic_config
==
'cv'
:
c
.
node_config
.
app
.
server_ips
=
[
'10.0.0.1'
,
'10.0.0.2'
,
'10.0.0.3'
]
nic_class
=
sim
.
CorundumVerilatorNIC
c
.
wait
=
True
nc_class
=
node
.
CorundumLinuxNode
else
:
experiments
.
append
(
e
)
raise
NameError
(
nic_config
)
else
:
raise
NameError
(
host_config
)
nc_class
.
disk_image
=
'nopaxos'
if
seq_config
==
'ehseq'
:
sequencer
=
sim
.
create_basic_hosts
(
e
,
1
,
'sequencer'
,
net
,
nic_class
,
host_class
,
nc_class
,
node
.
NOPaxosSequencer
,
ip_start
=
100
)
sequencer
[
0
].
sleep
=
1
replicas
=
sim
.
create_basic_hosts
(
e
,
3
,
'replica'
,
net
,
nic_class
,
host_class
,
nc_class
,
node
.
NOPaxosReplica
)
for
i
in
range
(
len
(
replicas
)):
replicas
[
i
].
node_config
.
app
.
index
=
i
replicas
[
i
].
sleep
=
1
clients
=
sim
.
create_basic_hosts
(
e
,
1
,
'client'
,
net
,
nic_class
,
host_class
,
nc_class
,
node
.
NOPaxosClient
,
ip_start
=
4
)
for
c
in
clients
:
c
.
node_config
.
app
.
server_ips
=
[
'10.0.0.1'
,
'10.0.0.2'
,
'10.0.0.3'
]
c
.
wait
=
True
experiments
.
append
(
e
)
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