diff options
| author | Mac Mollison <mollison@cs.unc.edu> | 2010-03-13 12:09:00 -0500 |
|---|---|---|
| committer | Mac Mollison <mollison@cs.unc.edu> | 2010-03-13 12:09:00 -0500 |
| commit | 14a40b99735f09f6e70b8e897acbb622f9115ca3 (patch) | |
| tree | e8420397374fd31aa36a66d0dc75872142d339e6 /reader/sample_script.py | |
| parent | a643f0465d608552433ba326847eec5d0bef3108 (diff) | |
Directory restructuring
Reworked directory (and modified some code a bit) to match
intended architecture.
Diffstat (limited to 'reader/sample_script.py')
| -rwxr-xr-x | reader/sample_script.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/reader/sample_script.py b/reader/sample_script.py deleted file mode 100755 index f7e9297..0000000 --- a/reader/sample_script.py +++ /dev/null | |||
| @@ -1,41 +0,0 @@ | |||
| 1 | #!/usr/bin/python | ||
| 2 | |||
| 3 | # This is a sample script for using the tool. I would recommend copying | ||
| 4 | # this and modifying it to suit your needs for a particular test. Make | ||
| 5 | # sure you redirect the output to a file (e.g. ./sample_script.py > output). | ||
| 6 | |||
| 7 | # Import the modules we need. You should not need to know about | ||
| 8 | # their internals. | ||
| 9 | import trace_reader | ||
| 10 | import sanitizer | ||
| 11 | import gedf_test | ||
| 12 | import stats | ||
| 13 | import stdout_printer | ||
| 14 | |||
| 15 | # Specify your trace files | ||
| 16 | g6 = [ | ||
| 17 | '../sample_traces/st-g6-0.bin', | ||
| 18 | '../sample_traces/st-g6-1.bin', | ||
| 19 | '../sample_traces/st-g6-2.bin', | ||
| 20 | '../sample_traces/st-g6-3.bin', | ||
| 21 | ] | ||
| 22 | |||
| 23 | # Here is an example of a custom filter function. | ||
| 24 | # It will remove from the error stream all inversion_end records indicating | ||
| 25 | # an inversion of less than 4000000 time units. Thus, you can grep through | ||
| 26 | # the output looking 'Inversion end' and find only errors for particularly | ||
| 27 | # long inversions. This is commented out in the pipeline (below) since you | ||
| 28 | # probably don't want it in general. | ||
| 29 | def my_filter(record): | ||
| 30 | if record.record_type == 'error' and record.type_name == 'inversion_end': | ||
| 31 | if record.job.inversion_end - record.job.inversion_start < 4000000: | ||
| 32 | return False | ||
| 33 | return True | ||
| 34 | |||
| 35 | # Pipeline | ||
| 36 | stream = trace_reader.trace_reader(g6) # Read events from traces | ||
| 37 | stream = sanitizer.sanitizer(stream) # Remove garbage events | ||
| 38 | stream = gedf_test.gedf_test(stream) # Produce G-EDF error records | ||
| 39 | stream = stats.stats(stream) # Produce a statistics record | ||
| 40 | #stream = filter(my_filter, stream) # Filter some records before printing | ||
| 41 | stdout_printer.stdout_printer(stream) # Print records to stdout | ||
