edu.ufl.hcs.ppw.pdm.highlevel.HighLevelPDM Class Reference

A high-level layer over top of a PerformanceDataManager instance that provides easy ways to look at the performance data. More...

Inheritance diagram for edu.ufl.hcs.ppw.pdm.highlevel.HighLevelPDM:

edu.ufl.hcs.ppw.pdm.PerformanceDataManager

List of all members.

Classes

class  DefaultStatDataSorter
 The default sorter to use. More...
class  OperationStatDataSorter
 Alternate sorter to use. More...
class  ThreadComparator
 Comparator for sorting thread list. More...

Public Member Functions

 HighLevelPDM (PerformanceDataManager dataManager, int aggregationMethod)
 Creates a new instance of HighLevelPDM, using the given aggregation method.
CommstatData getCommstatForRank (int localRank, int remoteRank)
 Return a commstat data for given local + remote ranks.
String getFilename (CallsiteData cd)
 Returns the filename for a CallsiteData object, or ?? if invalid.
int getRankFromThreadID (int threadID)
 Get rank for a thread ID.
ArrayList getSortedThreadList ()
 Gets a list of all ThreadData objects, sorted.
String getAggregationMethodString ()
 Returns current aggregation method as a string.
boolean hasTraceRecords ()
 Returns true if this file has trace records.
long getFirstTraceTimeStamp () throws IOException
 Gets the first timestamp of the first trace record.
boolean isSourceUserCode (int sourceID)
 Does the sourceID correspond to user code?
boolean isOperationTypeUserCode (int operationTypeID)
 Version of isSourceUserCode that works on an operation type ID.
boolean isOperationTypeSynchronization (int operationTypeID)
 Is the operation type a type of synchronization operation?
void setAggregationMethod (int aggregationMethod)
 Set new aggregation method.
CallTree getCalltree ()
 Returns the calltree for all stats.
CallTree getGroupedCalltree ()
 Returns the calltree for all stats, with callsites grouped together.
CallTree getFlatCalltree ()
 Returns a flattened calltree for all stats.
CallTree getGroupedFlatCalltree ()
 Returns a flattened calltree for all stats, with callsites grouped together.
double getTotalRuntime ()
 Returns the total runtime, in seconds.
AnalysisDataManager getADM ()
 Returns the analysis data manager associated with this data file.
void setADM (AnalysisDataManager adm)
 Set the analysis data manager for this data file.
String getLoadedFilename ()
 What file did we load?
double getVersionNumber ()
 The version number of this trace file format.
Date getDate ()
 The date the experiment was run.
String getEnvironmentVariables ()
 The environment variables present during the run, or null if not available.
String getCommandlineArguments ()
 The command line arguments to the program, or null if not available.
String getExecutableFullPath ()
 Full path to executable.
String getWorkingDirectory ()
 Working directory during run.
int getTraceMode ()
 The trace mode: see the constants file for possible values.
long getTraceRecordCount ()
 Total number of trace records.
int getProfileMode ()
 The profile mode: see the constants file for possible values.
int[] getCommHistRanges ()
 Ranges for the comm stats.
void rewindTrace (int threadID) throws IOException
 Rewinds a particular thread's trace record stream back to the beginning.
TraceRecord getNextTraceRecord (int threadID) throws IOException
 Gets the next trace record for the thread; returns null if no more.
int getEffectiveSourceCallsiteID (int sourceID)
 Given a sourceID, returns the callsite's ID, efficiently.
String getSourceCallsiteString (int sourceID)
 Given a sourceID, returns the callsite (as a String), efficiently.
String getSourceCallsiteFilename (int sourceID)
 Given a sourceID, returns the callsite's filename, efficiently.
int getSourceCallsiteLine (int sourceID)
 Given a sourceID, returns the callsite's line number, efficiently.
String getSourceOperationName (int sourceID)
 Given a sourceID, returns the name of the operation.
int getSourceOperationTypeID (int sourceID)
 Given a sourceID, returns the type of the operation.
int getSourceLanguageID (int sourceID)
 Given a sourceID, returns the language ID.
int getSourceOperationID (int sourceID)
 Given a sourceID, returns the operation ID.
int getSourceBodyTypeID (int sourceID)
 Given a sourceID, returns the body type ID.
int getSourceBodySize (int sourceID)
 Given a sourceID, returns the body type size.
final String getSourceTypeConstant (int sourceID)
 Returns the string constant from PPWConstants that corresponds to the type of this source ID, so you can easily do things like.
final String getOperationTypeConstant (int operationTypeID)
 Similar to getSourceTypeConstant(), except works on a operation type ID.
BodytypeData getBodytype (int index)
 Gets a body type.
int getBodytypes ()
 Number of bodytypes.
OperationtypeData getOperationtype (int index)
 Gets an operation type.
int getOperationtypes ()
 Number of bodytypes.
FilenameData getFilename (int index)
 Gets a filename.
int getFilenames ()
 Number of filenames.
CallsiteData getCallsite (int index)
 Gets a callsite.
int getCallsites ()
 Number of callsites.
LanguageData getLanguage (int index)
 Gets a language.
int getLanguages ()
 Number of languages.
OperationData getOperation (int index)
 Gets an operation.
int getOperations ()
 Number of operations.
ThreadData getThread (int index)
 Gets a thread.
