Skip to content

Commit fd72815

Browse files
authoredMar 22, 2023
rework processor/core id assignment
1 parent 88e0084 commit fd72815

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎helper_functions.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -821,10 +821,10 @@ void construct_CPU_Hierarchy_info(struct cpu_hierarchy_info* chi)
821821
}
822822
for (i = 0; i < ncpu; i++) {
823823
processor_num = i;
824-
if ((coreid_num + 1) == threads)
824+
if ((coreid_num + 1) == cores)
825825
physicalid_num++;
826826
physicalid_num %= packages;
827-
coreid_num = processor_num % cores;
827+
coreid_num = (processor_num / threads) % cores;
828828

829829
chi->processor_num[i] = processor_num;
830830
chi->package_num[i] = physicalid_num;

0 commit comments

Comments
 (0)
Please sign in to comment.