From 1528ab0b7d56aa681f6ca621eccc878dbddfff15 Mon Sep 17 00:00:00 2001 From: Laksono Adhianto Date: Mon, 6 Jun 2022 14:56:06 -0500 Subject: [PATCH 1/5] Fix issue #207 (unicode is not supported in some platforms) The fix is to check the Java's "file.encoding" system property. If the property is based on ANSI character set, it's likely it doesn't support UTF. This assumption is not entirely correct, but good enough for now. --- build.sh | 4 ++-- .../cs/hpcsetting/preferences/AppearencePage.java | 4 ++-- .../preferences/ViewerPreferenceManager.java | 15 ++++++++++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/build.sh b/build.sh index 54ace5567..98075c39c 100755 --- a/build.sh +++ b/build.sh @@ -332,7 +332,7 @@ if [[ "$VERBOSE" == "1" ]]; then fi ./build.sh ${OPTION} -if [ -f hpcdata*.tgz ]; then +if [ -f hpcdata-${RELEASE}.tgz ]; then cp hpcdata*.tgz ../.. else echo "Fail to build hpcdata" @@ -349,6 +349,6 @@ echo " Done" echo "==================================" ls -l hpcviewer-${RELEASE}-* -if [ -f hpcdata*.tgz ]; then +if [ -f hpcdata-${RELEASE}.tgz ]; then ls -l hpcdata* fi diff --git a/edu.rice.cs.hpcsetting/src/edu/rice/cs/hpcsetting/preferences/AppearencePage.java b/edu.rice.cs.hpcsetting/src/edu/rice/cs/hpcsetting/preferences/AppearencePage.java index f7aae5969..a5c6777aa 100644 --- a/edu.rice.cs.hpcsetting/src/edu/rice/cs/hpcsetting/preferences/AppearencePage.java +++ b/edu.rice.cs.hpcsetting/src/edu/rice/cs/hpcsetting/preferences/AppearencePage.java @@ -77,7 +77,7 @@ protected Control createContents(Composite parent) { // call-site area // Group groupCallsite = createGroupControl(parent, "Call-site glyph settings ", false); - fontCallsiteEditor = createFontEditor(groupCallsite, PreferenceConstants.ID_FONT_CALLSITE, "Glyph font:", FontManager.getCallsiteGlyphFont()); + fontCallsiteEditor = createFontEditor(groupCallsite, PreferenceConstants.ID_FONT_CALLSITE, "Glyph font:", FontManager.getCallsiteGlyphFont()); Composite glyphArea = new Composite(groupCallsite, SWT.NONE); GridDataFactory.fillDefaults().grab(true, true).span(3, 1).applyTo(glyphArea); @@ -94,7 +94,7 @@ protected Control createContents(Composite parent) { glyphComboEditor.setFont(font); }); - return parent; + return parent; } diff --git a/edu.rice.cs.hpcsetting/src/edu/rice/cs/hpcsetting/preferences/ViewerPreferenceManager.java b/edu.rice.cs.hpcsetting/src/edu/rice/cs/hpcsetting/preferences/ViewerPreferenceManager.java index d70caa053..a0031c321 100644 --- a/edu.rice.cs.hpcsetting/src/edu/rice/cs/hpcsetting/preferences/ViewerPreferenceManager.java +++ b/edu.rice.cs.hpcsetting/src/edu/rice/cs/hpcsetting/preferences/ViewerPreferenceManager.java @@ -64,8 +64,17 @@ public void setDefaults() { PreferenceConstants.ID_FONT_CALLSITE, FontManager.getCallsiteGlyphDefaultFont().getFontData()); - store.setDefault(PreferenceConstants.ID_CHAR_CALLTO, DEFAULT_CALLTO[DEFAULT_CALLSITE_INDEX]); - store.setDefault(PreferenceConstants.ID_CHAR_CALLFROM, DEFAULT_CALLFROM[DEFAULT_CALLSITE_INDEX]); + // fix issue #207 (some platforms don't support unicode) + // check if the encoding supports UTF or not. + // Most systems that have ANSI platform has no UTF support + // Example: ANSI_X3.4-1968 is basically an ASCII set + int indexDefault = DEFAULT_CALLSITE_INDEX; + var encoding = System.getProperty("file.encoding"); + if (encoding.startsWith("ANSI")) + indexDefault = 0; + + store.setDefault(PreferenceConstants.ID_CHAR_CALLTO, DEFAULT_CALLTO[indexDefault]); + store.setDefault(PreferenceConstants.ID_CHAR_CALLFROM, DEFAULT_CALLFROM[indexDefault]); } @@ -138,4 +147,4 @@ public String getCallFromGlyph() { return EMPTY; return store.getString(PreferenceConstants.ID_CHAR_CALLFROM); } -} \ No newline at end of file +} From 3619f9b110dae4b3f48d7a6129135ce47108c3b2 Mon Sep 17 00:00:00 2001 From: Laksono Adhianto Date: Mon, 6 Jun 2022 15:22:45 -0500 Subject: [PATCH 2/5] table: Avoid calling visualRefresh twice during initialization It seems it doesn't change to call once or twice. If once is sufficient, avoid overcomplexity by calling refresh twice. Minor update: add some comments --- .../edu/rice/cs/hpcmetric/dialog/ExtDerivedMetricDlg.java | 4 ++-- .../src/edu/rice/cs/hpctree/ScopeTreeTable.java | 6 +++--- .../src/edu/rice/cs/hpctree/TableFitting.java | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/edu.rice.cs.hpcmetric/src/edu/rice/cs/hpcmetric/dialog/ExtDerivedMetricDlg.java b/edu.rice.cs.hpcmetric/src/edu/rice/cs/hpcmetric/dialog/ExtDerivedMetricDlg.java index 840f4feb7..d6c55f3cc 100644 --- a/edu.rice.cs.hpcmetric/src/edu/rice/cs/hpcmetric/dialog/ExtDerivedMetricDlg.java +++ b/edu.rice.cs.hpcmetric/src/edu/rice/cs/hpcmetric/dialog/ExtDerivedMetricDlg.java @@ -197,8 +197,8 @@ protected Control createDialogArea(Composite parent) { final Label lblName = new Label(nameArea, SWT.LEFT); lblName.setText("Name:"); // $NON-SLS - this.cbMetricName = new Combo(nameArea, SWT.NONE); - this.cbMetricName.setToolTipText("Name of the derived metric"); // $NON-SLS + cbMetricName = new Combo(nameArea, SWT.NONE); + cbMetricName.setToolTipText("Type the displayed name of the derived metric"); // $NON-SLS objHistoryName = new UserInputHistory( ExtDerivedMetricDlg.HISTORY_METRIC_NAME ); final List nameHistory = objHistoryName.getHistory(); diff --git a/edu.rice.cs.hpctree/src/edu/rice/cs/hpctree/ScopeTreeTable.java b/edu.rice.cs.hpctree/src/edu/rice/cs/hpctree/ScopeTreeTable.java index 53abfe172..a0cd67ffe 100644 --- a/edu.rice.cs.hpctree/src/edu/rice/cs/hpctree/ScopeTreeTable.java +++ b/edu.rice.cs.hpctree/src/edu/rice/cs/hpctree/ScopeTreeTable.java @@ -140,7 +140,7 @@ public ScopeTreeTable(Composite parent, int style, IScopeTreeData treeData) { // turn the auto configuration off as we want to add our header menu // configuration - natTable = new NatTable(parent, NatTable.DEFAULT_STYLE_OPTIONS , compositeLayer, false); + natTable = new NatTable(parent, NatTable.DEFAULT_STYLE_OPTIONS, compositeLayer, false); // as the autoconfiguration of the NatTable is turned off, we have to // add the DefaultNatTableStyleConfiguration and the ConfigRegistry @@ -170,7 +170,7 @@ public ScopeTreeTable(Composite parent, int style, IScopeTreeData treeData) { // I don't know why we have to refresh the table here // However, without refreshing, the content will be weird - visualRefresh(); + // visualRefresh(); natTable.configure(); // -------------------------------- @@ -218,9 +218,9 @@ public ScopeTreeTable(Composite parent, int style, IScopeTreeData treeData) { natTable.getDisplay().addFilter(SWT.MouseDown, resizeListener); natTable.getDisplay().addFilter(SWT.MouseUp, resizeListener); + // Fix issue #204: has to call header font configuration manually fontConfig.configureHeaderFont(natTable.getConfigRegistry()); visualRefresh(); - } diff --git a/edu.rice.cs.hpctree/src/edu/rice/cs/hpctree/TableFitting.java b/edu.rice.cs.hpctree/src/edu/rice/cs/hpctree/TableFitting.java index c6dc59b72..3d7065ce9 100644 --- a/edu.rice.cs.hpctree/src/edu/rice/cs/hpctree/TableFitting.java +++ b/edu.rice.cs.hpctree/src/edu/rice/cs/hpctree/TableFitting.java @@ -14,7 +14,7 @@ *****************************/ public class TableFitting { - private static final String PREF_FIT_MODE = "viewer.fit.mode"; + private static final String PREF_FIT_MODE = "hpcviewer.fit.mode"; /*** * * Mode of table column fitting: @@ -45,8 +45,8 @@ private TableFitting() { */ public static String toString(ColumnFittingMode mode) { if (mode == ColumnFittingMode.FIT_DATA) - return "Autofit is based on the data"; - return "Autofit is based on both the header and the data"; + return "Resize mode is based on the data"; + return "Resize mode is based on both the header label and the data"; } From 691e991f9cccfc7bbeca261fd7d8527a18739864 Mon Sep 17 00:00:00 2001 From: Laksono Adhianto Date: Mon, 6 Jun 2022 21:25:05 -0500 Subject: [PATCH 3/5] Fix hand while testing the viewer due to java SecureRandom According to https://sandor.tech/java/2017/08/02/securerandom-can-hang.html the java.util.SecureRandom class may hang on Linux platforms. It's better to use the standard Random instead to avoid hang. It's just a test, it doesn't matter if it isn't do randomization properly. --- .../src/edu/rice/cs/hpctest/data/util/DataFactory.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/edu.rice.cs.hpctest.data/src/edu/rice/cs/hpctest/data/util/DataFactory.java b/tests/edu.rice.cs.hpctest.data/src/edu/rice/cs/hpctest/data/util/DataFactory.java index 92f8cd112..381f362a2 100644 --- a/tests/edu.rice.cs.hpctest.data/src/edu/rice/cs/hpctest/data/util/DataFactory.java +++ b/tests/edu.rice.cs.hpctest.data/src/edu/rice/cs/hpctest/data/util/DataFactory.java @@ -2,7 +2,6 @@ import java.io.File; import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; import java.util.ArrayList; import java.util.List; import java.util.Random; @@ -26,7 +25,7 @@ public class DataFactory { private static final int DEFAULT_DB = 10; - private static Random rand; + private static final Random rand = new Random(); public static List createExperiments() throws NoSuchAlgorithmException { return createExperiments(DEFAULT_DB); @@ -93,9 +92,6 @@ private static void createTreeNode(RootScope root, Scope parent, int children, i } private static void createMetric(Scope scope, Experiment exp) throws NoSuchAlgorithmException { - if (rand == null) - rand = SecureRandom.getInstanceStrong(); - for(int i=0; i Date: Tue, 7 Jun 2022 07:08:59 -0500 Subject: [PATCH 4/5] Remove the label of "Rank range" for prof2 db prof2 database can have different types of id-tuple types (mpi, thread, cores, gpu contexts, streams ...). It doesn't make sense to linearize them to show the range range. We need to come up with a better solution. At the moment, removing the label is a better option. --- .../rice/cs/hpctraceviewer/ui/main/SpaceTimeDetailCanvas.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/edu.rice.cs.hpctraceviewer.ui/src/edu/rice/cs/hpctraceviewer/ui/main/SpaceTimeDetailCanvas.java b/edu.rice.cs.hpctraceviewer.ui/src/edu/rice/cs/hpctraceviewer/ui/main/SpaceTimeDetailCanvas.java index 14b87f1c3..0454d8f79 100644 --- a/edu.rice.cs.hpctraceviewer.ui/src/edu/rice/cs/hpctraceviewer/ui/main/SpaceTimeDetailCanvas.java +++ b/edu.rice.cs.hpctraceviewer.ui/src/edu/rice/cs/hpctraceviewer/ui/main/SpaceTimeDetailCanvas.java @@ -602,7 +602,8 @@ private void adjustLabels() final TraceDisplayAttribute attributes = stData.getTraceDisplayAttribute(); showTimeRange(attributes); - showProcessRange(attributes); + if (stData.getExperiment().getMajorVersion() == edu.rice.cs.hpcdata.util.Constants.EXPERIMENT_DENSED_VERSION) + showProcessRange(attributes); showCrossHair(attributes); // resize the composite to make sure all texts are visible From fbca5abca54470d46b0401d65645ddbfeb8242c3 Mon Sep 17 00:00:00 2001 From: Laksono Adhianto Date: Tue, 7 Jun 2022 08:30:50 -0500 Subject: [PATCH 5/5] 2022.06 release candidate I (RC1) --- edu.rice.cs.hpcviewer.ui/release.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edu.rice.cs.hpcviewer.ui/release.txt b/edu.rice.cs.hpcviewer.ui/release.txt index a8a368a6a..2d4078f11 100644 --- a/edu.rice.cs.hpcviewer.ui/release.txt +++ b/edu.rice.cs.hpcviewer.ui/release.txt @@ -1 +1 @@ -Release 2022.06. Commit fa410307 +Release 2022.06. Commit 00ec7977