Skip to content
Prev 155521 / 398502 Next

Information on the number of CPU's

Many thanks, that's very helpful.
Regards,
Tolga


----- Original Message -----
From: Prof Brian Ripley [ripley at stats.ox.ac.uk]
Sent: 09/09/2008 20:57 CET
To: Tolga Uzuner
Cc: r-help at r-project.org
Subject: Re: [R] 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.