Skip to content
Prev 155520 / 398502 Next

Information on the number of CPU's

On Tue, 9 Sep 2008, tolga.i.uzuner at jpmorgan.com wrote:

            
Correct, since

a) R does not make use of more than 1.

b) It is really not portable, and not even well-defined.  (How many CPUs 
has a hyperthreaded dual Xeon?  Some say 2, some say 4.  Do you want 
CPUs or cores?  If this is a virtualized OS, is the physical number or the 
logical number?)

In the case of Windows, how depends on the Windows version.  The w32api 
(XP or later) call GetNativeSystemInfo will tell you the number of CPUs, 
for some (unstated) definition of 'CPU'.  Later versions have 
GetLogicalProcessorInformation, which can give the number of cores.