diff --git a/web/frontend/src/Status.root.svelte b/web/frontend/src/Status.root.svelte index 2b57bfa..8dcc82e 100644 --- a/web/frontend/src/Status.root.svelte +++ b/web/frontend/src/Status.root.svelte @@ -4,6 +4,7 @@ import Histogram from './plots/Histogram.svelte' import { Row, Col, Spinner, Card, CardHeader, CardTitle, CardBody, Table, Progress, Icon } from 'sveltestrap' import { init } from './utils.js' + import { scaleNumbers } from './units.js' import { queryStore, gql, getContextClient } from '@urql/svelte' const { query: initq } = init() @@ -50,15 +51,17 @@ ? sum + (node.metrics.find(m => m.name == metric)?.metric.series.reduce((sum, series) => sum + series.data[series.data.length - 1], 0) || 0) : sum, 0) - let allocatedNodes = {}, flopRate = {}, flopRateUnit = {}, memBwRate = {}, memBwRateUnit = {} + let allocatedNodes = {}, flopRate = {}, flopRateUnitPrefix = {}, flopRateUnitBase = {}, memBwRate = {}, memBwRateUnitPrefix = {}, memBwRateUnitBase = {} $: if ($initq.data && $mainQuery.data) { let subClusters = $initq.data.clusters.find(c => c.name == cluster).subClusters for (let subCluster of subClusters) { - allocatedNodes[subCluster.name] = $mainQuery.data.allocatedNodes.find(({ name }) => name == subCluster.name)?.count || 0 - flopRate[subCluster.name] = Math.floor(sumUp($mainQuery.data.nodeMetrics, subCluster.name, 'flops_any') * 100) / 100 - flopRateUnit[subCluster.name] = subCluster.flopRateSimd.unit.prefix + subCluster.flopRateSimd.unit.base - memBwRate[subCluster.name] = Math.floor(sumUp($mainQuery.data.nodeMetrics, subCluster.name, 'mem_bw') * 100) / 100 - memBwRateUnit[subCluster.name] = subCluster.memoryBandwidth.unit.prefix + subCluster.memoryBandwidth.unit.base + allocatedNodes[subCluster.name] = $mainQuery.data.allocatedNodes.find(({ name }) => name == subCluster.name)?.count || 0 + flopRate[subCluster.name] = Math.floor(sumUp($mainQuery.data.nodeMetrics, subCluster.name, 'flops_any') * 100) / 100 + flopRateUnitPrefix[subCluster.name] = subCluster.flopRateSimd.unit.prefix + flopRateUnitBase[subCluster.name] = subCluster.flopRateSimd.unit.base + memBwRate[subCluster.name] = Math.floor(sumUp($mainQuery.data.nodeMetrics, subCluster.name, 'mem_bw') * 100) / 100 + memBwRateUnitPrefix[subCluster.name] = subCluster.memoryBandwidth.unit.prefix + memBwRateUnitBase[subCluster.name] = subCluster.memoryBandwidth.unit.base } } @@ -116,12 +119,22 @@ Flop Rate (Any)
- ({flopRate[subCluster.name]} {flopRateUnit[subCluster.name]} / {(subCluster.flopRateSimd.value * subCluster.numberOfNodes)} {flopRateUnit[subCluster.name]} [Max]) + + {scaleNumbers(flopRate[subCluster.name], + (subCluster.flopRateSimd.value * subCluster.numberOfNodes), + flopRateUnitPrefix[subCluster.name]) + }{flopRateUnitBase[subCluster.name]} [Max] + MemBw Rate
- ({memBwRate[subCluster.name]} {memBwRateUnit[subCluster.name]} / {(subCluster.memoryBandwidth.value * subCluster.numberOfNodes)} {memBwRateUnit[subCluster.name]} [Max]) + + {scaleNumbers(memBwRate[subCluster.name], + (subCluster.memoryBandwidth.value * subCluster.numberOfNodes), + memBwRateUnitPrefix[subCluster.name]) + }{memBwRateUnitBase[subCluster.name]} [Max] + diff --git a/web/frontend/src/plots/Histogram.svelte b/web/frontend/src/plots/Histogram.svelte index eaaf49c..12d9fc2 100644 --- a/web/frontend/src/plots/Histogram.svelte +++ b/web/frontend/src/plots/Histogram.svelte @@ -196,7 +196,7 @@ +
+