From 65cebf6fde72dd1a8235d892654c964c30a8fffc Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Thu, 1 Jun 2023 15:26:53 +0200 Subject: [PATCH] Add fix for broken ids in job archives --- pkg/schema/cluster.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/schema/cluster.go b/pkg/schema/cluster.go index 0724ada..bc7a86a 100644 --- a/pkg/schema/cluster.go +++ b/pkg/schema/cluster.go @@ -162,10 +162,13 @@ func (topo *Topology) GetMemoryDomainsFromHWThreads( // Temporary fix to convert back from int id to string id for accelerators func (topo *Topology) GetAcceleratorID(id int) (string, error) { - if id < len(topo.Accelerators) { + if id < 0 { + fmt.Printf("ID smaller than 0!\n") + return topo.Accelerators[0].ID, nil + } else if id < len(topo.Accelerators) { return topo.Accelerators[id].ID, nil } else { - return "", fmt.Errorf("Index %d out of range", id) + return "", fmt.Errorf("index %d out of range", id) } }