Sfoglia il codice sorgente

Script and parser for experiments scaling the number of cores for Sparta

Ian Goldberg 8 mesi fa
parent
commit
9cb62258f9

+ 0 - 0
docker/parse_logs → docker/parse-clientscale-logs


+ 39 - 0
docker/parse-corescale-logs

@@ -0,0 +1,39 @@
+#!/usr/bin/env python3
+
+import numpy as np
+import re
+import sys
+
+# Print the mean and stddev of the floats in the list of data
+def printstats(data):
+    mean = np.mean(data)
+    stddev = np.std(data)
+    print(f",{mean:.3f},{stddev:.3f}", end='')
+
+if __name__ == "__main__":
+    times = {}
+    ncores = None
+    for line in sys.stdin.readlines():
+        if corematch := \
+            re.match(r'cores: (\d+)', line):
+            ncores = int(corematch.group(1))
+        if matches := \
+            re.match(r'(\d+) (\d+) \d+ (\d+\.?\d*) (\d+\.?\d*) (\d+\.?\d*)',
+                line):
+            groups = matches.groups()
+            label, send_time, fetch_time, tot_time = \
+                (int(groups[0]), int(groups[1]), ncores), float(groups[2]), \
+                float(groups[3]), float(groups[4])
+            if label not in times:
+                times[label] = [ [], [], [] ]
+            times[label][0].append(send_time)
+            times[label][1].append(fetch_time)
+            times[label][2].append(tot_time)
+
+    print("users,batches,ncores,send_mean,send_stddev,fetch_mean,fetch_stddev,tot_mean,tot_stddev")
+    for k in sorted(times.keys()):
+        print(k[0], k[1], k[2], sep=',', end='')
+        for data in times[k]:
+            printstats(data)
+        print('')
+

+ 0 - 0
docker/run-experiments → docker/run-clientscale-experiments


+ 32 - 0
docker/run-corescale-experiments

@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# cd into the directory containing this script (from the bash faq 028)
+if [[ $BASH_SOURCE = */* ]]; then
+  cd -- "${BASH_SOURCE%/*}/" || exit
+fi
+
+./start-docker
+
+if [ "$1" == "" ]; then
+    niters=1
+else
+    niters="$1"
+fi
+
+if [ "$2" == "" ]; then
+    sends=$((1<<20))
+else
+    sends="$2"
+fi
+
+for iter in $(seq 1 $niters); do
+    for ncores in 4 6 8 16 24 32 36 40 44 48 64 72; do
+        echo "cores: $ncores"
+        docker exec -it ${SPARTA_DOCKER_PREFIX}sparta \
+            numactl -C 0-$((ncores-1)) ftxsgx-runner \
+            sparta/target/x86_64-fortanix-unknown-sgx/release/sparta.sgxs \
+            -- $sends $sends $ncores $sends 5 -r 1 -w 0
+    done
+done
+
+./stop-docker