diff options
author | Mac Mollison <mollison@cs.unc.edu> | 2010-03-13 16:44:30 -0500 |
---|---|---|
committer | Mac Mollison <mollison@cs.unc.edu> | 2010-03-13 16:44:30 -0500 |
commit | beab41dc5f360324549fd14b3daa8fce613e66ff (patch) | |
tree | 614660471373e6363e926190d205c4600d7ae4af /sample_script.py | |
parent | cd82f6c9be132613bfec7eb673923506201e38f6 (diff) |
Updates included frontend scripts to match doc
Diffstat (limited to 'sample_script.py')
-rwxr-xr-x | sample_script.py | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/sample_script.py b/sample_script.py deleted file mode 100755 index a5fed86..0000000 --- a/sample_script.py +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | #!/usr/bin/python | ||
2 | |||
3 | ################################################################################ | ||
4 | # Description | ||
5 | ################################################################################ | ||
6 | # This is a sample script for using the tool. I would recommend copying | ||
7 | # this and modifying it to suit your needs for a particular test. Make | ||
8 | # sure you redirect the output to a file (e.g. ./sample_script.py > output). | ||
9 | |||
10 | ################################################################################ | ||
11 | # Setup | ||
12 | ################################################################################ | ||
13 | |||
14 | # Import the modules we need. You should not need to know about | ||
15 | # their internals. | ||
16 | import unit_trace | ||
17 | from unit_trace import trace_reader | ||
18 | from unit_trace import sanitizer | ||
19 | from unit_trace import gedf_test | ||
20 | from unit_trace import stats | ||
21 | from unit_trace import stdout_printer | ||
22 | from unit_trace import visualizer | ||
23 | |||
24 | # Specify your trace files | ||
25 | g6 = [ | ||
26 | './sample_traces/st-g6-0.bin', | ||
27 | './sample_traces/st-g6-1.bin', | ||
28 | './sample_traces/st-g6-2.bin', | ||
29 | './sample_traces/st-g6-3.bin', | ||
30 | ] | ||
31 | |||
32 | ################################################################################ | ||
33 | # Pipeline | ||
34 | ################################################################################ | ||
35 | |||
36 | # Read events from traces | ||
37 | stream = trace_reader.trace_reader(g6) | ||
38 | |||
39 | # Filter out garbage events | ||
40 | stream = sanitizer.sanitizer(stream) | ||
41 | |||
42 | # Produce G-EDF error records | ||
43 | stream = gedf_test.gedf_test(stream) | ||
44 | |||
45 | # Produce a statistics record | ||
46 | stream = stats.stats(stream) | ||
47 | |||
48 | # Filter some records out | ||
49 | # NOTE: Currently, this will break the Visualizer if enabled | ||
50 | def my_filter(record): | ||
51 | if record.record_type == 'error' and record.type_name == 'inversion_end': | ||
52 | if record.job.inversion_end - record.job.inversion_start < 4000000: | ||
53 | return False | ||
54 | return True | ||
55 | #stream = filter(my_filter, stream) | ||
56 | |||
57 | # Split the stream in two, so we can use both output mechanisms | ||
58 | import itertools | ||
59 | stream1, stream2 = itertools.tee(stream,2) | ||
60 | |||
61 | # Print the records to stdout | ||
62 | stdout_printer.stdout_printer(stream1) | ||
63 | |||
64 | # Visualize the records | ||
65 | visualizer.visualizer(stream2) | ||