summaryrefslogtreecommitdiffstats
path: root/sample_script.py
diff options
context:
space:
mode:
authorMac Mollison <mollison@cs.unc.edu>2010-03-13 16:44:30 -0500
committerMac Mollison <mollison@cs.unc.edu>2010-03-13 16:44:30 -0500
commitbeab41dc5f360324549fd14b3daa8fce613e66ff (patch)
tree614660471373e6363e926190d205c4600d7ae4af /sample_script.py
parentcd82f6c9be132613bfec7eb673923506201e38f6 (diff)
Updates included frontend scripts to match doc
Diffstat (limited to 'sample_script.py')
-rwxr-xr-xsample_script.py65
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.
16import unit_trace
17from unit_trace import trace_reader
18from unit_trace import sanitizer
19from unit_trace import gedf_test
20from unit_trace import stats
21from unit_trace import stdout_printer
22from unit_trace import visualizer
23
24# Specify your trace files
25g6 = [
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
37stream = trace_reader.trace_reader(g6)
38
39# Filter out garbage events
40stream = sanitizer.sanitizer(stream)
41
42# Produce G-EDF error records
43stream = gedf_test.gedf_test(stream)
44
45# Produce a statistics record
46stream = stats.stats(stream)
47
48# Filter some records out
49# NOTE: Currently, this will break the Visualizer if enabled
50def 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
58import itertools
59stream1, stream2 = itertools.tee(stream,2)
60
61# Print the records to stdout
62stdout_printer.stdout_printer(stream1)
63
64# Visualize the records
65visualizer.visualizer(stream2)