Download TAU User Guide - Computer and Information Science

Transcript
Running PerfExplorer Scripts
•
RatioOperation
•
ScalabilityOperation
•
TopXEvents
•
TopXPercentEvents
26.2. Scripting Interface
The scripting interface is in Python, and scripts can be used to build analysis workflows. The Python
scripts control the Java classes in the application through the Jython interpreter (http://www.jython.org/).
There are two types of components which are useful in building analysis scripts. The first type is the
PerformanceResult interface, and the second is the PerformanceAnalysisComponent interface. For documentation on how to use the Java classes, see the javadoc in the perfexplorer source distribution, and the
example scripts below. To build the perfexplorer javadoc, type
%>./make javadoc
in the perfexplorer source directory.
26.3. Example Script
from
from
from
from
from
from
from
from
from
from
from
from
from
glue import PerformanceResult
glue import PerformanceAnalysisOperation
glue import ExtractEventOperation
glue import Utilities
glue import BasicStatisticsOperation
glue import DeriveMetricOperation
glue import MergeTrialsOperation
glue import TrialResult
glue import AbstractResult
glue import DrawMMMGraph
edu.uoregon.tau.perfdmf import Trial
java.util import HashSet
java.util import ArrayList
True = 1
False = 0
def glue():
print "doing phase test for gtc on jaguar"
# load the trial
Utilities.setSession("perfdmf.demo")
trial1 = Utilities.getTrial("gtc_bench", "Jaguar Compiler Options", "fastss
result1 = TrialResult(trial1)
print "got the data"
# get the iteration inclusive totals
events = ArrayList()
for event in result1.getEvents():
#if event.find("Iteration") >= 0 and result1.getEventGroupName(even
if event.find("Iteration") >= 0 and event.find("=>") < 0:
events.add(event)
extractor = ExtractEventOperation(result1, events)
89