Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions src/projections/Tools/Extrema/ExtremaWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ public class ExtremaWindow extends GenericGraphWindow
private double[][] graphData;
private LinkedList<Integer> outlierPEs;

// The time range the loaded data covers, for the chart header; the x axis
// shows PEs, so nothing else on the chart says what interval was analyzed.
private long loadedStartTime;
private long loadedEndTime;


public ExtremaWindow(MainWindow mainWindow) {
super("Projections Extrema Analysis Tool - " +
Expand Down Expand Up @@ -290,6 +295,8 @@ public Paint[] getColorMap() {
private GenericGraphColorer colorer;

private void constructToolData(final long startTime, final long endTime ) {
loadedStartTime = startTime;
loadedEndTime = endTime;
// construct the necessary meta-data given the selected activity
// type.
double[][] tempData;
Expand Down Expand Up @@ -795,7 +802,9 @@ public void done() {
// outlier analysis which will then determine which processor's
// log data to read.
private void readOutlierStats(final long startTime, final long endTime) {
numActivities = MainWindow.runObject[myRun].getNumActivity(selectedActivity);
loadedStartTime = startTime;
loadedEndTime = endTime;
numActivities = MainWindow.runObject[myRun].getNumActivity(selectedActivity);

colorer = new OnlineDataColorer(numActivities);

Expand Down Expand Up @@ -943,11 +952,18 @@ private void readOnlineOutlierProcessor(int pe, int index, final long startTime,

protected void setGraphSpecificData() {
setXAxis("Notable PEs (Cluster Representatives and Extrema)", outlierList);
setYAxis(attributes[1][selectedAttribute],
setYAxis(attributes[1][selectedAttribute],
attributes[2][selectedAttribute]);
setDataSource("Extrema: " + attributes[0][selectedAttribute] +
" (" + threshold +
" (" + threshold +
" Extrema PEs)", graphData, colorer, this);
// Flank the chart title with the analyzed time range and PE selection;
// neither is visible anywhere else on this chart.
SortedSet<Integer> selectedPEs =
(dialog != null) ? new TreeSet<Integer>(dialog.getSelectedProcessors()) : null;
graphCanvas.setTitleAnnotations(
"Time " + U.humanReadableRange(loadedStartTime, loadedEndTime),
Util.processorSelectionString(selectedPEs));
refreshGraph();
}

Expand Down
7 changes: 5 additions & 2 deletions src/projections/gui/ProfileWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,11 @@ private void setDisplayProfileData(){


String[] gTitles = new String[2];
gTitles[0] = "Profile of Usage for Processors "+Util.listToString(data.plist);
gTitles[1] = "(Time "+data.begintime/(float)1000+" ~ "+data.endtime/(float)1000+" ms)";
// Strided form ("0-115:5"), not the expanded list: at large PE counts
// the expanded list is wider than the canvas, pushing everything that
// identifies the chart (including the time range below) out of sight.
gTitles[0] = "Profile of Usage for "+Util.processorSelectionString(data.plist);
gTitles[1] = "(Time "+U.humanReadableRange(data.begintime, data.endtime)+")";
displayCanvas.setGraphTiltes(gTitles);

String[] xNames = new String[data.plist.size()+1];
Expand Down
19 changes: 19 additions & 0 deletions src/projections/gui/U.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,23 @@ public static String humanReadableString(long us, int places)
return (int)(us/1000000)+printDecimals(us*0.000001,places)+"s";
}

/*
A time range for a chart header: "start - end" with at most 3 decimal
places, adding digits only when the range is so narrow that the two
endpoints would otherwise print alike. Six decimals of a seconds value
is exact microseconds, so distinct endpoints always separate.
*/
public static String humanReadableRange(long startUs, long endUs)
{
int places = 3;
String start = humanReadableString(startUs, places);
String end = humanReadableString(endUs, places);
while (start.equals(end) && startUs != endUs && places < 6) {
places++;
start = humanReadableString(startUs, places);
end = humanReadableString(endUs, places);
}
return start + " - " + end;
}

}
Loading