Browse Source

Experiments code.

Kyle Fredrickson 11 months ago
parent
commit
3037425ace

+ 1 - 1
baseline/Cargo.toml

@@ -13,5 +13,5 @@ rayon = "1.10.0"
 
 [package.metadata.fortanix-sgx]
 stack-size=0x400000
-heap-size=0x800000000
+heap-size=0x100000000
 threads=49

+ 3 - 3
experiments/d_scaling.py → experiments/d_scaling_legacy.py

@@ -1,8 +1,8 @@
 import os
 import subprocess
 
-SENDS = 2**22
-USERS = 2**17
+SENDS = 2**20
+USERS = 2**20
 
 THREADS = 48
 D_MAPS = 15
@@ -10,7 +10,7 @@ D_MAPS = 15
 RUNS = 10
 WARMUP = 0
 
-DATA_DIR = os.path.join(os.getcwd(), "data", "d-scaling")
+DATA_DIR = os.path.join(os.getcwd(), "data", "sparta-d-legacy")
 os.makedirs(DATA_DIR, exist_ok=True)
 
 SPARTA_D_DIR = os.path.join(os.getcwd(), "sparta-d")

+ 35 - 0
experiments/d_scaling_storage.py

@@ -0,0 +1,35 @@
+import os
+import subprocess
+
+SENDS = 2**20
+USERS = 2**13
+
+THREADS = 48
+D_MAPS = 15
+
+RUNS = 10
+WARMUP = 0
+
+DATA_DIR = os.path.join(os.getcwd(), "data", "d-scaling-store")
+os.makedirs(DATA_DIR, exist_ok=True)
+
+SPARTA_D_DIR = os.path.join(os.getcwd(), "sparta-d")
+SPARTA_D_FILE = os.path.join(
+    DATA_DIR, f"sparta-d-{SENDS}-{USERS}-{THREADS}.csv")
+
+
+def sparta_d_cmd(maps):
+    cmd = ["cargo", "run", "--release", "--",
+           str(SENDS), str(USERS), str(THREADS), str(USERS), str(maps), "-r", str(RUNS), "-w", str(WARMUP)]
+    result = subprocess.run(cmd, capture_output=True,
+                            text=True, cwd=SPARTA_D_DIR)
+    return result.stdout
+
+
+for maps in range(1, 16):
+    print(maps)
+
+    with open(SPARTA_D_FILE, "a") as sparta_d_file:
+        output = sparta_d_cmd(maps)
+        print("\tsparta_d:", output)
+        sparta_d_file.write(output)

+ 2 - 0
experiments/user_and_message_scaling.py → experiments/message_scaling_legacy.py

@@ -1,6 +1,8 @@
 import os
 import subprocess
 
+# done
+
 SENDS = [2**i for i in range(21, 25)]
 
 THREADS = 48

+ 2 - 0
experiments/message_scaling.py → experiments/message_scaling_storage.py

@@ -1,6 +1,8 @@
 import os
 import subprocess
 
+# done
+
 SENDS = [2**i for i in range(25, 26)]
 FETCHES = 8192
 USERS = FETCHES

+ 77 - 0
experiments/submap_scaling_legacy.py

@@ -0,0 +1,77 @@
+import os
+import subprocess
+
+SENDS = 1048576
+FETCHES = 1048576
+USERS = FETCHES
+
+THREADS = 8
+# MAP_THREADS = [(i, 8 + 8 * i) for i in range(6, int(16))]
+MAP_THREADS = [(i, 8 + 8 * i) for i in range(1, int(48 / THREADS))]
+
+RUNS = 10
+WARMUP = 0
+
+DATA_DIR = os.path.join(os.getcwd(), "data", "submap-legacy")
+os.makedirs(DATA_DIR, exist_ok=True)
+
+SPARTA_DIR = os.path.join(os.getcwd(), "sparta")
+SPARTA_D_DIR = os.path.join(os.getcwd(), "sparta-d")
+BASELINE_DIR = os.path.join(os.getcwd(), "baseline")
+
+BASELINE_FILE = os.path.join(
+    DATA_DIR, f"baseline-{FETCHES}-{THREADS}.csv")
+SPARTA_FILE = os.path.join(DATA_DIR, f"sparta-{FETCHES}-{THREADS}.csv")
+SPARTA_D_FILE = os.path.join(
+    DATA_DIR, f"sparta-d-{FETCHES}-{THREADS}.csv")
+
+
+def sparta_cmd(mt):
+    (num_maps, num_threads) = mt
+    cmd = ["cargo", "run", "--release", "--",
+           str(SENDS), str(FETCHES), str(num_threads),
+           str(USERS), str(num_maps), "-r", str(RUNS), "-w", str(WARMUP)]
+    print(cmd)
+    result = subprocess.run(cmd, capture_output=True,
+                            text=True, cwd=SPARTA_DIR)
+    return result.stdout
+
+
+def sparta_d_cmd(mt):
+    (num_maps, _num_threads) = mt
+    cmd = ["cargo", "run", "--release", "--",
+           str(SENDS), str(FETCHES), str(48),
+           str(USERS), str(num_maps), "-r", str(RUNS), "-w", str(WARMUP)]
+    print(cmd)
+    result = subprocess.run(cmd, capture_output=True,
+                            text=True, cwd=SPARTA_D_DIR)
+    return result.stdout
+
+
+def baseline_cmd(mt):
+    (_num_maps, num_threads) = mt
+    cmd = ["cargo", "run", "--release", "--",
+           str(SENDS), str(FETCHES), str(num_threads), "-r", str(RUNS), "-w", str(WARMUP)]
+    print(cmd)
+    result = subprocess.run(cmd, capture_output=True,
+                            text=True, cwd=BASELINE_DIR)
+    return result.stdout
+
+
+for mt in MAP_THREADS:
+    print(mt)
+
+    with open(SPARTA_FILE, "a") as sparta_file:
+        output = sparta_cmd(mt)
+        print("\tsparta:", output)
+        sparta_file.write(output)
+
+    with open(SPARTA_D_FILE, "a") as sparta_d_file:
+        output = sparta_d_cmd(mt)
+        print("\tsparta_d:", output)
+        sparta_d_file.write(output)
+
+    # with open(BASELINE_FILE, "a") as baseline_file:
+    #     output = baseline_cmd(mt)
+    #     print("\tbaseline:", output)
+    #     baseline_file.write(output)

+ 2 - 0
experiments/submap_scaling.py → experiments/submap_scaling_storage.py

@@ -1,6 +1,8 @@
 import os
 import subprocess
 
+# done
+
 SENDS = 1048576
 FETCHES = 8192
 USERS = FETCHES

+ 1 - 1
sparta/Cargo.toml

@@ -12,7 +12,7 @@ rayon = "1.10.0"
 
 [package.metadata.fortanix-sgx]
 stack-size=0x400000
-heap-size=0x800000000
+heap-size=0x100000000
 threads=49
 
 [profile.release]