Detect number of cpus
Michael Goffioul
michael.goffioul at gmail.com
Wed Jan 23 13:05:13 CST 2008
On 1/23/08, Fredrik Lingvall <fl at ifi.uio.no> wrote:
> On a Linux box one can do, for example,
>
> [dummy,tmp_str]= system('cat /proc/cpuinfo | grep model | grep name');
> n_cpus = size(strfind(tmp_str,'model'),2);
>
> to detect the number of CPUs/Cores on the system. Is is possible to do
> something similar on Windows?
You can find CPU information in the registry:
HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\X
where 'X' is the processor number. The Windows package from octave-forge
provides functions to accessthe registry.
Michael.
More information about the Help-octave
mailing list