From 798aad8af8ceb157018788b83fc24e4d5398e711 Mon Sep 17 00:00:00 2001 From: Assaf Giladi Date: Mon, 11 Nov 2024 11:18:23 +0200 Subject: [PATCH] fix: get core ids for multiple numas --- bash_functions/get_bash_function.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bash_functions/get_bash_function.go b/bash_functions/get_bash_function.go index ae01ee8..29d8346 100644 --- a/bash_functions/get_bash_function.go +++ b/bash_functions/get_bash_function.go @@ -48,10 +48,9 @@ func GetCoreIds() string { get_core_ids() { core_idx_end=$(($core_idx_begin + $1)) if [[ ${numa_num} > 1 ]]; then - index=$((i%2)) + index=$((core_idx_begin%2)) core_ids=(${numa[$index]}) - index_in_numa=$((core_idx_begin/2)) - res=${core_ids["$index_in_numa"]} + res=${core_ids[$((core_idx_begin/2))]} for (( i=$(($core_idx_begin+1)); i<$core_idx_end; i++ )); do index=$(($i%2)) core_ids=(${numa[$index]})