diff options
author | Joshua Bakita <jbakita@cs.unc.edu> | 2021-03-09 19:35:53 -0500 |
---|---|---|
committer | Joshua Bakita <jbakita@cs.unc.edu> | 2021-03-09 19:35:53 -0500 |
commit | 0c2be2d9e3de91ab0a06ef6bbf9ef5d4328b8181 (patch) | |
tree | 0b75cbd541eabeedffb758fc55c010305472e8a4 | |
parent | bb76227aaea6ba99b3512ffbd228e699c87beb9e (diff) |
Analysis Scripts: Cut deceptive help text and clean computeLCslowdown.py output
-rwxr-xr-x | smt_analysis/computeLCslowdown.py | 8 | ||||
-rwxr-xr-x | smt_analysis/computeSMTslowdown.py | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/smt_analysis/computeLCslowdown.py b/smt_analysis/computeLCslowdown.py index bcd22da..b6ac3a3 100755 --- a/smt_analysis/computeLCslowdown.py +++ b/smt_analysis/computeLCslowdown.py | |||
@@ -8,7 +8,7 @@ ASYNC_FORMAT = False | |||
8 | 8 | ||
9 | def print_usage(): | 9 | def print_usage(): |
10 | print("This program takes in the all-pairs and baseline SMT data and computes the worst-case slowdown against any other task when SMT is enabled.", file=sys.stderr) | 10 | print("This program takes in the all-pairs and baseline SMT data and computes the worst-case slowdown against any other task when SMT is enabled.", file=sys.stderr) |
11 | print("Level-A/B usage: {} <file -A> <file -B> <baseline file>".format(sys.argv[0]), file=sys.stderr) | 11 | # print("Level-A/B usage: {} <file -A> <file -B> <baseline file>".format(sys.argv[0]), file=sys.stderr) |
12 | print("Level-C usage: {} <continuous pairs> <baseline file>".format(sys.argv[0]), file=sys.stderr) | 12 | print("Level-C usage: {} <continuous pairs> <baseline file>".format(sys.argv[0]), file=sys.stderr) |
13 | 13 | ||
14 | # Check that we got the right number of parameters | 14 | # Check that we got the right number of parameters |
@@ -47,7 +47,7 @@ for i in range(0, len(name_to_idx)): | |||
47 | reliableNames.append(benchmark) | 47 | reliableNames.append(benchmark) |
48 | 48 | ||
49 | # Compute worst-case SMT slowdown for each benchmark | 49 | # Compute worst-case SMT slowdown for each benchmark |
50 | print("Bench Mi") | 50 | print("Bench M_i") |
51 | # Print rows | 51 | # Print rows |
52 | sample_f = np.mean # Change this to np.mean to use mean values in Mi generation | 52 | sample_f = np.mean # Change this to np.mean to use mean values in Mi generation |
53 | M_vals = [] | 53 | M_vals = [] |
@@ -60,11 +60,11 @@ for b1 in reliableNames: | |||
60 | time_wout_smt = sample_f(baseline_times[b1]) | 60 | time_wout_smt = sample_f(baseline_times[b1]) |
61 | M = time_with_smt / time_wout_smt | 61 | M = time_with_smt / time_wout_smt |
62 | max_mi = max(max_mi, M) | 62 | max_mi = max(max_mi, M) |
63 | print("{:>10.3}".format(max_mi), end=" ") | 63 | print("{:<1.3}".format(max_mi), end=" ") |
64 | M_vals.append(max_mi) | 64 | M_vals.append(max_mi) |
65 | print("") | 65 | print("") |
66 | # Print some statistics about the distribution | 66 | # Print some statistics about the distribution |
67 | print("Average: {:>5.3} with standard deviation {:>5.3} using `{}`".format(np.mean(M_vals), np.std(M_vals), sample_f.__name__)) | 67 | print("Overall average is {:.3} with standard deviation {:>5.3} using `{}`".format(np.mean(M_vals), np.std(M_vals), sample_f.__name__)) |
68 | Ms = np.asarray(M_vals, dtype=np.float32) | 68 | Ms = np.asarray(M_vals, dtype=np.float32) |
69 | print(np.sum(Ms <= 1), "of", len(M_vals), "M_i values are at most one -", 100*np.sum(Ms <= 1)/len(M_vals), "percent") | 69 | print(np.sum(Ms <= 1), "of", len(M_vals), "M_i values are at most one -", 100*np.sum(Ms <= 1)/len(M_vals), "percent") |
70 | print(np.sum(Ms > 2), "of", len(M_vals), "M_i values are greater than two -", 100*np.sum(Ms > 2)/len(M_vals), "percent") | 70 | print(np.sum(Ms > 2), "of", len(M_vals), "M_i values are greater than two -", 100*np.sum(Ms > 2)/len(M_vals), "percent") |
diff --git a/smt_analysis/computeSMTslowdown.py b/smt_analysis/computeSMTslowdown.py index ba9fa84..d612ea6 100755 --- a/smt_analysis/computeSMTslowdown.py +++ b/smt_analysis/computeSMTslowdown.py | |||
@@ -11,7 +11,7 @@ from libSMT import * | |||
11 | def print_usage(): | 11 | def print_usage(): |
12 | print("This program takes in the all-pairs and baseline SMT data and computes how much each program is slowed when SMT in enabled.", file=sys.stderr) | 12 | print("This program takes in the all-pairs and baseline SMT data and computes how much each program is slowed when SMT in enabled.", file=sys.stderr) |
13 | print("Level-A/B usage: {} <file -A> <file -B> <baseline file> --cij".format(sys.argv[0]), file=sys.stderr) | 13 | print("Level-A/B usage: {} <file -A> <file -B> <baseline file> --cij".format(sys.argv[0]), file=sys.stderr) |
14 | print("Level-C usage: {} <continuous pairs> <baseline file>".format(sys.argv[0]), file=sys.stderr) | 14 | # print("Level-C usage: {} <continuous pairs> <baseline file>".format(sys.argv[0]), file=sys.stderr) |
15 | 15 | ||
16 | # Check that we got the right number of parameters | 16 | # Check that we got the right number of parameters |
17 | if len(sys.argv) < 3: | 17 | if len(sys.argv) < 3: |