diff options
author | Bryan Ward <bcw@cs.unc.edu> | 2013-04-18 16:12:06 -0400 |
---|---|---|
committer | Bryan Ward <bcw@cs.unc.edu> | 2013-04-18 16:12:06 -0400 |
commit | e1eed1bc02642210a53618147cd55c180bc716ca (patch) | |
tree | a9ee92fc5354da0e620571feb639ebf58298dc27 /parse/ft.py | |
parent | b8f3c7a1ccd2fffc54f15e808505a568ce5fa492 (diff) |
Updated config and parsing.
Diffstat (limited to 'parse/ft.py')
-rw-r--r-- | parse/ft.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/parse/ft.py b/parse/ft.py index 1f05323..1e0947f 100644 --- a/parse/ft.py +++ b/parse/ft.py | |||
@@ -20,6 +20,7 @@ def parse_overhead(result, overhead_bin, overhead, cycles, out_dir, err_file): | |||
20 | os.remove(ovh_fname) | 20 | os.remove(ovh_fname) |
21 | ovh_file = open(ovh_fname, 'w') | 21 | ovh_file = open(ovh_fname, 'w') |
22 | 22 | ||
23 | err_file.write("Overhead is %s" % overhead) | ||
23 | # Extract matching overhead events into a seperate file | 24 | # Extract matching overhead events into a seperate file |
24 | cmd = [conf.BINS["ftsplit"], "-r", "-b", overhead, overhead_bin] | 25 | cmd = [conf.BINS["ftsplit"], "-r", "-b", overhead, overhead_bin] |
25 | ret = subprocess.call(cmd, cwd=out_dir, stderr=err_file, stdout=ovh_file) | 26 | ret = subprocess.call(cmd, cwd=out_dir, stderr=err_file, stdout=ovh_file) |
@@ -27,13 +28,14 @@ def parse_overhead(result, overhead_bin, overhead, cycles, out_dir, err_file): | |||
27 | 28 | ||
28 | if ret: | 29 | if ret: |
29 | raise Exception("Failed (%d) with command: %s" % (ret, " ".join(cmd))) | 30 | raise Exception("Failed (%d) with command: %s" % (ret, " ".join(cmd))) |
30 | if not size: | 31 | #if not size: |
31 | os.remove(ovh_fname) | 32 | # os.remove(ovh_fname) |
32 | if size and not ret: | 33 | if size and not ret: |
33 | # Map and sort file for stats | 34 | # Map and sort file for stats |
34 | data = np.memmap(ovh_fname, dtype="float32", mode='c') | 35 | data = np.memmap(ovh_fname, dtype="float32", mode='c') |
35 | data /= float(cycles) # Scale for processor speed | 36 | data /= float(cycles) # Scale for processor speed |
36 | data.sort() | 37 | data.sort() |
38 | print("Have %s of %s" % (len(data), overhead)) | ||
37 | 39 | ||
38 | m = Measurement("%s-%s" % (overhead_bin, overhead)) | 40 | m = Measurement("%s-%s" % (overhead_bin, overhead)) |
39 | m[Type.Max] = data[-1] | 41 | m[Type.Max] = data[-1] |
@@ -43,7 +45,7 @@ def parse_overhead(result, overhead_bin, overhead, cycles, out_dir, err_file): | |||
43 | 45 | ||
44 | result[overhead] = m | 46 | result[overhead] = m |
45 | 47 | ||
46 | os.remove(ovh_fname) | 48 | #os.remove(ovh_fname) |
47 | 49 | ||
48 | def sort_ft(ft_file, err_file, out_dir): | 50 | def sort_ft(ft_file, err_file, out_dir): |
49 | '''Create and return file with sorted overheads from @ft_file.''' | 51 | '''Create and return file with sorted overheads from @ft_file.''' |
@@ -77,9 +79,10 @@ def extract_ft_data(result, data_dir, work_dir, cycles): | |||
77 | sorted_bin = sort_ft(bin_file, err_file, work_dir) | 79 | sorted_bin = sort_ft(bin_file, err_file, work_dir) |
78 | 80 | ||
79 | for event in conf.OVH_BASE_EVENTS: | 81 | for event in conf.OVH_BASE_EVENTS: |
82 | print event | ||
80 | parse_overhead(result, sorted_bin, event, cycles, | 83 | parse_overhead(result, sorted_bin, event, cycles, |
81 | work_dir, err_file) | 84 | work_dir, err_file) |
82 | 85 | ||
83 | os.remove(sorted_bin) | 86 | #os.remove(sorted_bin) |
84 | 87 | ||
85 | return True | 88 | return True |