From 8a10b697162abccf7bff1dede079afa46fb6def9 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Mon, 2 Dec 2024 17:27:41 +0100 Subject: [PATCH] review findThresholds logic in metricPlot --- .../src/generic/plots/MetricPlot.svelte | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/web/frontend/src/generic/plots/MetricPlot.svelte b/web/frontend/src/generic/plots/MetricPlot.svelte index 536739df..f08c86db 100644 --- a/web/frontend/src/generic/plots/MetricPlot.svelte +++ b/web/frontend/src/generic/plots/MetricPlot.svelte @@ -84,19 +84,20 @@ if (metricConfig?.aggregation == "sum") { - let divisor = 1 + let divisor; if (isShared == true) { // Shared if (numaccs > 0) divisor = subClusterTopology.accelerators.length / numaccs; - else if (numhwthreads > 0) divisor = subClusterTopology.node.length / numhwthreads; + else if (numhwthreads > 0) divisor = subClusterTopology.core.length / numhwthreads; } - else if (scope == 'socket') divisor = subClusterTopology.socket.length; - else if (scope == "core") divisor = subClusterTopology.core.length; - else if (scope == "accelerator") - divisor = subClusterTopology.accelerators.length; - else if (scope == "hwthread") divisor = subClusterTopology.node.length; + else if (scope == 'node') divisor = 1; // Use as configured for nodes + else if (scope == 'socket') divisor = subClusterTopology.socket.length; + else if (scope == "memoryDomain") divisor = subClusterTopology.memoryDomain.length; + else if (scope == "core") divisor = subClusterTopology.core.length; + else if (scope == "hwthread") divisor = subClusterTopology.core.length; // alt. name for core + else if (scope == "accelerator") divisor = subClusterTopology.accelerators.length; else { - // console.log('TODO: how to calc thresholds for ', scope) - return null; + console.log('Unknown scope, return default thresholds ', scope) + divisor = 1; } return {