Closed GoogleCodeExporter closed 9 years ago
Err, (nodes*cpus-per-package/cpus-per-node) was meant to read:
(nodes*cpus-per-package/nodes-per-package).
Original comment by kszy...@gmail.com
on 9 Apr 2011 at 11:46
Below is the code snippet I used with TPC 0.30 to perform the detection of
nodes_per_package:
/* discover number of nodes per processor */
Cpuid(0x1,&eax,&ebx,&ecx,&edx);
int model = (eax & 0xf0) >> 4;
int modelExtended = ((eax & 0xf0000) >> 12) + model;
int nodes_per_package = 1; /* default to 1 */
if (modelExtended >= 8) {
ret = ReadPciConfigDwordEx(MISC_CONTROL_3, 0xe8, &val);
if (ret == TRUE) {
if (val & (1 << 29)) {
nodes_per_package = 2;
}
} else {
printf ("error discovering nodes per package, results may be unreliable\n");
}
}
Original comment by kszy...@gmail.com
on 9 Apr 2011 at 11:49
I also checked values for F0x60 and F0x160 and they are (on a 48-core system):
F0x060: 0x000F0070
F0x160: 0x00010000
== they correspond to CpuCnt of 0x2Fh which translates to 48 on a revision D
processor.
So I guess total number of processors could also be retrieved directly
rather than derived from values of total_nodes, cpus_per_package and
nodes_per_package.
It seems answer to question posed in this comment:
/* TODO: bugbug, physical cores is per processor or it is per system?
I suppose that the physical cores variable
should contain the number of cores per-node (or per-processor) and
not the whole number of cores in the system.
is: "CpuCnt reflects total number of cores in the system."
Original comment by kszy...@gmail.com
on 10 Apr 2011 at 12:33
And just for the record -- CPUID 0x80000008 reflects total number of processors
in a package (regardless of number of nodes).
Original comment by kszy...@gmail.com
on 10 Apr 2011 at 12:38
Patch implementing "nodes per package" method attached and new output attached.
Original comment by kszy...@gmail.com
on 10 Apr 2011 at 12:59
Attachments:
diff source code has been merged!
Original comment by paolo.sa...@gmail.com
on 10 Apr 2011 at 4:10
Original issue reported on code.google.com by
kszy...@gmail.com
on 9 Apr 2011 at 11:41Attachments: