diff options
Diffstat (limited to 'smt_analysis/computeSMTslowdown.py')
| -rwxr-xr-x | smt_analysis/computeSMTslowdown.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/smt_analysis/computeSMTslowdown.py b/smt_analysis/computeSMTslowdown.py index 805def1..ba9fa84 100755 --- a/smt_analysis/computeSMTslowdown.py +++ b/smt_analysis/computeSMTslowdown.py | |||
| @@ -34,8 +34,8 @@ OK_PAIRS_ONLY = len(sys.argv) > 4 and "--cij-ok" in sys.argv[4] | |||
| 34 | if not LEVEL_C_ANALYSIS: | 34 | if not LEVEL_C_ANALYSIS: |
| 35 | baseline_times, baseline_sample_cnt, baseline_max_times = load_baseline(sys.argv[3]) | 35 | baseline_times, baseline_sample_cnt, baseline_max_times = load_baseline(sys.argv[3]) |
| 36 | paired_times, paired_offsets, name_to_idx, idx_to_name = load_paired(sys.argv[1], sys.argv[2], len(list(baseline_times.keys()))) | 36 | paired_times, paired_offsets, name_to_idx, idx_to_name = load_paired(sys.argv[1], sys.argv[2], len(list(baseline_times.keys()))) |
| 37 | for key in baseline_times: | 37 | # for key in baseline_times: |
| 38 | print(key,max(baseline_times[key])) | 38 | # print(key,max(baseline_times[key])) |
| 39 | else: | 39 | else: |
| 40 | # Paired times use an abuse of the baseline file format | 40 | # Paired times use an abuse of the baseline file format |
| 41 | baseline_times, baseline_sample_cnt, baseline_max_times = load_baseline(sys.argv[2]) | 41 | baseline_times, baseline_sample_cnt, baseline_max_times = load_baseline(sys.argv[2]) |
| @@ -94,18 +94,23 @@ for b1 in reliableNames: | |||
| 94 | print("{:>10.3}".format(M), end=" ") | 94 | print("{:>10.3}".format(M), end=" ") |
| 95 | print("") | 95 | print("") |
| 96 | # Print some statistics about the distribution | 96 | # Print some statistics about the distribution |
| 97 | print("Average: {:>5.3} with standard deviation {:>5.3} using `{}`".format(np.mean(M_vals), np.std(M_vals), sample_f.__name__)) | 97 | print("Overall average is {:>5.3} with standard deviation {:>5.3} using `{}`".format(np.mean(M_vals), np.std(M_vals), sample_f.__name__)) |
| 98 | Ms = np.asarray(M_vals, dtype=np.float32) | 98 | Ms = np.asarray(M_vals, dtype=np.float32) |
| 99 | if not LEVEL_C_ANALYSIS: | 99 | if not LEVEL_C_ANALYSIS: |
| 100 | print(np.sum(Ms <= 0), "of", len(M_vals), "M_i:j values are at most zero -", 100*np.sum(Ms <= 0)/len(M_vals), "percent") | 100 | print(np.sum(Ms <= 0), "of", len(M_vals), "M_i:j values are at most zero -", 100*np.sum(Ms <= 0)/len(M_vals), "percent") |
| 101 | print(np.sum(Ms > 1), "of", len(M_vals), "M_i:j values are greater than one -", 100*np.sum(Ms > 1)/len(M_vals), "percent") | 101 | print(np.sum(Ms > 1), "of", len(M_vals), "M_i:j values are greater than one -", 100*np.sum(Ms > 1)/len(M_vals), "percent") |
| 102 | M_vals_to_plot = Ms[np.logical_and(Ms > 0, Ms <= 1)] | 102 | M_vals_to_plot = Ms[np.logical_and(Ms > 0, Ms <= 1)] |
| 103 | # Sims' analysis | ||
| 104 | mean = np.mean(list(M_vals_to_plot)) | ||
| 105 | std = np.std(list(M_vals_to_plot)) | ||
| 106 | print("For {} of {} M_i:j values in (0, 1], average: {:>5.3} with std. dev. {:>4.3} (coeff. var. {:>4.3}) using `{}`".format(len(M_vals_to_plot), len(M_vals), mean, std, std/mean, sample_f.__name__)) | ||
| 103 | else: | 107 | else: |
| 104 | print(np.sum(Ms <= 1), "of", len(M_vals), "M_i:j values are at most one -", 100*np.sum(Ms <= 1)/len(M_vals), "percent") | 108 | print(np.sum(Ms <= 1), "of", len(M_vals), "M_i:j values are at most one -", 100*np.sum(Ms <= 1)/len(M_vals), "percent") |
| 105 | print(np.sum(Ms > 2), "of", len(M_vals), "M_i:j values are greater than two -", 100*np.sum(Ms > 2)/len(M_vals), "percent") | 109 | print(np.sum(Ms > 2), "of", len(M_vals), "M_i:j values are greater than two -", 100*np.sum(Ms > 2)/len(M_vals), "percent") |
| 106 | M_vals_to_plot = Ms | 110 | M_vals_to_plot = Ms |
| 111 | # Sims' analysis | ||
| 112 | print("For {} of {} M_i:j values in (1, 2], average: {:>5.3} with std. dev. {:>4.3} (coeff. var. {:>4.3}) using `{}`".format(len(M_vals_to_plot), len(M_vals), np.mean(list(M_vals_to_plot)), np.std(list(M_vals_to_plot)), np.mean(list(M_vals_to_plot))/np.std(list(M_vals_to_plot)), sample_f.__name__)) | ||
| 107 | 113 | ||
| 108 | print("Using Sim's analysis, average: {:>5.3} with standard deviation {:>5.3} using `{}`".format(np.mean(list(M_vals_to_plot)), np.std(list(M_vals_to_plot)), sample_f.__name__)) | ||
| 109 | print(plt.hist(M_vals_to_plot, bins=10)) | 114 | print(plt.hist(M_vals_to_plot, bins=10)) |
| 110 | 115 | ||
| 111 | ##### BELOW TEXT IS OLD OFFSET CODE (patched) ##### | 116 | ##### BELOW TEXT IS OLD OFFSET CODE (patched) ##### |
