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
acdacaa8
Commit
acdacaa8
authored
Dec 08, 2020
by
Hejing Li
Browse files
pyexp: nopaxos sync period argument add
parent
7c36facc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
experiments/modes/nodeconfig.py
experiments/modes/nodeconfig.py
+7
-10
experiments/pyexps/nopaxos.py
experiments/pyexps/nopaxos.py
+11
-3
No files found.
experiments/modes/nodeconfig.py
View file @
acdacaa8
...
@@ -315,7 +315,7 @@ class IperfUDPClientLast(AppConfig):
...
@@ -315,7 +315,7 @@ class IperfUDPClientLast(AppConfig):
def
run_cmds
(
self
,
node
):
def
run_cmds
(
self
,
node
):
return
[
'sleep 1'
,
return
[
'sleep 1'
,
'iperf -c '
+
self
.
server_ip
+
' -i 1 -u -b '
+
self
.
rate
,
'iperf -c '
+
self
.
server_ip
+
' -i 1 -u -b '
+
self
.
rate
,
'sleep
1
'
]
'sleep
0.5
'
]
class
IperfUDPClientSleep
(
AppConfig
):
class
IperfUDPClientSleep
(
AppConfig
):
server_ip
=
'10.0.0.1'
server_ip
=
'10.0.0.1'
...
@@ -350,12 +350,7 @@ class VRClient(AppConfig):
...
@@ -350,12 +350,7 @@ class VRClient(AppConfig):
for
ip
in
self
.
server_ips
:
for
ip
in
self
.
server_ips
:
cmds
.
append
(
'ping -c 1 '
+
ip
)
cmds
.
append
(
'ping -c 1 '
+
ip
)
cmds
.
append
(
'/root/nopaxos/bench/client -c /root/nopaxos.config '
+
cmds
.
append
(
'/root/nopaxos/bench/client -c /root/nopaxos.config '
+
<<<<<<<
HEAD
'-m vr -n 2000'
)
'-m vr -n 2000'
)
=======
'-m nopaxos -n 2000'
)
cmds
.
append
(
'sleep infinity'
)
>>>>>>>
experiments
return
cmds
return
cmds
class
NOPaxosReplica
(
AppConfig
):
class
NOPaxosReplica
(
AppConfig
):
...
@@ -366,16 +361,18 @@ class NOPaxosReplica(AppConfig):
...
@@ -366,16 +361,18 @@ class NOPaxosReplica(AppConfig):
class
NOPaxosClient
(
AppConfig
):
class
NOPaxosClient
(
AppConfig
):
server_ips
=
[]
server_ips
=
[]
is_last
=
False
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 1 '
+
ip
)
cmds
.
append
(
'/root/nopaxos/bench/client -c /root/nopaxos.config '
+
cmds
.
append
(
'/root/nopaxos/bench/client -c /root/nopaxos.config '
+
'-m nopaxos -n 2000'
)
'-m nopaxos -n 2000'
)
<<<<<<<
HEAD
if
self
.
is_last
:
=======
cmds
.
append
(
'sleep 1'
)
cmds
.
append
(
'sleep 100'
)
else
:
>>>>>>>
experiments
cmds
.
append
(
'sleep infinity'
)
return
cmds
return
cmds
class
NOPaxosSequencer
(
AppConfig
):
class
NOPaxosSequencer
(
AppConfig
):
...
...
experiments/pyexps/nopaxos.py
View file @
acdacaa8
...
@@ -8,6 +8,7 @@ nic_configs = ['ib', 'cb', 'cv']
...
@@ -8,6 +8,7 @@ nic_configs = ['ib', 'cb', 'cv']
proto_configs
=
[
'vr'
,
'nopaxos'
]
proto_configs
=
[
'vr'
,
'nopaxos'
]
num_client_configs
=
[
1
,
2
,
3
,
4
]
num_client_configs
=
[
1
,
2
,
3
,
4
]
experiments
=
[]
experiments
=
[]
sync_period
=
200
link_rate_opt
=
'--LinkRate=100Gb/s '
# don't forget space at the end
link_rate_opt
=
'--LinkRate=100Gb/s '
# don't forget space at the end
link_latency_opt
=
'--LinkLatency=500ns '
link_latency_opt
=
'--LinkLatency=500ns '
...
@@ -19,6 +20,7 @@ for proto_config in proto_configs:
...
@@ -19,6 +20,7 @@ for proto_config in proto_configs:
for
nic_config
in
nic_configs
:
for
nic_config
in
nic_configs
:
e
=
exp
.
Experiment
(
proto_config
+
'-'
+
host_config
+
'-'
+
nic_config
+
'-'
+
seq_config
+
f
'-
{
num_c
}
'
)
e
=
exp
.
Experiment
(
proto_config
+
'-'
+
host_config
+
'-'
+
nic_config
+
'-'
+
seq_config
+
f
'-
{
num_c
}
'
)
net
=
sim
.
NS3SequencerNet
()
net
=
sim
.
NS3SequencerNet
()
net
.
sync_period
=
sync_period
net
.
opt
=
link_rate_opt
+
link_latency_opt
net
.
opt
=
link_rate_opt
+
link_latency_opt
e
.
add_network
(
net
)
e
.
add_network
(
net
)
...
@@ -27,7 +29,7 @@ for proto_config in proto_configs:
...
@@ -27,7 +29,7 @@ for proto_config in proto_configs:
host_class
=
sim
.
QemuHost
host_class
=
sim
.
QemuHost
elif
host_config
==
'gt'
:
elif
host_config
==
'gt'
:
host_class
=
sim
.
Gem5Host
host_class
=
sim
.
Gem5Host
e
.
checkpoint
=
Fals
e
e
.
checkpoint
=
Tru
e
else
:
else
:
raise
NameError
(
host_config
)
raise
NameError
(
host_config
)
...
@@ -44,7 +46,6 @@ for proto_config in proto_configs:
...
@@ -44,7 +46,6 @@ for proto_config in proto_configs:
else
:
else
:
raise
NameError
(
nic_config
)
raise
NameError
(
nic_config
)
nc_class
.
disk_image
=
'nopaxos'
# app
# app
if
proto_config
==
'vr'
:
if
proto_config
==
'vr'
:
...
@@ -61,21 +62,28 @@ for proto_config in proto_configs:
...
@@ -61,21 +62,28 @@ for proto_config in proto_configs:
sequencer
=
sim
.
create_basic_hosts
(
e
,
1
,
'sequencer'
,
net
,
nic_class
,
sequencer
=
sim
.
create_basic_hosts
(
e
,
1
,
'sequencer'
,
net
,
nic_class
,
host_class
,
nc_class
,
node
.
NOPaxosSequencer
,
ip_start
=
100
)
host_class
,
nc_class
,
node
.
NOPaxosSequencer
,
ip_start
=
100
)
sequencer
[
0
].
sleep
=
1
sequencer
[
0
].
sleep
=
1
sequencer
[
0
].
node_config
.
disk_image
=
'nopaxos'
sequencer
[
0
].
nics
[
0
].
sync_period
=
sync_period
replicas
=
sim
.
create_basic_hosts
(
e
,
3
,
'replica'
,
net
,
nic_class
,
replicas
=
sim
.
create_basic_hosts
(
e
,
3
,
'replica'
,
net
,
nic_class
,
host_class
,
nc_class
,
replica_class
)
host_class
,
nc_class
,
replica_class
)
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
replicas
[
i
].
node_config
.
disk_image
=
'nopaxos'
replicas
[
i
].
nics
[
0
].
sync_period
=
sync_period
clients
=
sim
.
create_basic_hosts
(
e
,
num_c
,
'client'
,
net
,
nic_class
,
clients
=
sim
.
create_basic_hosts
(
e
,
num_c
,
'client'
,
net
,
nic_class
,
host_class
,
nc_class
,
client_class
,
ip_start
=
4
)
host_class
,
nc_class
,
client_class
,
ip_start
=
4
)
for
c
in
clients
:
for
c
in
clients
:
c
.
sleep
=
5
c
.
node_config
.
app
.
server_ips
=
[
'10.0.0.1'
,
'10.0.0.2'
,
'10.0.0.3'
]
c
.
node_config
.
app
.
server_ips
=
[
'10.0.0.1'
,
'10.0.0.2'
,
'10.0.0.3'
]
c
.
node_config
.
disk_image
=
'nopaxos'
c
.
nics
[
0
].
sync_period
=
sync_period
clients
[
num_c
-
1
].
wait
=
True
clients
[
num_c
-
1
].
wait
=
True
clients
[
num_c
-
1
].
sleep
=
5
clients
[
num_c
-
1
].
node_config
.
app
.
is_last
=
True
print
(
e
.
name
)
print
(
e
.
name
)
#print (len(experiments))
#print (len(experiments))
...
...
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