blob: 435cde04e9aa48e8630488c9c7d9c5185f2356c5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#!/usr/bin/python
################################################################################
# Description
################################################################################
# This is a sample script for using the tool. I would recommend copying
# this and modifying it to suit your needs for a particular test. Make
# sure you redirect the output to a file (e.g. ./sample_script.py > output).
################################################################################
# Setup
################################################################################
# Import the modules we need. You should not need to know about
# their internals.
import trace_reader
import sanitizer
import gedf_test
import stats
import stdout_printer
import visualizer
# Specify your trace files
g6 = [
'./sample_traces/st-g6-0.bin',
'./sample_traces/st-g6-1.bin',
'./sample_traces/st-g6-2.bin',
'./sample_traces/st-g6-3.bin',
]
################################################################################
# Pipeline
################################################################################
# Read events from traces
stream = trace_reader.trace_reader(g6)
# Filter out garbage events
stream = sanitizer.sanitizer(stream)
# Produce G-EDF error records
stream = gedf_test.gedf_test(stream)
# Produce a statistics record
stream = stats.stats(stream)
# Filter some records out
# NOTE: Currently, this will break the Visualizer if enabled
def my_filter(record):
if record.record_type == 'error' and record.type_name == 'inversion_end':
if record.job.inversion_end - record.job.inversion_start < 4000000:
return False
return True
#stream = filter(my_filter, stream)
# Split the stream in two, so we can use both output mechanisms
import itertools
stream1, stream2 = itertools.tee(stream,2)
# Print the records to stdout
stdout_printer.stdout_printer(stream1)
# Visualize the records
visualizer.visualizer(stream2)
|