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
c9d58b9a
Commit
c9d58b9a
authored
Jan 23, 2022
by
Jialin Li
Browse files
experiments: update scripts for the new Tofino adapter
parent
c398b350
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
experiments/pyexps/nopaxos.py
experiments/pyexps/nopaxos.py
+1
-0
experiments/simbricks/nodeconfig.py
experiments/simbricks/nodeconfig.py
+2
-2
experiments/simbricks/simulators.py
experiments/simbricks/simulators.py
+5
-1
No files found.
experiments/pyexps/nopaxos.py
View file @
c9d58b9a
...
@@ -52,6 +52,7 @@ for proto_config in proto_configs:
...
@@ -52,6 +52,7 @@ for proto_config in proto_configs:
# host
# host
if
host_config
==
'qemu'
:
if
host_config
==
'qemu'
:
host_class
=
sim
.
QemuHost
host_class
=
sim
.
QemuHost
net
.
sync
=
False
elif
host_config
==
'gt'
:
elif
host_config
==
'gt'
:
host_class
=
sim
.
Gem5Host
host_class
=
sim
.
Gem5Host
e
.
checkpoint
=
True
e
.
checkpoint
=
True
...
...
experiments/simbricks/nodeconfig.py
View file @
c9d58b9a
...
@@ -396,7 +396,7 @@ class VRClient(AppConfig):
...
@@ -396,7 +396,7 @@ class VRClient(AppConfig):
def
run_cmds
(
self
,
node
):
def
run_cmds
(
self
,
node
):
cmds
=
[]
cmds
=
[]
for
ip
in
self
.
server_ips
:
for
ip
in
self
.
server_ips
:
cmds
.
append
(
'ping -c
1
'
+
ip
)
cmds
.
append
(
'ping -c
5
'
+
ip
)
cmds
.
append
(
'/root/nopaxos/bench/client -c /root/nopaxos.config '
+
cmds
.
append
(
'/root/nopaxos/bench/client -c /root/nopaxos.config '
+
'-m vr -u 2 -h '
+
node
.
ip
)
'-m vr -u 2 -h '
+
node
.
ip
)
return
cmds
return
cmds
...
@@ -415,7 +415,7 @@ class NOPaxosClient(AppConfig):
...
@@ -415,7 +415,7 @@ class NOPaxosClient(AppConfig):
def
run_cmds
(
self
,
node
):
def
run_cmds
(
self
,
node
):
cmds
=
[]
cmds
=
[]
for
ip
in
self
.
server_ips
:
for
ip
in
self
.
server_ips
:
cmds
.
append
(
'ping -c
1
'
+
ip
)
cmds
.
append
(
'ping -c
5
'
+
ip
)
cmd
=
'/root/nopaxos/bench/client -c /root/nopaxos.config '
+
\
cmd
=
'/root/nopaxos/bench/client -c /root/nopaxos.config '
+
\
'-m nopaxos -u 2 -h '
+
node
.
ip
'-m nopaxos -u 2 -h '
+
node
.
ip
if
self
.
use_ehseq
:
if
self
.
use_ehseq
:
...
...
experiments/simbricks/simulators.py
View file @
c9d58b9a
...
@@ -271,9 +271,13 @@ class SwitchNet(NetSim):
...
@@ -271,9 +271,13 @@ class SwitchNet(NetSim):
return
cmd
return
cmd
class
TofinoNet
(
NetSim
):
class
TofinoNet
(
NetSim
):
tofino_log_path
=
'/tmp/model.ldjson'
sync
=
True
def
run_cmd
(
self
,
env
):
def
run_cmd
(
self
,
env
):
cmd
=
env
.
repodir
+
'/sims/tofino/tofino'
cmd
=
env
.
repodir
+
'/sims/tofino/tofino'
cmd
+=
f
' -m
{
self
.
sync_mode
}
-S
{
self
.
sync_period
}
-E
{
self
.
eth_latency
}
'
cmd
+=
f
' -m
{
self
.
sync_mode
}
-S
{
self
.
sync_period
}
-E
{
self
.
eth_latency
}
-t
{
self
.
tofino_log_path
}
'
if
not
self
.
sync
:
cmd
+=
' -u'
for
n
in
self
.
nics
:
for
n
in
self
.
nics
:
cmd
+=
' -s '
+
env
.
nic_eth_path
(
n
)
cmd
+=
' -s '
+
env
.
nic_eth_path
(
n
)
return
cmd
return
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