diff options
Diffstat (limited to 'smt_analysis')
| -rwxr-xr-x | smt_analysis/computeSMTslowdown.py | 13 | ||||
| -rwxr-xr-x | smt_analysis/libSMT.py | 10 |
2 files changed, 18 insertions, 5 deletions
diff --git a/smt_analysis/computeSMTslowdown.py b/smt_analysis/computeSMTslowdown.py index d612ea6..cf09402 100755 --- a/smt_analysis/computeSMTslowdown.py +++ b/smt_analysis/computeSMTslowdown.py | |||
| @@ -81,7 +81,7 @@ for b1 in reliableNames: | |||
| 81 | else: | 81 | else: |
| 82 | if not TIMES_ONLY: print("{:>10}".format("N/A"), end=" ") | 82 | if not TIMES_ONLY: print("{:>10}".format("N/A"), end=" ") |
| 83 | 83 | ||
| 84 | if TIMES_ONLY and (not OK_PAIRS_ONLY or Cj * 10 > Ci): | 84 | if TIMES_ONLY:# and (not OK_PAIRS_ONLY or Cj * 10 > Ci): |
| 85 | print("{:>12}".format(Cij), end=" ") | 85 | print("{:>12}".format(Cij), end=" ") |
| 86 | elif OK_PAIRS_ONLY and Cj * 10 <= Ci: | 86 | elif OK_PAIRS_ONLY and Cj * 10 <= Ci: |
| 87 | print("{:>12}".format("0"), end=" ") | 87 | print("{:>12}".format("0"), end=" ") |
| @@ -93,6 +93,17 @@ for b1 in reliableNames: | |||
| 93 | M_vals.append(M) | 93 | M_vals.append(M) |
| 94 | print("{:>10.3}".format(M), end=" ") | 94 | print("{:>10.3}".format(M), end=" ") |
| 95 | print("") | 95 | print("") |
| 96 | |||
| 97 | # Output baselines | ||
| 98 | print("Baselines ", end=" ") | ||
| 99 | print() | ||
| 100 | # Print rows | ||
| 101 | for b1 in reliableNames: | ||
| 102 | print("{:<14.14}:".format(b1), end=" ") | ||
| 103 | Ci = sample_f(baseline_times[b1]) | ||
| 104 | print("{:>12}".format(Ci), end=" ") | ||
| 105 | print("") | ||
| 106 | |||
| 96 | # Print some statistics about the distribution | 107 | # Print some statistics about the distribution |
| 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__)) | 108 | 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) | 109 | Ms = np.asarray(M_vals, dtype=np.float32) |
diff --git a/smt_analysis/libSMT.py b/smt_analysis/libSMT.py index c0b5178..881ef07 100755 --- a/smt_analysis/libSMT.py +++ b/smt_analysis/libSMT.py | |||
| @@ -17,7 +17,7 @@ def assert_valid_input_files(names, on_fail): | |||
| 17 | # @returns max_res May of benchmark to maximum execution time among all samples for that benchmark | 17 | # @returns max_res May of benchmark to maximum execution time among all samples for that benchmark |
| 18 | def load_baseline(f): | 18 | def load_baseline(f): |
| 19 | # constants for columns of baseline data files | 19 | # constants for columns of baseline data files |
| 20 | TOTAL_NS = 5 | 20 | TOTAL_NS = 9 |
| 21 | BENCH_NAME = 0 | 21 | BENCH_NAME = 0 |
| 22 | SAMPLES = 4 | 22 | SAMPLES = 4 |
| 23 | 23 | ||
| @@ -65,8 +65,8 @@ def load_paired(file1, file2, benchmarkCount): | |||
| 65 | START_N = 6 # Start nanoseconds | 65 | START_N = 6 # Start nanoseconds |
| 66 | END_S = 7 # End seconds | 66 | END_S = 7 # End seconds |
| 67 | END_N = 8 # End nanoseconds | 67 | END_N = 8 # End nanoseconds |
| 68 | RUN_ID = 9 | 68 | RUN_ID = 10 |
| 69 | JOB_NUM = 10 | 69 | JOB_NUM = 11 |
| 70 | 70 | ||
| 71 | with open(file1) as f1: | 71 | with open(file1) as f1: |
| 72 | numJobs = int(f1.readline().split()[TRIALS]) | 72 | numJobs = int(f1.readline().split()[TRIALS]) |
| @@ -101,7 +101,9 @@ def load_paired(file1, file2, benchmarkCount): | |||
| 101 | end2 = int(lineArr2[END_S]) * 10**9 + int(lineArr2[END_N]) | 101 | end2 = int(lineArr2[END_S]) * 10**9 + int(lineArr2[END_N]) |
| 102 | maxEnd = max(end1, end2) | 102 | maxEnd = max(end1, end2) |
| 103 | # Time actually co-scheduled is minEnd - maxStart, but Sims uses a different model | 103 | # Time actually co-scheduled is minEnd - maxStart, but Sims uses a different model |
| 104 | time[bench1][bench2][job_idx] = maxEnd - minStart | 104 | #time[bench1][bench2][job_idx] = maxEnd - minStart |
| 105 | time[bench1][bench2][job_idx] = end1-minStart | ||
| 106 | time[bench2][bench1][job_idx] = end2-minStart | ||
| 105 | # Compute offset: if first job starts at t=0, when does second start? | 107 | # Compute offset: if first job starts at t=0, when does second start? |
| 106 | offset[bench1][bench2][job_idx] = abs(start2-start1) | 108 | offset[bench1][bench2][job_idx] = abs(start2-start1) |
| 107 | # Compute some running statistics | 109 | # Compute some running statistics |
