mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-25 12:59:06 +01:00
Merge pull request #183 from ClusterCockpit/180_fix_render_acc_nodescope
fix: check if acc metrics are acc scope by default
This commit is contained in:
commit
25f5a889d0
@ -48,7 +48,8 @@
|
|||||||
`);
|
`);
|
||||||
|
|
||||||
const ccconfig = getContext("cc-config"),
|
const ccconfig = getContext("cc-config"),
|
||||||
clusters = getContext("clusters");
|
clusters = getContext("clusters"),
|
||||||
|
metrics = getContext("metrics")
|
||||||
|
|
||||||
let isMetricsSelectionOpen = false,
|
let isMetricsSelectionOpen = false,
|
||||||
selectedMetrics = [],
|
selectedMetrics = [],
|
||||||
@ -74,16 +75,26 @@
|
|||||||
ccconfig[`job_view_nodestats_selectedMetrics`]),
|
ccconfig[`job_view_nodestats_selectedMetrics`]),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Select default Scopes to load
|
// Select default Scopes to load: Check before if accelerator metrics are not on accelerator scope by default
|
||||||
if (job.numAcc === 0) {
|
const accMetrics = ['acc_utilization', 'acc_mem_used', 'acc_power', 'nv_mem_util', 'nv_sm_clock', 'nv_temp']
|
||||||
// No Accels
|
const accNodeOnly = [...toFetch].some(function(m) {
|
||||||
|
if (accMetrics.includes(m)) {
|
||||||
|
const mc = metrics(job.cluster, m)
|
||||||
|
return mc.scope !== 'accelerator'
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (job.numAcc === 0 || accNodeOnly === true) {
|
||||||
|
// No Accels or Accels on Node Scope
|
||||||
startFetching(
|
startFetching(
|
||||||
job,
|
job,
|
||||||
[...toFetch],
|
[...toFetch],
|
||||||
job.numNodes > 2 ? ["node"] : ["node", "core"]
|
job.numNodes > 2 ? ["node"] : ["node", "core"]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Accels
|
// Accels and not on node scope
|
||||||
startFetching(
|
startFetching(
|
||||||
job,
|
job,
|
||||||
[...toFetch],
|
[...toFetch],
|
||||||
|
Loading…
Reference in New Issue
Block a user