int getThreads ()
 Number of threads.
SourceData getSource (int index)
 Gets a source.
int getSources ()
 Number of sources.
MetricData getMetric (int index)
 Gets a metric.
int getMetrics ()
 Number of metrics.
StatData getStat (int index)
 Gets a stat.
int getStats ()
 Number of stats.
CommstatData getCommstat (int index)
 Gets a communication stat.
int getCommstats ()
 Number of communication stats.
LinecommstatData getLinecommstat (int index)
 Gets a per-line communication stat.
int getLinecommstats ()
 Number of per-line communication stats.
StaticarrayData getStaticarray (int index)
 Gets a static array.
int getStaticarrays ()
 Number of statically-allocated arrays.

Static Public Attributes

static final int AGGREGATE_METHOD_MIN = 1
 Aggregate using min of all values.
static final int AGGREGATE_METHOD_MAX = 2
 Aggregate using max of all values.
static final int AGGREGATE_METHOD_AVG = 3
 Aggregate using running average of all values.
static final int AGGREGATE_METHOD_SUM = 4
 Aggregate using sum of all values.

Package Functions

void initData ()
 Processes the data in the PDM.
void updateCommstatArray ()
 Update the commstat array for easy loading.
void dump (CallTree tree, int level, boolean showThreads)
 Dump out a calltree to stderr (debug).

Package Attributes

PerformanceDataManager pdm
 our PDM instance
AnalysisDataManager adm
 one-to-one link with analysis data (null if not present)
int aggMethod
int threads
CallTree tree
CallTree flatTree
CallTree cTree
CallTree cFlatTree
int[] rankMap
CommstatData[][] commStats
DefaultStatDataSorter sorter
OperationStatDataSorter opSorter
ThreadComparator thComp
ArrayList sortedThreadList
long firstTimestamp = 0
 Cache of first timestamp, so we only have to calculate it once.
boolean haveFirstStamp = false


Detailed Description

A high-level layer over top of a PerformanceDataManager instance that provides easy ways to look at the performance data.

Some comments about the thread-safety of returning ArrayLists: each function that returns an ArrayList makes a copy of it first. This way, if the list is being used across threads or different visualization instances, a destructive operation such as Collections.sort on one visualization doesn't screw up the other visualization.

Author:
Adam Leko

Member Function Documentation

AnalysisDataManager edu.ufl.hcs.ppw.pdm.highlevel.HighLevelPDM.getADM (  ) 

String edu.ufl.hcs.ppw.pdm.highlevel.HighLevelPDM.getExecutableFullPath (  ) 

long edu.ufl.hcs.ppw.pdm.highlevel.HighLevelPDM.getFirstTraceTimeStamp (  )  throws IOException

CallTree edu.ufl.hcs.ppw.pdm.highlevel.HighLevelPDM.getGroupedFlatCalltree (  ) 

Returns a flattened calltree for all stats, with callsites grouped together.

NOTE: This flat profile may produce some strange results, especially if flattening data that has nested calls. A good example of this is something like:

upc_forall() { ... upc_forall() { ...

If both of these were grouped together, the upc_forall element in root would have an inclusive sum that is overreported, because it would not reflect the fact that the second upc_forall is nested within the first one. We avoid this problem by only grouping together callsites that have no children underneath each other, which results in two entries for upc_forall() but avoids giving an incorrect inclusive sum.

Another example would be something like A -> B -> C -> B, where each call in that sequence has 1 second of inclusive time. Because PPW currently receives declaration source info for each call (and not the real callsite info), a flat profile will have B showing an inclusive sum of 4 seconds instead of the real value of 3. If callsite information is available, there will be two entries for B in the flat profile for the same reasons as in the last paragraph (children -> no aggregation). Luckily, this situation doesn't arise much in real user code so is not likely to cause any problems.

Referenced by edu.ufl.hcs.ppw.vis.pcharts.AggregatedProfileMetricsPieChart.initPDM(), edu.ufl.hcs.ppw.vis.pcharts.AggregatedProfileMetricsBarChart.initPDM(), edu.ufl.hcs.ppw.vis.pcharts.ProgramSpeedupStackedBarChart.notifySelectedRevision(), edu.ufl.hcs.ppw.vis.treetable.CallTreeTableModel.refreshData(), and edu.ufl.hcs.ppw.vis.pcharts.RegionThreadBreakdownBarChart.setupRegionList().

final String edu.ufl.hcs.ppw.pdm.highlevel.HighLevelPDM.getSourceTypeConstant ( int  sourceID  ) 

Returns the string constant from PPWConstants that corresponds to the type of this source ID, so you can easily do things like.

if (getSourceTypeString(srcID) == PPWConstants.TYPE_GET) {...

without having to fall back to a slow string comparison.

Implements edu.ufl.hcs.ppw.pdm.PerformanceDataManager.

References edu.ufl.hcs.ppw.pdm.PerformanceDataManager.getSourceTypeConstant(), and edu.ufl.hcs.ppw.pdm.highlevel.HighLevelPDM.pdm.

String edu.ufl.hcs.ppw.pdm.highlevel.HighLevelPDM.getWorkingDirectory (  ) 


The documentation for this class was generated from the following file:

Generated on Sat Sep 29 08:46:42 2012 for PPW by  doxygen 1.5.8