Skip to content

Commit

Permalink
check if the numacoresiblings map cotains appropriate cpu core key
Browse files Browse the repository at this point in the history
Signed-off-by: Niranjan M.R <mrniranjan@redhat.com>
  • Loading branch information
Niranjan M.R committed May 25, 2023
1 parent d332711 commit aa1b504
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/e2e/performanceprofile/functests/utils/nodes/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,14 +445,19 @@ func GetByCpuCapacity(nodesList []corev1.Node, cpuQty int) []corev1.Node {
// Also updates the map by deleting the cpu siblings returned
func GetCpuSiblings(numaCoreSiblings map[int]map[int][]int, coreKey int) []string {
var cpuSiblings []string
var numanode int
// key here is Numa node id
for key := range numaCoreSiblings {
for _, sibling := range numaCoreSiblings[key][coreKey] {
cpuSiblings = append(cpuSiblings, strconv.Itoa(sibling))
numanode = key
_, ok := numaCoreSiblings[key][coreKey]
// if coreId exists
if ok {
for _, sibling := range numaCoreSiblings[key][coreKey] {
cpuSiblings = append(cpuSiblings, strconv.Itoa(sibling))
}
// Delete the cpusiblings of that particular coreid
// map is now updated with used cores
delete(numaCoreSiblings[key], coreKey)
}
}
delete(numaCoreSiblings[numanode], coreKey)
return cpuSiblings
}

Expand Down

0 comments on commit aa1b504

Please sign in to comment.