iperf script change
This commit is contained in:
parent
df880a453c
commit
e85928e3f5
105
scripts/iperf.py
105
scripts/iperf.py
@ -17,7 +17,7 @@ SSL_CERT = "/certs/server.crt"
|
||||
SSL_PKEY = "/certs/server.key"
|
||||
SERVER_PORT_START = 8050
|
||||
MEMLOAD_BLKSZ = 1024*1024*64
|
||||
RUNS=6
|
||||
RUNS=5
|
||||
|
||||
# paths
|
||||
file_dir : str = os.path.dirname(os.path.realpath(__file__))
|
||||
@ -39,7 +39,7 @@ class Conf:
|
||||
self.clients_affinity = clients_affinity
|
||||
|
||||
def to_string(self):
|
||||
return f"server.{self.server[0]}_affinity.{self.affinity}_sendfile.{self.sendfile}_tls.{self.tls}_ktls.{self.ktls}_memloadgen.{False if self.memloadgen == None else self.memloadgen[0].split('.')[2]}_filepath.{self.filepath.replace('/','-')}_odirect.{self.odirect}"
|
||||
return f"server.{self.server[0]}_affinity.{self.affinity}_sendfile.{self.sendfile}_tls.{self.tls}_ktls.{self.ktls}_memloadgen.{False if self.memloadgen == None else (self.memloadgen[0].split('.')[2])}_filepath.{self.filepath.replace('/','-')}_odirect.{self.odirect}"
|
||||
|
||||
class ArgTypes:
|
||||
def __init__(self):
|
||||
@ -62,29 +62,37 @@ class CPUList:
|
||||
def __init__(self, cores : list[int]):
|
||||
self._cores = cores
|
||||
self._total_cores = np.sum(cores)
|
||||
self._offset_lookup : list[int] = []
|
||||
for i in range(len(cores)):
|
||||
self._offset_lookup.append(0)
|
||||
if (i == 0):
|
||||
self._offset_lookup[i] = 0
|
||||
else:
|
||||
self._offset_lookup[i] = self._offset_lookup[i-1] + cores[i-1]
|
||||
|
||||
def get_all_cores(self) -> int:
|
||||
return self._total_cores
|
||||
|
||||
def get_cores(self, domain : int) -> int:
|
||||
def get_cores_in_domain(self, domain : int) -> int:
|
||||
return self._cores[domain]
|
||||
|
||||
def get_cpustr_domain(self, domain : int, offset : int, num : int, hyperthreads : bool = True):
|
||||
core = offset
|
||||
for i in range(0, domain):
|
||||
core += self._cores[i]
|
||||
return self.get_cpustr(core, num, hyperthreads)
|
||||
|
||||
def get_cpustr(self, offset : int, num : int, hyperthreads : bool):
|
||||
if hyperthreads:
|
||||
stride = 2
|
||||
else:
|
||||
stride = 1
|
||||
|
||||
def cores_to_cpulist(self, cores : list[int]) -> str:
|
||||
ret = ""
|
||||
for i in range(0, num):
|
||||
for i in range(len(cores)):
|
||||
if (i > 0):
|
||||
ret += ","
|
||||
ret += str(offset)
|
||||
ret += str(cores[i])
|
||||
return ret
|
||||
|
||||
def get_cpulist_by_offset(self, domain : int, offset : int, num : int, stride : int) -> str:
|
||||
ret = self.get_cores_by_offset(domain, offset, num, stride)
|
||||
return self.cores_to_cpulist(ret)
|
||||
|
||||
def get_cores_by_offset(self, domain : int, offset : int, num : int, stride : int) -> list[int]:
|
||||
ret = []
|
||||
offset = offset + self._offset_lookup[domain]
|
||||
for _ in range(num):
|
||||
ret.append(offset)
|
||||
offset = offset + stride
|
||||
return ret
|
||||
|
||||
@ -121,7 +129,9 @@ def list_to_comma_delimited(list : list[any]):
|
||||
if (i > 0):
|
||||
ret += ","
|
||||
ret += str(list[i])
|
||||
return ret
|
||||
|
||||
num_cores = 12
|
||||
|
||||
all_args : list[ArgTypes] = []
|
||||
arg_types : ArgTypes = ArgTypes()
|
||||
@ -133,15 +143,16 @@ arg_types.add_arg([[["icelake1-int.rcs.uwaterloo.ca", "milan2-int.rcs.uwaterloo.
|
||||
arg_types.add_arg([[["192.168.100.102"]]])
|
||||
#clients_dat
|
||||
arg_types.add_arg([[["192.168.100.101", "192.168.100.104", "192.168.100.103"]]])
|
||||
num_cores = int(ICELAKE_CPULIST.get_cores(domain = 0) / 4)
|
||||
#clients_affinity
|
||||
assignments = distribute_threads(num_cores, 1, 3)
|
||||
arg_types.add_arg([[[list_to_comma_delimited(assignments[0]),
|
||||
list_to_comma_delimited(assignments[1]),
|
||||
list_to_comma_delimited(assignments[2])]]])
|
||||
# affinity
|
||||
arg_types.add_arg([[ICELAKE_CPULIST.get_cpustr_domain(domain = 0, offset = 1, num = num_cores)],
|
||||
[ICELAKE_CPULIST.get_cpustr_domain(domain = 1, offset = 1, num = num_cores)]])
|
||||
# arg_types.add_arg([[ICELAKE_CPULIST.get_cpustr_domain(domain = 0, offset = 1, num = num_cores)],
|
||||
# [ICELAKE_CPULIST.get_cpustr_domain(domain = 1, offset = 1, num = num_cores)]])
|
||||
arg_types.add_arg([[ICELAKE_CPULIST.get_cpulist_by_offset(domain = 0, offset = 1, num = num_cores, stride = 4)],
|
||||
[ICELAKE_CPULIST.get_cpulist_by_offset(domain = 1, offset = 1, num = num_cores, stride = 4)]])
|
||||
# sendfile/tls/ktls
|
||||
arg_types.add_arg([
|
||||
[False, False, False],
|
||||
@ -151,10 +162,10 @@ arg_types.add_arg([
|
||||
[True, True, True],
|
||||
])
|
||||
# memloadgen
|
||||
arg_types.add_arg([[[f"{ICELAKE_CPULIST.get_cpustr_domain(domain = 1, offset = num_cores + 1, num = num_cores)}.0.0",
|
||||
f"{ICELAKE_CPULIST.get_cpustr_domain(domain = 0, offset = num_cores + 1, num = num_cores)}.1.0"]],
|
||||
[[f"{ICELAKE_CPULIST.get_cpustr_domain(domain = 1, offset = num_cores + 1, num = num_cores)}.0.50",
|
||||
f"{ICELAKE_CPULIST.get_cpustr_domain(domain = 0, offset = num_cores + 1, num = num_cores)}.1.50"]],
|
||||
arg_types.add_arg([[[f"{ICELAKE_CPULIST.get_cpulist_by_offset(domain = 1, offset = 3, num = num_cores, stride = 4)}.0.0",
|
||||
f"{ICELAKE_CPULIST.get_cpulist_by_offset(domain = 0, offset = 3, num = num_cores, stride = 4)}.1.0"]],
|
||||
[[f"{ICELAKE_CPULIST.get_cpulist_by_offset(domain = 1, offset = 3, num = num_cores, stride = 4)}.0.50",
|
||||
f"{ICELAKE_CPULIST.get_cpulist_by_offset(domain = 0, offset = 3, num = num_cores, stride = 4)}.1.50"]],
|
||||
[None]] )
|
||||
# filepath
|
||||
arg_types.add_arg([["/tmpfs/large_file_#p"], ["/mnt/zroot/large_file_#p"]])
|
||||
@ -172,15 +183,13 @@ arg_types.add_arg([[["icelake2-int.rcs.uwaterloo.ca", "milan2-int.rcs.uwaterloo.
|
||||
arg_types.add_arg([[["192.168.100.101"]]])
|
||||
#clients_dat
|
||||
arg_types.add_arg([[["192.168.100.102", "192.168.100.104", "192.168.100.103"]]])
|
||||
num_cores = int(ICELAKE_CPULIST.get_cores(domain = 0)/ 4)
|
||||
#clients_affinity
|
||||
assignments = distribute_threads(num_cores, 1, 3)
|
||||
arg_types.add_arg([[[list_to_comma_delimited(assignments[0]),
|
||||
list_to_comma_delimited(assignments[1]),
|
||||
list_to_comma_delimited(assignments[2])]]])
|
||||
# affinity
|
||||
arg_types.add_arg([[ICELAKE_CPULIST.get_cpustr_domain(domain = 0, offset = 1, num = num_cores)],
|
||||
[ICELAKE_CPULIST.get_cpustr_domain(domain = 1, offset = 1, num = num_cores)]])
|
||||
arg_types.add_arg([[ICELAKE_CPULIST.get_cpulist_by_offset(domain = 0, offset = 1, num = num_cores, stride = 4)]])
|
||||
# sendfile/tls/ktls
|
||||
arg_types.add_arg([
|
||||
[False, False, False],
|
||||
@ -190,10 +199,10 @@ arg_types.add_arg([
|
||||
[True, True, True],
|
||||
])
|
||||
# memloadgen
|
||||
arg_types.add_arg([[[f"{ICELAKE_CPULIST.get_cpustr_domain(domain = 1, offset = num_cores + 1, num = num_cores)}.0.0",
|
||||
f"{ICELAKE_CPULIST.get_cpustr_domain(domain = 0, offset = num_cores + 1, num = num_cores)}.1.0"]],
|
||||
[[f"{ICELAKE_CPULIST.get_cpustr_domain(domain = 1, offset = num_cores + 1, num = num_cores)}.0.50",
|
||||
f"{ICELAKE_CPULIST.get_cpustr_domain(domain = 0, offset = num_cores + 1, num = num_cores)}.1.50"]],
|
||||
arg_types.add_arg([[[f"{ICELAKE_CPULIST.get_cpulist_by_offset(domain = 1, offset = 3, num = num_cores, stride = 4)}.0.0",
|
||||
f"{ICELAKE_CPULIST.get_cpulist_by_offset(domain = 0, offset = 3, num = num_cores, stride = 4)}.1.0"]],
|
||||
[[f"{ICELAKE_CPULIST.get_cpulist_by_offset(domain = 1, offset = 3, num = num_cores, stride = 4)}.0.50",
|
||||
f"{ICELAKE_CPULIST.get_cpulist_by_offset(domain = 0, offset = 3, num = num_cores, stride = 4)}.1.50"]],
|
||||
[None]] )
|
||||
# filepath
|
||||
arg_types.add_arg([["/tmpfs/large_file_#p"], ["/mnt/zroot/large_file_#p"]])
|
||||
@ -211,15 +220,13 @@ arg_types.add_arg([[["icelake2-int.rcs.uwaterloo.ca", "milan2-int.rcs.uwaterloo.
|
||||
arg_types.add_arg([[["192.168.100.103"]]])
|
||||
#clients_dat
|
||||
arg_types.add_arg([[["192.168.100.102", "192.168.100.104", "192.168.100.101"]]])
|
||||
num_cores = int(MILAN_CPULIST.get_cores(domain = 0)/ 4)
|
||||
#clients_affinity
|
||||
assignments = distribute_threads(num_cores, 1, 3)
|
||||
arg_types.add_arg([[[list_to_comma_delimited(assignments[0]),
|
||||
list_to_comma_delimited(assignments[1]),
|
||||
list_to_comma_delimited(assignments[2])]]])
|
||||
# affinity
|
||||
arg_types.add_arg([[MILAN_CPULIST.get_cpustr_domain(domain = 0, offset = 1, num = num_cores)],
|
||||
[MILAN_CPULIST.get_cpustr_domain(domain = 1, offset = 1, num = num_cores)]])
|
||||
arg_types.add_arg([[MILAN_CPULIST.get_cpulist_by_offset(domain = 0, offset = 1, num = num_cores, stride = 4)]])
|
||||
# sendfile/tls/ktls
|
||||
arg_types.add_arg([
|
||||
[False, False, False],
|
||||
@ -229,10 +236,10 @@ arg_types.add_arg([
|
||||
[True, True, True],
|
||||
])
|
||||
# memloadgen
|
||||
arg_types.add_arg([[[f"{MILAN_CPULIST.get_cpustr_domain(domain = 1, offset = num_cores + 1, num = num_cores)}.0.0",
|
||||
f"{MILAN_CPULIST.get_cpustr_domain(domain = 0, offset = num_cores + 1, num = num_cores)}.1.0"]],
|
||||
[[f"{MILAN_CPULIST.get_cpustr_domain(domain = 1, offset = num_cores + 1, num = num_cores)}.0.50",
|
||||
f"{MILAN_CPULIST.get_cpustr_domain(domain = 0, offset = num_cores + 1, num = num_cores)}.1.50"]],
|
||||
arg_types.add_arg([[[f"{MILAN_CPULIST.get_cpulist_by_offset(domain = 1, offset = 3, num = num_cores, stride = 4)}.0.0",
|
||||
f"{MILAN_CPULIST.get_cpulist_by_offset(domain = 0, offset = 3, num = num_cores, stride = 4)}.1.0"]],
|
||||
[[f"{MILAN_CPULIST.get_cpulist_by_offset(domain = 1, offset = 3, num = num_cores, stride = 4)}.0.50",
|
||||
f"{MILAN_CPULIST.get_cpulist_by_offset(domain = 0, offset = 3, num = num_cores, stride = 4)}.1.50"]],
|
||||
[None]] )
|
||||
# filepath
|
||||
arg_types.add_arg([["/mnt/zroot/large_file_#p"], ["/tmpfs/large_file_#p"]])
|
||||
@ -243,22 +250,21 @@ all_args.append(arg_types)
|
||||
|
||||
arg_types : ArgTypes = ArgTypes()
|
||||
#server
|
||||
arg_types.add_arg([[["milan1-int.rcs.uwaterloo.ca"]]])
|
||||
arg_types.add_arg([[["milan2-int.rcs.uwaterloo.ca"]]])
|
||||
#clients
|
||||
arg_types.add_arg([[["icelake2-int.rcs.uwaterloo.ca", "milan2-int.rcs.uwaterloo.ca", "icelake1-int.rcs.uwaterloo.ca"]]])
|
||||
arg_types.add_arg([[["icelake2-int.rcs.uwaterloo.ca", "milan1-int.rcs.uwaterloo.ca", "icelake1-int.rcs.uwaterloo.ca"]]])
|
||||
#server_dat
|
||||
arg_types.add_arg([[["192.168.100.103"]]])
|
||||
arg_types.add_arg([[["192.168.100.104"]]])
|
||||
#clients_dat
|
||||
arg_types.add_arg([[["192.168.100.102", "192.168.100.104", "192.168.100.101"]]])
|
||||
num_cores = int(MILAN_CPULIST.get_cores(domain = 0)/ 4)
|
||||
arg_types.add_arg([[["192.168.100.102", "192.168.100.103", "192.168.100.101"]]])
|
||||
#clients_affinity
|
||||
assignments = distribute_threads(num_cores, 1, 3)
|
||||
arg_types.add_arg([[[list_to_comma_delimited(assignments[0]),
|
||||
list_to_comma_delimited(assignments[1]),
|
||||
list_to_comma_delimited(assignments[2])]]])
|
||||
# affinity
|
||||
arg_types.add_arg([[MILAN_CPULIST.get_cpustr_domain(domain = 0, offset = 1, num = num_cores)],
|
||||
[MILAN_CPULIST.get_cpustr_domain(domain = 1, offset = 1, num = num_cores)]])
|
||||
arg_types.add_arg([[MILAN_CPULIST.get_cpulist_by_offset(domain = 0, offset = 1, num = num_cores, stride = 4)],
|
||||
[MILAN_CPULIST.get_cpulist_by_offset(domain = 1, offset = 1, num = num_cores, stride = 4)]])
|
||||
# sendfile/tls/ktls
|
||||
arg_types.add_arg([
|
||||
[False, False, False],
|
||||
@ -268,10 +274,10 @@ arg_types.add_arg([
|
||||
[True, True, True],
|
||||
])
|
||||
# memloadgen
|
||||
arg_types.add_arg([[[f"{MILAN_CPULIST.get_cpustr_domain(domain = 1, offset = num_cores + 1, num = num_cores)}.0.0",
|
||||
f"{MILAN_CPULIST.get_cpustr_domain(domain = 0, offset = num_cores + 1, num = num_cores)}.1.0"]],
|
||||
[[f"{MILAN_CPULIST.get_cpustr_domain(domain = 1, offset = num_cores + 1, num = num_cores)}.0.50",
|
||||
f"{MILAN_CPULIST.get_cpustr_domain(domain = 0, offset = num_cores + 1, num = num_cores)}.1.50"]],
|
||||
arg_types.add_arg([[[f"{MILAN_CPULIST.get_cpulist_by_offset(domain = 1, offset = 3, num = num_cores, stride = 4)}.0.0",
|
||||
f"{MILAN_CPULIST.get_cpulist_by_offset(domain = 0, offset = 3, num = num_cores, stride = 4)}.1.0"]],
|
||||
[[f"{MILAN_CPULIST.get_cpulist_by_offset(domain = 1, offset = 3, num = num_cores, stride = 4)}.0.50",
|
||||
f"{MILAN_CPULIST.get_cpulist_by_offset(domain = 0, offset = 3, num = num_cores, stride = 4)}.1.50"]],
|
||||
[None]] )
|
||||
# filepath
|
||||
arg_types.add_arg([["/mnt/zroot/large_file_#p"], ["/tmpfs/large_file_#p"]])
|
||||
@ -302,7 +308,6 @@ def setup_all(conf : Conf):
|
||||
setup_cmd : str = f'''
|
||||
sudo pkg install -y openssl-devel vim curl wget gmake cmake openssl-devel llvm gcc rsync pkgconf isal-kmod ktls_isa-l_crypto-kmod;
|
||||
sudo pkg remove -y iperf iperf3;
|
||||
sudo kldload -n isal; sudo kldload -n ktls_intel-isa-l; kldload -n kern_ocf;
|
||||
sudo rm -rf { BIN_PATH };
|
||||
sudo mkdir -p { BIN_PATH };
|
||||
sudo git clone https://git.quacker.org/d/iperf3-tls { BIN_PATH };
|
||||
|
Loading…
Reference in New Issue
Block a user