From 83cc4837ce02fa75ce3dd6b2795322bd566b0191 Mon Sep 17 00:00:00 2001 From: Laxmikant Kale Date: Sat, 22 Aug 2026 20:27:19 -0500 Subject: [PATCH 1/3] Extrema: Show the analyzed time range and PE selection on the chart The x axis shows notable PEs, so nothing on the chart said what time interval the analysis covered. Flank the chart title with the loaded time range (left) and the processor selection (right), using the title-annotation hook Graph already has; both trim to fit the window. Co-Authored-By: Claude Fable 5 --- .../Tools/Extrema/ExtremaWindow.java | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/projections/Tools/Extrema/ExtremaWindow.java b/src/projections/Tools/Extrema/ExtremaWindow.java index 4316ecb..f3a408e 100644 --- a/src/projections/Tools/Extrema/ExtremaWindow.java +++ b/src/projections/Tools/Extrema/ExtremaWindow.java @@ -123,6 +123,11 @@ public class ExtremaWindow extends GenericGraphWindow private double[][] graphData; private LinkedList 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 - " + @@ -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; @@ -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); @@ -943,11 +952,19 @@ 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 selectedPEs = + (dialog != null) ? new TreeSet(dialog.getSelectedProcessors()) : null; + graphCanvas.setTitleAnnotations( + "Time " + U.humanReadableString(loadedStartTime) + + " - " + U.humanReadableString(loadedEndTime), + Util.processorSelectionString(selectedPEs)); refreshGraph(); } From 1e22291c334e28fd7f838471984d4596c77e1b21 Mon Sep 17 00:00:00 2001 From: Laxmikant Kale Date: Sat, 22 Aug 2026 20:27:19 -0500 Subject: [PATCH 2/3] UsageProfile: Keep the chart title readable at large PE counts The title expanded the full PE list (Util.listToString), so at hundreds of PEs it grew wider than the canvas and everything that identifies the chart scrolled out of sight, including the time range on the second line. Use the strided selection summary instead, and print the time range with time units rather than bare millisecond floats. Co-Authored-By: Claude Fable 5 --- src/projections/gui/ProfileWindow.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/projections/gui/ProfileWindow.java b/src/projections/gui/ProfileWindow.java index 3515ea0..fabaf90 100644 --- a/src/projections/gui/ProfileWindow.java +++ b/src/projections/gui/ProfileWindow.java @@ -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.humanReadableString(data.begintime)+" - "+U.humanReadableString(data.endtime)+")"; displayCanvas.setGraphTiltes(gTitles); String[] xNames = new String[data.plist.size()+1]; From d24156ae3ce9ce0c0763c8443e8f5fa984ea2daa Mon Sep 17 00:00:00 2001 From: Laxmikant Kale Date: Sat, 22 Aug 2026 21:23:19 -0500 Subject: [PATCH 3/3] Extrema, UsageProfile: Cap header times at three decimal places Chart headers borrowed the range dialog's full-precision time format (as many decimals as the number has digits). New U.humanReadableRange prints a time range with at most three decimals, adding digits only when the range is so narrow that the endpoints would print alike. Co-Authored-By: Claude Fable 5 --- .../Tools/Extrema/ExtremaWindow.java | 3 +-- src/projections/gui/ProfileWindow.java | 2 +- src/projections/gui/U.java | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/projections/Tools/Extrema/ExtremaWindow.java b/src/projections/Tools/Extrema/ExtremaWindow.java index f3a408e..056adf4 100644 --- a/src/projections/Tools/Extrema/ExtremaWindow.java +++ b/src/projections/Tools/Extrema/ExtremaWindow.java @@ -962,8 +962,7 @@ protected void setGraphSpecificData() { SortedSet selectedPEs = (dialog != null) ? new TreeSet(dialog.getSelectedProcessors()) : null; graphCanvas.setTitleAnnotations( - "Time " + U.humanReadableString(loadedStartTime) + - " - " + U.humanReadableString(loadedEndTime), + "Time " + U.humanReadableRange(loadedStartTime, loadedEndTime), Util.processorSelectionString(selectedPEs)); refreshGraph(); } diff --git a/src/projections/gui/ProfileWindow.java b/src/projections/gui/ProfileWindow.java index fabaf90..4465ee0 100644 --- a/src/projections/gui/ProfileWindow.java +++ b/src/projections/gui/ProfileWindow.java @@ -515,7 +515,7 @@ private void setDisplayProfileData(){ // 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.humanReadableString(data.begintime)+" - "+U.humanReadableString(data.endtime)+")"; + gTitles[1] = "(Time "+U.humanReadableRange(data.begintime, data.endtime)+")"; displayCanvas.setGraphTiltes(gTitles); String[] xNames = new String[data.plist.size()+1]; diff --git a/src/projections/gui/U.java b/src/projections/gui/U.java index dea7ff4..9587234 100644 --- a/src/projections/gui/U.java +++ b/src/projections/gui/U.java @@ -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; + } + }