123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- #!/usr/bin/python3
- '''
- NOTE: This script is tailored for sizzle!
- Hence it does server thread allocation assuming 2 40-core processors.
- Currently assumes 8 threads (C72-79) are set aside for client simulator
- Run generate manifest with the maximum number of servers you are going to use
- and generate the keys for this before running experiments
- (Run ./App/getpubkeys to generate keys for the servers)
- '''
- import subprocess
- import os
- import sys
- import math
- from gen_manifest import generate_manifest
- from gen_enclave_config import generate_config
- ###############################################################################
- # CONFIGS TO SET:
- MANIFEST_FILE = "App/manifest.yaml"
- #MANIFESTS_FOLDER = "Manifests/"
- LOG_FOLDER = "Experiments_Plot/"
- RESULT_FOLDER = "Experiment_results/"
- # N = number of clients
- N = [1<<16, 1<<17, 1<<18, 1<<19, 1<<20, 1<<21]
- # M = number of servers
- M = [3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 18, 20, 24, 26, 28, 32, 36, 40, 48, 56, 64, 72]
- # T = threads per server instance
- T = [2, 4, 8, 16]
- # Max servers depending on number of threads
- M_MAX = {
- 1:72, # 24 in M
- 2:36, # 19 in M
- 4:18, # 13 in M
- 8:9, # 8 in M
- 16:4 # 4 in M
- }
- # B = msg_size (-u)
- B = 256
- ###############################################################################
- def epoch_time(n, m, t, b):
- # Base epoch time is 5 sec
- etime_base = 5
- clients_per_server = math.ceil(n/m)
- # Using 1 sec for ~50K clients in compute time
- etime_compute = math.ceil(clients_per_server/50000)
- etime_inc = math.ceil(clients_per_server/25000)
- etime_client = ((math.ceil(2/t))**2) * etime_inc
- etime = etime_base + etime_compute + etime_client
- return etime
- if __name__ == "__main__":
- if not os.path.exists(LOG_FOLDER):
- os.mkdir(LOG_FOLDER)
- for t in T:
- b = B
- m_start = 1
- # Set M_MAX depending on t
- m_end = M_MAX[t]
- for m in M:
- if(m < m_end):
- for n in N:
- print("\n\n Running Experiment t = %d, m = %d, n = %d \n\n" % (t, m, n))
- generate_manifest(n, m, t, b)
- generate_config(n, m, t, b)
- epoch_interval = epoch_time(n, m, t, b)
- print("Epoch_interval = %d" % epoch_interval)
- log_subfolder = str(n) + "_" + str(m) + "_" + str(t) + "_" + str(b) + "/"
- log_subfolder = LOG_FOLDER + log_subfolder
- if not os.path.exists(log_subfolder):
- os.mkdir(log_subfolder)
- # Since launch is invoked from App/ ; we add a ../ to subfolder before
- # passing it to slaunch
- log_subfolder = "../" + log_subfolder
- slaunch = []
- slaunch.append("./launch")
- slaunch.append("route_clients")
- slaunch.append("-l")
- slaunch.append(log_subfolder)
- slaunch.append("-n")
- nodes_to_include = ["-n"]
- for i in range(1, m+1):
- nodes_to_include.append("s"+str(i))
- slaunch.append("s"+str(i))
- slaunch.append("-e")
- slaunch.append(str(epoch_interval))
- os.chdir("./App")
- # Server outputs are captured by log files provided to each of the server
- # launch calls made by App/launch
- make = subprocess.call(["make", "-C", "..", "-j"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
- server_process = subprocess.run(slaunch)
- claunch = []
- claunch.append("./clientlaunch")
- claunch.append("-t")
- claunch.append("8")
- claunch.append("-l")
- claunch.append(log_subfolder+"clients.log")
- os.chdir("./../Client/")
- client_process = subprocess.call(claunch)
- os.chdir("./../")
|