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
78d4c701
Commit
78d4c701
authored
Jul 02, 2022
by
Jonas Kaufmann
Committed by
Antoine Kaufmann
Jul 12, 2022
Browse files
fix all pylint issues except missing doc strings in experiments/
parent
7549fa9e
Changes
63
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
209 additions
and
230 deletions
+209
-230
experiments/cc/generate_json.py
experiments/cc/generate_json.py
+3
-3
experiments/pyexps/ae/corundum_pcilat.py
experiments/pyexps/ae/corundum_pcilat.py
+13
-16
experiments/pyexps/ae/data_cbpcilat.py
experiments/pyexps/ae/data_cbpcilat.py
+8
-10
experiments/pyexps/ae/data_decmp.py
experiments/pyexps/ae/data_decmp.py
+10
-15
experiments/pyexps/ae/data_dist.py
experiments/pyexps/ae/data_dist.py
+4
-6
experiments/pyexps/ae/data_host_scale.py
experiments/pyexps/ae/data_host_scale.py
+4
-5
experiments/pyexps/ae/data_netperf.py
experiments/pyexps/ae/data_netperf.py
+8
-10
experiments/pyexps/ae/data_nopaxos.py
experiments/pyexps/ae/data_nopaxos.py
+3
-3
experiments/pyexps/ae/data_ns3_dctcp.py
experiments/pyexps/ae/data_ns3_dctcp.py
+9
-14
experiments/pyexps/ae/data_pci_latency.py
experiments/pyexps/ae/data_pci_latency.py
+4
-5
experiments/pyexps/ae/data_sb_dctcp.py
experiments/pyexps/ae/data_sb_dctcp.py
+5
-4
experiments/pyexps/ae/data_sync_overhead.py
experiments/pyexps/ae/data_sync_overhead.py
+5
-6
experiments/pyexps/ae/determ.py
experiments/pyexps/ae/determ.py
+9
-9
experiments/pyexps/ae/f1_dctcp.py
experiments/pyexps/ae/f1_dctcp.py
+35
-33
experiments/pyexps/ae/f7_scale.py
experiments/pyexps/ae/f7_scale.py
+17
-16
experiments/pyexps/ae/f9_latency.py
experiments/pyexps/ae/f9_latency.py
+11
-15
experiments/pyexps/ae/no_simbricks.py
experiments/pyexps/ae/no_simbricks.py
+4
-4
experiments/pyexps/ae/no_traffic.py
experiments/pyexps/ae/no_traffic.py
+12
-12
experiments/pyexps/ae/nopaxos.py
experiments/pyexps/ae/nopaxos.py
+24
-24
experiments/pyexps/ae/t1_netperf.py
experiments/pyexps/ae/t1_netperf.py
+21
-20
No files found.
experiments/cc/generate_json.py
View file @
78d4c701
...
...
@@ -26,12 +26,12 @@ for f in glob.glob('testbed-results/*_*pktgap/*.txt'):
runk
=
(
mtu
,
k
)
clients
=
runmap
.
get
(
runk
,
{})
with
open
(
f
,
'r'
)
as
f
:
with
open
(
f
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
clients
[
'host.client.'
+
m
.
group
(
3
)]
=
{
'stdout'
:
f
.
readlines
()}
runmap
[
runk
]
=
clients
for
((
mtu
,
k
),
clients
)
in
runmap
.
items
():
ofn
=
'%s
tb-ib-dumbbell-DCTCPm
%d-%d-1.json'
%
(
outdir
,
k
,
mtu
)
ofn
=
f
'
{
outdir
}
tb-ib-dumbbell-DCTCPm
{
k
}
-
{
mtu
}
-1.json'
data
=
{
'sims'
:
clients
}
with
open
(
ofn
,
'w'
)
as
outfile
:
with
open
(
ofn
,
'w'
,
encoding
=
'utf-8'
)
as
outfile
:
json
.
dump
(
data
,
outfile
)
experiments/pyexps/ae/corundum_pcilat.py
View file @
78d4c701
...
...
@@ -31,9 +31,12 @@
# TCP_STREAM test
#
# The command to run all the experiments is:
# $: python3 run.py pyexps/ae/corundum_pcilat.py --filter cblat-gt-sw --verbose --force
# $: python3 run.py pyexps/ae/corundum_pcilat.py --filter cblat-gt-sw --verbose
# --force
########################################################################
from
functools
import
partial
import
simbricks.nodeconfig
as
node
import
simbricks.simulators
as
sim
from
simbricks.simulator_utils
import
create_basic_hosts
...
...
@@ -52,28 +55,22 @@ for pci_type in pci_latency:
net
.
eth_latency
=
pci_type
e
.
add_network
(
net
)
h
ost
_c
lass
=
sim
.
Gem5Host
H
ost
C
lass
=
sim
.
Gem5Host
e
.
checkpoint
=
True
def
nic_pci
():
# pylint: disable=redefined-outer-name
def
nic_pci
(
pci_type
):
n
=
sim
.
CorundumBMNIC
()
n
.
sync_period
=
pci_type
n
.
pci_latency
=
pci_type
return
n
n
ic
_c
lass
=
nic_pci
nc_c
lass
=
node
.
CorundumLinuxNode
N
ic
C
lass
=
partial
(
nic_pci
,
pci_type
)
NcC
lass
=
node
.
CorundumLinuxNode
# create servers and clients
servers
=
create_basic_hosts
(
e
,
1
,
'server'
,
net
,
nic_class
,
host_class
,
nc_class
,
node
.
NetperfServer
e
,
1
,
'server'
,
net
,
NicClass
,
HostClass
,
NcClass
,
node
.
NetperfServer
)
clients
=
create_basic_hosts
(
...
...
@@ -81,9 +78,9 @@ for pci_type in pci_latency:
1
,
'client'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
node
.
NetperfClient
,
ip_start
=
2
)
...
...
experiments/pyexps/ae/data_cbpcilat.py
View file @
78d4c701
...
...
@@ -23,7 +23,7 @@
import
sys
from
time
import
gmtime
,
strftime
from
utils.netperf
import
*
from
utils.netperf
import
parse_netperf_run
def
fmt_lat
(
lat
):
...
...
@@ -32,20 +32,21 @@ def fmt_lat(lat):
x
=
float
(
lat
)
if
x
>=
1000.
:
return
'%.1f
\\
,ms'
%
(
x
/
1000
)
return
f
'
{
x
/
1000
:.
1
f
}
\\
,ms'
else
:
return
'%d
\\
,$
\\
mu$s'
%
(
int
(
x
))
return
f
'
{
int
(
x
)
}
\\
,$
\\
mu$s'
# pylint: disable=redefined-outer-name
def
fmt_tp
(
tp
):
if
not
tp
:
return
''
x
=
float
(
tp
)
if
x
>
1000.
:
return
'%.2f
\\
,G'
%
(
x
/
1000
)
return
f
'
{
x
/
1000
:.
2
f
}
\\
,G'
else
:
return
'%d
\\
,M'
%
(
int
(
x
))
return
f
'
{
int
(
x
)
}
\\
,M'
hosts
=
[(
'gt'
,
'G5'
)]
...
...
@@ -57,7 +58,7 @@ outdir = sys.argv[1]
for
(
h
,
h_l
)
in
hosts
:
for
(
nic
,
nic_l
)
in
nics
:
for
(
net
,
net_l
)
in
nets
:
path
=
'%s/cblat-%s-%s-1.json'
%
(
outdir
,
h
,
net
)
path
=
f
'
{
outdir
}
/cblat-
{
h
}
-
{
net
}
-1.json'
data
=
parse_netperf_run
(
path
)
if
'simtime'
in
data
:
t
=
strftime
(
'%H:%M:%S'
,
gmtime
(
data
[
'simtime'
]))
...
...
@@ -67,7 +68,4 @@ for (h, h_l) in hosts:
tp
=
fmt_tp
(
data
.
get
(
'throughput'
,
''
))
latMean
=
fmt_lat
(
data
.
get
(
'latenyMean'
,
''
))
latTail
=
fmt_lat
(
data
.
get
(
'latenyTail'
,
''
))
print
(
' %s & %s & %s & %s & %s & %s
\\\\
'
%
(
h_l
,
nic_l
,
net_l
,
tp
,
latMean
,
t
)
)
print
(
' {h_l} & {nic_l} & {net_l} & {tp} & {latMean} & {t}
\\\\
'
)
experiments/pyexps/ae/data_decmp.py
View file @
78d4c701
...
...
@@ -20,9 +20,6 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import
glob
import
itertools
import
json
import
os
import
sys
...
...
@@ -34,19 +31,17 @@ out_file = sys.argv[1]
if
not
os
.
path
.
isfile
(
out_file
):
print
(
'no result file at: '
+
out_file
)
exit
(
0
)
sys
.
exit
()
f
=
open
(
out_file
,
'r'
)
lines
=
f
.
readlines
()
with
open
(
out_file
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
lines
=
f
.
readlines
()
for
line
in
lines
:
for
line
in
lines
:
if
'start:'
in
line
:
start_time
=
float
(
line
.
split
()[
1
])
if
'end:'
in
line
:
end_time
=
float
(
line
.
split
()[
1
])
time_diff
=
end_time
-
start_time
print
(
'SimTime: %d (s)'
%
(
time_diff
))
f
.
close
()
time_diff
=
end_time
-
start_time
print
(
f
'SimTime:
{
time_diff
}
(s)'
)
experiments/pyexps/ae/data_dist.py
View file @
78d4c701
...
...
@@ -20,9 +20,6 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import
glob
import
itertools
import
json
import
os
import
sys
...
...
@@ -35,6 +32,7 @@ basedir = sys.argv[1]
types_of_host
=
[
2
,
8
,
16
,
32
]
# pylint: disable=redefined-outer-name
def
time_diff_min
(
data
):
start_time
=
data
[
'start_time'
]
end_time
=
data
[
'end_time'
]
...
...
@@ -48,13 +46,13 @@ print('# Number of hosts' + '\t' + 'Sim.Time')
for
workload
in
types_of_host
:
line
=
[
str
(
workload
)]
path_pat
=
'%srun-%d.out'
%
(
basedir
,
workload
)
path_pat
=
f
'
{
basedir
}
run-
{
workload
}
.out'
if
not
os
.
path
.
isfile
(
path_pat
):
#print("no result file at: " + path_pat)
line
.
append
(
' '
)
else
:
with
open
(
path_pat
,
'r'
)
as
f
:
with
open
(
path_pat
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
read_lines
=
f
.
readlines
()
for
l
in
read_lines
:
...
...
@@ -67,6 +65,6 @@ for workload in types_of_host:
#print("end_time: %d" % end_time)
sim_time
=
(
end_time
-
start_time
)
/
60
line
.
append
(
'%d'
%
sim_time
)
line
.
append
(
f
'
{
sim_time
}
'
)
print
(
'
\t
'
.
join
(
line
))
experiments/pyexps/ae/data_host_scale.py
View file @
78d4c701
...
...
@@ -21,9 +21,7 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import
glob
import
itertools
import
json
import
os
import
sys
if
len
(
sys
.
argv
)
!=
2
:
...
...
@@ -35,6 +33,7 @@ basedir = sys.argv[1]
types_of_client
=
[
1
,
4
,
9
,
14
,
20
]
# pylint: disable=redefined-outer-name
def
time_diff_min
(
data
):
start_time
=
data
[
'start_time'
]
end_time
=
data
[
'end_time'
]
...
...
@@ -48,7 +47,7 @@ print('# Number of hosts' + '\t' + 'Sim.Time')
for
workload
in
types_of_client
:
line
=
[
str
(
workload
)]
path_pat
=
'%s
host-gt-ib-sw-1000m-
%s'
%
(
basedir
,
workload
)
path_pat
=
f
'
{
basedir
}
host-gt-ib-sw-1000m-
{
workload
}
'
runs
=
[]
for
path
in
glob
.
glob
(
path_pat
+
'-*.json'
):
...
...
@@ -56,7 +55,7 @@ for workload in types_of_client:
# skip checkpoints
continue
with
open
(
path
,
'r'
)
as
f
:
with
open
(
path
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
data
=
json
.
load
(
f
)
res
=
time_diff_min
(
data
)
...
...
@@ -66,6 +65,6 @@ for workload in types_of_client:
if
not
runs
:
line
.
append
(
' '
)
else
:
line
.
append
(
'%d'
%
(
sum
(
runs
)
/
len
(
runs
)
)
)
line
.
append
(
f
'
{
sum
(
runs
)
/
len
(
runs
)
}
'
)
print
(
'
\t
'
.
join
(
line
))
experiments/pyexps/ae/data_netperf.py
View file @
78d4c701
...
...
@@ -23,7 +23,7 @@
import
sys
from
time
import
gmtime
,
strftime
from
utils.netperf
import
*
from
utils.netperf
import
parse_netperf_run
def
fmt_lat
(
lat
):
...
...
@@ -32,20 +32,21 @@ def fmt_lat(lat):
x
=
float
(
lat
)
if
x
>=
1000.
:
return
'%.1f
\\
,ms'
%
(
x
/
1000
)
return
f
'
{
x
/
1000
:.
1
f
}
\\
,ms'
else
:
return
'%d
\\
,$
\\
mu$s'
%
(
int
(
x
))
return
f
'
{
int
(
x
)
}
\\
,$
\\
mu$s'
# pylint: disable=redefined-outer-name
def
fmt_tp
(
tp
):
if
not
tp
:
return
''
x
=
float
(
tp
)
if
x
>
1000.
:
return
'%.2f
\\
,G'
%
(
x
/
1000
)
return
f
'
{
x
/
1000
:.
2
f
}
\\
,G'
else
:
return
'%d
\\
,M'
%
(
int
(
x
))
return
f
'
{
int
(
x
)
}
\\
,M'
hosts
=
[(
'qemu'
,
'QK'
),
(
'qt'
,
'QT'
),
(
'gt'
,
'G5'
)]
...
...
@@ -57,7 +58,7 @@ outdir = sys.argv[1]
for
(
h
,
h_l
)
in
hosts
:
for
(
nic
,
nic_l
)
in
nics
:
for
(
net
,
net_l
)
in
nets
:
path
=
'%s/nf-%s-%s-%s-1.json'
%
(
outdir
,
h
,
net
,
nic
)
path
=
f
'
{
outdir
}
/nf-
{
h
}
-
{
net
}
-
{
nic
}
-1.json'
data
=
parse_netperf_run
(
path
)
if
'simtime'
in
data
:
t
=
strftime
(
'%H:%M:%S'
,
gmtime
(
data
[
'simtime'
]))
...
...
@@ -67,7 +68,4 @@ for (h, h_l) in hosts:
tp
=
fmt_tp
(
data
.
get
(
'throughput'
,
''
))
latMean
=
fmt_lat
(
data
.
get
(
'latenyMean'
,
''
))
latTail
=
fmt_lat
(
data
.
get
(
'latenyTail'
,
''
))
print
(
' %s & %s & %s & %s & %s & %s
\\\\
'
%
(
h_l
,
nic_l
,
net_l
,
tp
,
latMean
,
t
)
)
print
(
f
'
{
h_l
}
&
{
nic_l
}
&
{
net_l
}
&
{
tp
}
&
{
latMean
}
&
{
t
}
\\\\
'
)
experiments/pyexps/ae/data_nopaxos.py
View file @
78d4c701
...
...
@@ -36,9 +36,9 @@ basedir = sys.argv[1]
for
network
in
types_of_network
:
for
c
in
num_clients
:
line
=
[
network
,
str
(
c
)]
path
=
'%s
/nopaxos-qt-ib-
%s-%s-1.json'
%
(
basedir
,
network
,
c
)
path
=
f
'
{
basedir
}
/nopaxos-qt-ib-
{
network
}
-
{
c
}
-1.json'
ret
=
pn
.
parse_nopaxos_run
(
c
,
path
)
if
ret
is
not
None
:
line
.
append
(
'%d'
%
ret
[
'
throughput'
]
)
line
.
append
(
'%d'
%
ret
[
'
latency'
]
)
line
.
append
(
f
'
{
ret
[
"
throughput
"
]
}
'
)
line
.
append
(
f
'
{
ret
[
"
latency
"
]
}
'
)
print
(
'
\t
'
.
join
(
line
))
experiments/pyexps/ae/data_ns3_dctcp.py
View file @
78d4c701
...
...
@@ -20,12 +20,9 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import
itertools
import
os
import
sys
import
utils.iperf
if
len
(
sys
.
argv
)
!=
2
:
print
(
'Usage: ns3-dctcp.py OUTDIR'
)
sys
.
exit
(
1
)
...
...
@@ -41,14 +38,14 @@ print('\t'.join(['threshold'] + confignames))
for
k_val
in
range
(
0
,
max_k
+
1
,
k_step
):
line
=
[
str
(
k_val
)]
path_pat
=
'%s
dctcp-modes-tput-4000-
%d
-50us.dat'
%
(
basedir
,
k_val
)
path_pat
=
f
'
{
basedir
}
dctcp-modes-tput-4000-
{
k_val
}
-50us.dat'
tps
=
[]
if
not
os
.
path
.
isfile
(
path_pat
):
print
(
'no result file at: '
+
path_pat
)
exit
(
0
)
f
=
open
(
path_pat
,
'r'
)
sys
.
exit
()
with
open
(
path_pat
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
lines
=
f
.
readlines
()
tp
=
float
(
lines
[
1
].
split
()[
2
])
/
1000
...
...
@@ -57,11 +54,9 @@ for k_val in range(0, max_k + 1, k_step):
tp
=
float
(
lines
[
2
].
split
()[
2
])
/
1000
tps
.
append
(
tp
)
f
.
close
()
total_tp
=
sum
(
tps
)
# TP * (MTU + PPP(2)) / (MTU - IP (20) - TCP w/option (24))
tp_calib
=
total_tp
*
(
mtu
+
2
)
/
(
mtu
-
20
-
24
)
line
.
append
(
'%.2f'
%
(
tp_calib
)
)
line
.
append
(
f
'
{
tp_calib
:.
2
f
}
'
)
print
(
'
\t
'
.
join
(
line
))
experiments/pyexps/ae/data_pci_latency.py
View file @
78d4c701
...
...
@@ -21,9 +21,7 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import
glob
import
itertools
import
json
import
os
import
sys
if
len
(
sys
.
argv
)
!=
2
:
...
...
@@ -35,6 +33,7 @@ basedir = sys.argv[1]
types_of_pci
=
[
10
,
50
,
100
,
500
,
1000
]
# pylint: disable=redefined-outer-name
def
time_diff_min
(
data
):
start_time
=
data
[
'start_time'
]
end_time
=
data
[
'end_time'
]
...
...
@@ -48,7 +47,7 @@ print('# PCI latency (ns)' + '\t' + 'Sim.Time')
for
workload
in
types_of_pci
:
line
=
[
str
(
workload
)]
path_pat
=
'%s
pci-gt-ib-sw-
%s'
%
(
basedir
,
workload
)
path_pat
=
f
'
{
basedir
}
pci-gt-ib-sw-
{
workload
}
'
runs
=
[]
for
path
in
glob
.
glob
(
path_pat
+
'-*.json'
):
...
...
@@ -56,7 +55,7 @@ for workload in types_of_pci:
# skip checkpoints
continue
with
open
(
path
,
'r'
)
as
f
:
with
open
(
path
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
data
=
json
.
load
(
f
)
res
=
time_diff_min
(
data
)
...
...
@@ -66,6 +65,6 @@ for workload in types_of_pci:
if
not
runs
:
line
.
append
(
' '
)
else
:
line
.
append
(
'%d'
%
(
sum
(
runs
)
/
len
(
runs
)
)
)
line
.
append
(
f
'
{
sum
(
runs
)
/
len
(
runs
)
}
'
)
print
(
'
\t
'
.
join
(
line
))
experiments/pyexps/ae/data_sb_dctcp.py
View file @
78d4c701
...
...
@@ -43,7 +43,7 @@ print('\t'.join(['threshold'] + confignames))
for
k_val
in
range
(
0
,
max_k
+
1
,
k_step
):
line
=
[
str
(
k_val
)]
for
h
,
mtu
in
configs
:
path_pat
=
'%s%s
-ib-dumbbell-DCTCPm
%d-%d'
%
(
basedir
,
h
,
k_val
,
mtu
)
path_pat
=
f
'
{
basedir
}{
h
}
-ib-dumbbell-DCTCPm
{
k_val
}
-
{
mtu
}
'
res
=
utils
.
iperf
.
parse_iperf
(
path_pat
)
if
res
[
'avg'
]
is
None
:
...
...
@@ -52,11 +52,12 @@ for k_val in range(0, max_k + 1, k_step):
tp
=
res
[
'avg'
]
# TP * (MTU ) / (MTU - IP (20) - TCP w/option (24))
if
(
h
==
'gt'
or
h
==
'qt'
):
if
h
in
(
'gt'
,
'qt'
):
tp_calib
=
tp
*
(
mtu
)
/
(
mtu
-
20
-
24
)
else
:
# TP * (MTU + ETH(14) + PHY(24)) / (MTU - IP (20) - TCP w/option (24))
# TP * (MTU + ETH(14) + PHY(24)) / (MTU - IP (20)
# - TCP w/option (24))
tp_calib
=
tp
*
(
mtu
+
14
+
24
)
/
(
mtu
-
20
-
24
)
line
.
append
(
'%.2f'
%
(
tp_calib
)
)
line
.
append
(
f
'
{
tp_calib
:.
2
f
}
'
)
print
(
'
\t
'
.
join
(
line
))
experiments/pyexps/ae/data_sync_overhead.py
View file @
78d4c701
...
...
@@ -21,9 +21,7 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import
glob
import
itertools
import
json
import
os
import
sys
if
len
(
sys
.
argv
)
!=
2
:
...
...
@@ -36,6 +34,7 @@ types_of_workload = ['sleep', 'busy']
types_of_sync
=
[
'with'
,
'without'
]
# with or without simbricks
# pylint: disable=redefined-outer-name
def
time_diff_min
(
data
):
start_time
=
data
[
'start_time'
]
end_time
=
data
[
'end_time'
]
...
...
@@ -50,9 +49,9 @@ for workload in types_of_workload:
line
=
[
workload
]
for
sync
in
types_of_sync
:
if
sync
==
'with'
:
path_pat
=
'%s
noTraf-gt-ib-sw-
%s'
%
(
basedir
,
workload
)
path_pat
=
f
'
{
basedir
}
noTraf-gt-ib-sw-
{
workload
}
'
else
:
path_pat
=
'%sno_simb-gt-%s'
%
(
basedir
,
workload
)
path_pat
=
f
'
{
basedir
}
no_simb-gt-
{
workload
}
'
runs
=
[]
for
path
in
glob
.
glob
(
path_pat
+
'-*.json'
):
...
...
@@ -60,7 +59,7 @@ for workload in types_of_workload:
# skip checkpoints
continue
with
open
(
path
,
'r'
)
as
f
:
with
open
(
path
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
data
=
json
.
load
(
f
)
res
=
time_diff_min
(
data
)
...
...
@@ -70,6 +69,6 @@ for workload in types_of_workload:
if
not
runs
:
line
.
append
(
' '
)
else
:
line
.
append
(
'%d'
%
(
sum
(
runs
)
/
len
(
runs
)
)
)
line
.
append
(
f
'
{
sum
(
runs
)
/
len
(
runs
)
}
'
)
print
(
'
\t
'
.
join
(
line
))
experiments/pyexps/ae/determ.py
View file @
78d4c701
...
...
@@ -38,11 +38,11 @@ experiments = []
e
=
exp
.
Experiment
(
'dt-gt-ib-sw'
)
net
=
sim
.
SwitchNet
()
e
.
add_network
(
net
)
h
ost
_c
lass
=
sim
.
Gem5Host
H
ost
C
lass
=
sim
.
Gem5Host
e
.
checkpoint
=
False
n
ic
_c
lass
=
sim
.
I40eNIC
nc_c
lass
=
node
.
I40eLinuxNode
N
ic
C
lass
=
sim
.
I40eNIC
NcC
lass
=
node
.
I40eLinuxNode
# create a host
servers
=
create_basic_hosts
(
...
...
@@ -50,9 +50,9 @@ servers = create_basic_hosts(
1
,
'server'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
node
.
IperfUDPServer
,
ip_start
=
2
)
...
...
@@ -69,9 +69,9 @@ clients = create_basic_hosts(
1
,
'client'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
node
.
IperfUDPShortClient
,
ip_start
=
2
)
...
...
experiments/pyexps/ae/f1_dctcp.py
View file @
78d4c701
...
...
@@ -67,27 +67,27 @@ ip_start = '192.168.64.1'
experiments
=
[]
# set network sim
n
et
_c
lass
=
sim
.
NS3DumbbellNet
N
et
C
lass
=
sim
.
NS3DumbbellNet
for
mtu
in
types_of_mtu
:
for
h
in
types_of_host
:
for
c
in
types_of_nic
:
for
h
ost
in
types_of_host
:
for
ni
c
in
types_of_nic
:
for
k_val
in
range
(
0
,
max_k
+
1
,
k_step
):
net
=
n
et
_c
lass
()
net
=
N
et
C
lass
()
net
.
opt
=
link_rate_opt
+
link_latency_opt
+
f
'--EcnTh=
{
k_val
}
'
e
=
exp
.
Experiment
(
h
+
'-'
+
c
+
'-'
+
'dumbbell'
+
'-'
+
'DCTCPm'
+
h
ost
+
'-'
+
ni
c
+
'-'
+
'dumbbell'
+
'-'
+
'DCTCPm'
+
f
'
{
k_val
}
'
+
f
'-
{
mtu
}
'
)
e
.
add_network
(
net
)
freq
=
cpu_freq
# host
if
h
==
'qemu'
:
h
ost
_c
lass
=
sim
.
QemuHost
elif
h
==
'qt'
:
if
h
ost
==
'qemu'
:
H
ost
C
lass
=
sim
.
QemuHost
elif
h
ost
==
'qt'
:
freq
=
cpu_freq_qemu
def
qemu_timing
():
...
...
@@ -95,17 +95,17 @@ for mtu in types_of_mtu:
h
.
sync
=
True
return
h
h
ost
_c
lass
=
qemu_timing
elif
h
==
'gt'
:
H
ost
C
lass
=
qemu_timing
elif
h
ost
==
'gt'
:
def
gem5_timing
():
h
=
sim
.
Gem5Host
()
#h.sys_clock = sys_clock
return
h
h
ost
_c
lass
=
gem5_timing
H
ost
C
lass
=
gem5_timing
e
.
checkpoint
=
True
elif
h
==
'gO3'
:
elif
h
ost
==
'gO3'
:
def
gem5_o3
():
h
=
sim
.
Gem5Host
()
...
...
@@ -113,32 +113,32 @@ for mtu in types_of_mtu:
h
.
sys_clock
=
sys_clock
return
h
h
ost
_c
lass
=
gem5_o3
H
ost
C
lass
=
gem5_o3
e
.
checkpoint
=
True
else
:
raise
NameError
(
h
)
raise
NameError
(
h
ost
)
# nic
if
c
==
'ib'
:
n
ic
_c
lass
=
sim
.
I40eNIC
nc_c
lass
=
node
.
I40eDCTCPNode
elif
c
==
'cb'
:
n
ic
_c
lass
=
sim
.
CorundumBMNIC
nc_c
lass
=
node
.
CorundumDCTCPNode
elif
c
==
'cv'
:
n
ic
_c
lass
=
sim
.
CorundumVerilatorNIC
nc_c
lass
=
node
.
CorundumDCTCPNode
if
ni
c
==
'ib'
:
N
ic
C
lass
=
sim
.
I40eNIC
NcC
lass
=
node
.
I40eDCTCPNode
elif
ni
c
==
'cb'
:
N
ic
C
lass
=
sim
.
CorundumBMNIC
NcC
lass
=
node
.
CorundumDCTCPNode
elif
ni
c
==
'cv'
:
N
ic
C
lass
=
sim
.
CorundumVerilatorNIC
NcC
lass
=
node
.
CorundumDCTCPNode
else
:
raise
NameError
(
c
)
raise
NameError
(
ni
c
)
servers
=
create_dctcp_hosts
(
e
,
num_pairs
,
'server'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
node
.
DctcpServer
,
freq
,
mtu
...
...
@@ -148,9 +148,9 @@ for mtu in types_of_mtu:
num_pairs
,
'client'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
node
.
DctcpClient
,
freq
,
mtu
,
...
...
@@ -162,10 +162,12 @@ for mtu in types_of_mtu:
cl
.
node_config
.
app
.
server_ip
=
servers
[
i
].
node_config
.
ip
i
+=
1
# All the clients will not poweroff after finishing iperf test except the last one
# This is to prevent the simulation gets stuck when one of host exits.
# All the clients will not poweroff after finishing iperf test
# except the last one This is to prevent the simulation gets
# stuck when one of host exits.
# The last client waits for the output printed in other hosts, then cleanup
# The last client waits for the output printed in other hosts,
# then cleanup
clients
[
num_pairs
-
1
].
node_config
.
app
.
is_last
=
True
clients
[
num_pairs
-
1
].
wait
=
True
...
...
experiments/pyexps/ae/f7_scale.py
View file @
78d4c701
...
...
@@ -29,7 +29,8 @@
# NIC: Intel i40e behavioral model
# NET: Switch behavioral model
#
# In each simulation, one server host and several clients are connected by a switch
# In each simulation, one server host and several clients are connected by a
# switch
# [HOST_0] - [NIC_0] ---- [SWITCH] ---- [NIC_1] - [HOST_1]
# server | .....| client_0
# Client_1 Clinet_n
...
...
@@ -83,7 +84,7 @@ for n_client in num_client_types:
# host
if
host_type
==
'qemu'
:
h
ost
_c
lass
=
sim
.
QemuHost
H
ost
C
lass
=
sim
.
QemuHost
elif
host_type
==
'qt'
:
def
qemu_timing
():
...
...
@@ -91,23 +92,23 @@ for n_client in num_client_types:
h
.
sync
=
True
return
h
h
ost
_c
lass
=
qemu_timing
H
ost
C
lass
=
qemu_timing
elif
host_type
==
'gt'
:
h
ost
_c
lass
=
sim
.
Gem5Host
H
ost
C
lass
=
sim
.
Gem5Host
e
.
checkpoint
=
True
else
:
raise
NameError
(
host_type
)
# nic
if
nic_type
==
'ib'
:
n
ic
_c
lass
=
sim
.
I40eNIC
nc_c
lass
=
node
.
I40eLinuxNode
N
ic
C
lass
=
sim
.
I40eNIC
NcC
lass
=
node
.
I40eLinuxNode
elif
nic_type
==
'cb'
:
n
ic
_c
lass
=
sim
.
CorundumBMNIC
nc_c
lass
=
node
.
CorundumLinuxNode
N
ic
C
lass
=
sim
.
CorundumBMNIC
NcC
lass
=
node
.
CorundumLinuxNode
elif
nic_type
==
'cv'
:
n
ic
_c
lass
=
sim
.
CorundumVerilatorNIC
nc_c
lass
=
node
.
CorundumLinuxNode
N
ic
C
lass
=
sim
.
CorundumVerilatorNIC
NcC
lass
=
node
.
CorundumLinuxNode
else
:
raise
NameError
(
nic_type
)
...
...
@@ -117,9 +118,9 @@ for n_client in num_client_types:
1
,
'server'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
node
.
IperfUDPServer
)
...
...
@@ -128,9 +129,9 @@ for n_client in num_client_types:
n_client
,
'client'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
node
.
IperfUDPClient
,
ip_start
=
2
)
...
...
experiments/pyexps/ae/f9_latency.py
View file @
78d4c701
...
...
@@ -34,6 +34,8 @@
# $: python3 run.py pyexps/ae/t1_combination.py --filter nf-* --verbose
########################################################################
from
functools
import
partial
import
simbricks.nodeconfig
as
node
import
simbricks.simulators
as
sim
from
simbricks.simulator_utils
import
create_basic_hosts
...
...
@@ -52,28 +54,22 @@ for pci_type in pci_latency:
net
.
eth_latency
=
pci_type
e
.
add_network
(
net
)
h
ost
_c
lass
=
sim
.
Gem5Host
H
ost
C
lass
=
sim
.
Gem5Host
e
.
checkpoint
=
True
def
nic_pci
():
# pylint: disable=redefined-outer-name
def
nic_pci
(
pci_type
:
int
):
n
=
sim
.
I40eNIC
()
n
.
sync_period
=
pci_type
n
.
pci_latency
=
pci_type
return
n
n
ic
_c
lass
=
nic_pci
nc_c
lass
=
node
.
I40eLinuxNode
N
ic
C
lass
=
partial
(
nic_pci
,
pci_type
)
NcC
lass
=
node
.
I40eLinuxNode
# create servers and clients
servers
=
create_basic_hosts
(
e
,
1
,
'server'
,
net
,
nic_class
,
host_class
,
nc_class
,
node
.
NetperfServer
e
,
1
,
'server'
,
net
,
NicClass
,
HostClass
,
NcClass
,
node
.
NetperfServer
)
clients
=
create_basic_hosts
(
...
...
@@ -81,9 +77,9 @@ for pci_type in pci_latency:
1
,
'client'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
node
.
NetperfClient
,
ip_start
=
2
)
...
...
experiments/pyexps/ae/no
-
simbricks.py
→
experiments/pyexps/ae/no
_
simbricks.py
View file @
78d4c701
...
...
@@ -33,17 +33,17 @@ for app_type in app_types:
e
=
exp
.
Experiment
(
'no_simb-gt-'
+
app_type
)
h
ost
_c
lass
=
sim
.
Gem5Host
H
ost
C
lass
=
sim
.
Gem5Host
e
.
checkpoint
=
True
e
.
no_simbricks
=
True
nc_c
lass
=
node
.
I40eLinuxNode
NcC
lass
=
node
.
I40eLinuxNode
# create servers and clients
host
=
h
ost
_c
lass
()
host
=
H
ost
C
lass
()
host
.
name
=
'host.0'
host
.
cpu_freq
=
'3GHz'
node_config
=
nc_c
lass
()
node_config
=
NcC
lass
()
node_config
.
ip
=
'10.0.0.1'
node_config
.
app
=
node
.
NoTraffic
()
node_config
.
cores
=
1
...
...
experiments/pyexps/ae/no_traffic.py
View file @
78d4c701
...
...
@@ -57,7 +57,7 @@ for host_type in host_types:
# host
if
host_type
==
'qemu'
:
h
ost
_c
lass
=
sim
.
QemuHost
H
ost
C
lass
=
sim
.
QemuHost
elif
host_type
==
'qt'
:
def
qemu_timing
():
...
...
@@ -65,23 +65,23 @@ for host_type in host_types:
h
.
sync
=
True
return
h
h
ost
_c
lass
=
qemu_timing
H
ost
C
lass
=
qemu_timing
elif
host_type
==
'gt'
:
h
ost
_c
lass
=
sim
.
Gem5Host
H
ost
C
lass
=
sim
.
Gem5Host
e
.
checkpoint
=
True
else
:
raise
NameError
(
host_type
)
# nic
if
nic_type
==
'ib'
:
n
ic
_c
lass
=
sim
.
I40eNIC
nc_c
lass
=
node
.
I40eLinuxNode
N
ic
C
lass
=
sim
.
I40eNIC
NcC
lass
=
node
.
I40eLinuxNode
elif
nic_type
==
'cb'
:
n
ic
_c
lass
=
sim
.
CorundumBMNIC
nc_c
lass
=
node
.
CorundumLinuxNode
N
ic
C
lass
=
sim
.
CorundumBMNIC
NcC
lass
=
node
.
CorundumLinuxNode
elif
nic_type
==
'cv'
:
n
ic
_c
lass
=
sim
.
CorundumVerilatorNIC
nc_c
lass
=
node
.
CorundumLinuxNode
N
ic
C
lass
=
sim
.
CorundumVerilatorNIC
NcC
lass
=
node
.
CorundumLinuxNode
else
:
raise
NameError
(
nic_type
)
...
...
@@ -91,9 +91,9 @@ for host_type in host_types:
n_client
,
'client'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
node
.
NoTraffic
,
ip_start
=
2
)
...
...
experiments/pyexps/ae/nopaxos.py
View file @
78d4c701
...
...
@@ -56,10 +56,10 @@ for proto_config in proto_configs:
# host
if
host_config
==
'qemu'
:
h
ost
_c
lass
=
sim
.
QemuHost
H
ost
C
lass
=
sim
.
QemuHost
net
.
sync
=
False
elif
host_config
==
'gt'
:
h
ost
_c
lass
=
sim
.
Gem5Host
H
ost
C
lass
=
sim
.
Gem5Host
e
.
checkpoint
=
True
elif
host_config
==
'qt'
:
...
...
@@ -68,30 +68,30 @@ for proto_config in proto_configs:
h
.
sync
=
True
return
h
h
ost
_c
lass
=
qemu_timing
H
ost
C
lass
=
qemu_timing
else
:
raise
NameError
(
host_config
)
# nic
if
nic_config
==
'ib'
:
n
ic
_c
lass
=
sim
.
I40eNIC
nc_c
lass
=
node
.
I40eLinuxNode
N
ic
C
lass
=
sim
.
I40eNIC
NcC
lass
=
node
.
I40eLinuxNode
elif
nic_config
==
'cb'
:
n
ic
_c
lass
=
sim
.
CorundumBMNIC
nc_c
lass
=
node
.
CorundumLinuxNode
N
ic
C
lass
=
sim
.
CorundumBMNIC
NcC
lass
=
node
.
CorundumLinuxNode
elif
nic_config
==
'cv'
:
n
ic
_c
lass
=
sim
.
CorundumVerilatorNIC
nc_c
lass
=
node
.
CorundumLinuxNode
N
ic
C
lass
=
sim
.
CorundumVerilatorNIC
NcC
lass
=
node
.
CorundumLinuxNode
else
:
raise
NameError
(
nic_config
)
# app
if
proto_config
==
'vr'
:
r
eplica
_c
lass
=
node
.
VRReplica
c
lient
_c
lass
=
node
.
VRClient
R
eplica
C
lass
=
node
.
VRReplica
C
lient
C
lass
=
node
.
VRClient
elif
proto_config
==
'nopaxos'
:
r
eplica
_c
lass
=
node
.
NOPaxosReplica
c
lient
_c
lass
=
node
.
NOPaxosClient
R
eplica
C
lass
=
node
.
NOPaxosReplica
C
lient
C
lass
=
node
.
NOPaxosClient
else
:
raise
NameError
(
proto_config
)
...
...
@@ -102,9 +102,9 @@ for proto_config in proto_configs:
1
,
'sequencer'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
node
.
NOPaxosSequencer
,
ip_start
=
100
)
...
...
@@ -117,10 +117,10 @@ for proto_config in proto_configs:
3
,
'replica'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
r
eplica
_c
lass
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
R
eplica
C
lass
)
for
i
in
range
(
len
(
replicas
)):
replicas
[
i
].
node_config
.
app
.
index
=
i
...
...
@@ -133,10 +133,10 @@ for proto_config in proto_configs:
num_c
,
'client'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
c
lient
_c
lass
,
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
C
lient
C
lass
,
ip_start
=
4
)
...
...
experiments/pyexps/ae/t1_netperf.py
View file @
78d4c701
...
...
@@ -21,12 +21,13 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
########################################################################
# This script is for reproducing [Table 1] in the paper.
#
It generates
experiments for all combinations of simulation.
# This script is for reproducing [Table 1] in the paper.
It generates
# experiments for all combinations of simulation.
#
# Host type has qemu-kvm(qemu in short), gem5-timing-mode(gt), qemu-timing-mode(qt)
# Nic type has Intel_i40e behavioral model(ib), corundum behavioral model(cb), corundum verilator(cv)
# Net type has Switch behavioral model(sw), ns-3(ns3)
# Host type has qemu-kvm(qemu in short), gem5-timing-mode(gt),
# qemu-timing-mode(qt) Nic type has Intel_i40e behavioral model(ib), corundum
# behavioral model(cb), corundum verilator(cv) Net type has Switch behavioral
# model(sw), ns-3(ns3)
#
# In each simulation, two hosts are connected by a switch
# [HOST_0] - [NIC_0] ---- [SWITCH] ---- [NIC_1] - [HOST_1]
...
...
@@ -70,7 +71,7 @@ for host_type in host_types:
# host
if
host_type
==
'qemu'
:
h
ost
_c
lass
=
sim
.
QemuHost
H
ost
C
lass
=
sim
.
QemuHost
elif
host_type
==
'qt'
:
def
qemu_timing
():
...
...
@@ -78,23 +79,23 @@ for host_type in host_types:
h
.
sync
=
True
return
h
h
ost
_c
lass
=
qemu_timing
H
ost
C
lass
=
qemu_timing
elif
host_type
==
'gt'
:
h
ost
_c
lass
=
sim
.
Gem5Host
H
ost
C
lass
=
sim
.
Gem5Host
e
.
checkpoint
=
True
else
:
raise
NameError
(
host_type
)
# nic
if
nic_type
==
'ib'
:
n
ic
_c
lass
=
sim
.
I40eNIC
nc_c
lass
=
node
.
I40eLinuxNode
N
ic
C
lass
=
sim
.
I40eNIC
NcC
lass
=
node
.
I40eLinuxNode
elif
nic_type
==
'cb'
:
n
ic
_c
lass
=
sim
.
CorundumBMNIC
nc_c
lass
=
node
.
CorundumLinuxNode
N
ic
C
lass
=
sim
.
CorundumBMNIC
NcC
lass
=
node
.
CorundumLinuxNode
elif
nic_type
==
'cv'
:
n
ic
_c
lass
=
sim
.
CorundumVerilatorNIC
nc_c
lass
=
node
.
CorundumLinuxNode
N
ic
C
lass
=
sim
.
CorundumVerilatorNIC
NcC
lass
=
node
.
CorundumLinuxNode
else
:
raise
NameError
(
nic_type
)
...
...
@@ -104,9 +105,9 @@ for host_type in host_types:
1
,
'server'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
node
.
NetperfServer
)
...
...
@@ -115,9 +116,9 @@ for host_type in host_types:
1
,
'client'
,
net
,
n
ic
_c
lass
,
h
ost
_c
lass
,
nc_c
lass
,
N
ic
C
lass
,
H
ost
C
lass
,
NcC
lass
,
node
.
NetperfClient
,
ip_start
=
2
)
...
...
Prev
1
2
3
4
Next
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