mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-11-10 08:57:25 +01:00
fix: core/accelerator scope in statstable on load
This commit is contained in:
parent
38f58047f2
commit
8a473de793
@ -33,6 +33,8 @@
|
||||
export let authlevel;
|
||||
export let roles;
|
||||
|
||||
const accMetrics = ['acc_utilization', 'acc_mem_used', 'acc_power', 'nv_mem_util', 'nv_sm_clock', 'nv_temp'];
|
||||
|
||||
const { query: initq } = init(`
|
||||
job(id: "${dbid}") {
|
||||
id, jobId, user, project, cluster, startTime,
|
||||
@ -76,7 +78,6 @@
|
||||
]);
|
||||
|
||||
// Select default Scopes to load: Check before if accelerator metrics are not on accelerator scope by default
|
||||
const accMetrics = ['acc_utilization', 'acc_mem_used', 'acc_power', 'nv_mem_util', 'nv_sm_clock', 'nv_temp']
|
||||
const accNodeOnly = [...toFetch].some(function(m) {
|
||||
if (accMetrics.includes(m)) {
|
||||
const mc = metrics(job.cluster, m)
|
||||
@ -396,6 +397,7 @@
|
||||
bind:this={statsTable}
|
||||
job={$initq.data.job}
|
||||
jobMetrics={$jobMetrics.data.jobMetrics}
|
||||
accMetrics={accMetrics}
|
||||
/>
|
||||
{/key}
|
||||
{/if}
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
export let job
|
||||
export let jobMetrics
|
||||
export let accMetrics
|
||||
|
||||
const allMetrics = [...new Set(jobMetrics.map(m => m.name))].sort(),
|
||||
scopesForMetric = (metric) => jobMetrics
|
||||
@ -21,7 +22,9 @@
|
||||
|| getContext('cc-config')['job_view_nodestats_selectedMetrics']
|
||||
|
||||
for (let metric of allMetrics) {
|
||||
selectedScopes[metric] = maxScope(scopesForMetric(metric))
|
||||
selectedScopes[metric] = (job.exclusive != 1 || job.numNodes == 1) ?
|
||||
(job.numAccs != 0 && accMetrics.includes(metric)) ? 'accelerator' : 'core'
|
||||
: maxScope(scopesForMetric(metric))
|
||||
sorting[metric] = {
|
||||
min: { dir: 'up', active: false },
|
||||
avg: { dir: 'up', active: false },
|
||||
|
Loading…
Reference in New Issue
Block a user