From 782262b52e070a54cd7963bfc555d93e336c3fa4 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Mon, 27 Nov 2023 10:04:36 +0100 Subject: [PATCH 1/2] add missing package date-fns --- web/frontend/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/web/frontend/package.json b/web/frontend/package.json index 3e77474..725f69a 100644 --- a/web/frontend/package.json +++ b/web/frontend/package.json @@ -20,6 +20,7 @@ "@rollup/plugin-replace": "^5.0.2", "@urql/svelte": "^4.0.1", "chart.js": "^4.3.3", + "date-fns": "^2.30.0", "graphql": "^16.6.0", "svelte-chartjs": "^3.1.2", "sveltestrap": "^5.11.1", From aac3e7d2f4c458cab73ae8a8fcf933c0b42a9aff Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Wed, 29 Nov 2023 10:42:32 +0100 Subject: [PATCH 2/2] fix: fix scope autoselect on jobview statstable --- web/frontend/src/Job.root.svelte | 8 ++++---- web/frontend/src/StatsTable.svelte | 33 ++++++++++++++++-------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/web/frontend/src/Job.root.svelte b/web/frontend/src/Job.root.svelte index 93c5873..8369726 100644 --- a/web/frontend/src/Job.root.svelte +++ b/web/frontend/src/Job.root.svelte @@ -93,7 +93,9 @@ startFetching( job, [...toFetch], - job.numNodes > 2 ? ["node"] : ["node", "core"] + job.numNodes > 2 + ? ["node"] + : ["node", "socket", "core"] ); } else { // Accels and not on node scope @@ -102,7 +104,7 @@ [...toFetch], job.numNodes > 2 ? ["node", "accelerator"] - : ["node", "accelerator", "core"] + : ["node", "accelerator", "socket", "core"] ); } @@ -390,8 +392,6 @@ bind:this={statsTable} job={$initq.data.job} jobMetrics={$jobMetrics.data.jobMetrics} - accMetrics={accMetrics} - accNodeOnly={accNodeOnly} /> {/key} {/if} diff --git a/web/frontend/src/StatsTable.svelte b/web/frontend/src/StatsTable.svelte index e85e835..e1d0c02 100644 --- a/web/frontend/src/StatsTable.svelte +++ b/web/frontend/src/StatsTable.svelte @@ -7,8 +7,6 @@ export let job export let jobMetrics - export let accMetrics - export let accNodeOnly const allMetrics = [...new Set(jobMetrics.map(m => m.name))].sort(), scopesForMetric = (metric) => jobMetrics @@ -23,17 +21,23 @@ || getContext('cc-config')['job_view_nodestats_selectedMetrics'] for (let metric of allMetrics) { - // Not Exclusive or Single Node: Get maxScope() - // No Accelerators in Job and not Acc-Metric: Use 'core' - // Accelerator Metric available on accelerator scope: Use 'accelerator' - // Accelerator Metric only on node scope: Fallback to 'node' - selectedScopes[metric] = (job.exclusive != 1 || job.numNodes == 1) ? - (job.numAccs != 0 && accMetrics.includes(metric)) ? - accNodeOnly ? - 'node' - : 'accelerator' - : 'core' - : maxScope(scopesForMetric(metric)) + // Not Exclusive or Multi-Node: get maxScope directly (mostly: node) + // -> Else: Load smallest available granularity as default as per availability + const availableScopes = scopesForMetric(metric) + if (job.exclusive != 1 || job.numNodes == 1) { + if (availableScopes.includes('accelerator')) { + selectedScopes[metric] = 'accelerator' + } else if (availableScopes.includes('core')) { + selectedScopes[metric] = 'core' + } else if (availableScopes.includes('socket')) { + selectedScopes[metric] = 'socket' + } else { + selectedScopes[metric] = 'node' + } + } else { + selectedScopes[metric] = maxScope(availableScopes) + } + sorting[metric] = { min: { dir: 'up', active: false }, avg: { dir: 'up', active: false }, @@ -84,8 +88,7 @@ {metric}