summaryrefslogtreecommitdiffstats
path: root/scripts/gedf_test.py
diff options
context:
space:
mode:
authorMac Mollison <mollison@cs.unc.edu>2010-03-14 03:17:40 -0400
committerMac Mollison <mollison@cs.unc.edu>2010-03-14 03:17:40 -0400
commit361d978921690a7c26a63b933b502d5d2fc3e3d5 (patch)
tree851173b45f26ee94a10065e2efeac3ca0d7bcde7 /scripts/gedf_test.py
parent17977f3e1a454efe197650b34365af15a63f4afe (diff)
Refactor to get rid of various frontend scripts
Now, unit-trace.py can control all functionality.
Diffstat (limited to 'scripts/gedf_test.py')
-rwxr-xr-xscripts/gedf_test.py73
1 files changed, 0 insertions, 73 deletions
diff --git a/scripts/gedf_test.py b/scripts/gedf_test.py
deleted file mode 100755
index 2f67bc0..0000000
--- a/scripts/gedf_test.py
+++ /dev/null
@@ -1,73 +0,0 @@
1#!/usr/bin/python
2
3################################################################################
4# Description
5################################################################################
6# This script performs a G-EDF test and outputs the results to std out.
7
8# This script should be invoked with the names of the trace files you want to
9# use. For example, `gedf_test.py ../sample_traces/*.bin`.
10# You probably want to redirect the (normally lengthy) output to a file!
11# Otherwise, speed is greatly decreased b/c terminal printing is slow.
12
13################################################################################
14# Setup
15################################################################################
16
17# Import the modules we need. You should not need to know about
18# their internals.
19import unit_trace
20from unit_trace import trace_reader
21from unit_trace import sanitizer
22from unit_trace import gedf_test
23from unit_trace import stats
24from unit_trace import stdout_printer
25from unit_trace import visualizer
26from unit_trace import progress
27
28# Get trace files from command line arguments
29from optparse import OptionParser
30usage = "usage: %prog <one or more trace files>"
31parser = OptionParser(usage=usage)
32(options, traces) = parser.parse_args()
33traces = list(traces)
34if len(traces) < 1:
35 parser.print_help()
36 exit()
37
38################################################################################
39# Pipeline
40################################################################################
41
42# Read events from traces
43stream = trace_reader.trace_reader(traces)
44
45# Filter out garbage events
46stream = sanitizer.sanitizer(stream)
47
48# Display progress information using stderr
49# e.g. # records completed so far, total time, etc.
50stream = progress.progress(stream)
51
52# Produce G-EDF error records
53stream = gedf_test.gedf_test(stream)
54
55# Produce a statistics record
56stream = stats.stats(stream)
57
58# Filter some records out
59def my_filter(record):
60 if record.record_type == 'error' and record.type_name == 'inversion_end':
61 if record.job.inversion_end - record.job.inversion_start < 4000000:
62 return False
63 return True
64#stream = filter(my_filter, stream)
65
66# It is possible to split the stream in two,
67# so we can use more than one output mechanism (for example)
68# without re-doing earlier work.
69# import itertools
70# stream1, stream2 = itertools.tee(stream,2)
71
72# Print the records to stdout
73stdout_printer.stdout_printer(stream)