Hi, how can i find out the count of cpu ? I write a perl-script but i have only single-CPU-machines and cannot test this. -- Mit freundlichen Grüßen / With kind regards S + P LION AG Dipl.-Ing. Andreas Christ Leiter Infrastruktur ====================================================== Email: mailto:andreas.christ@sp-lion.com S+P LION AG WWW : http://www.sp-lion.de Robert-Bosch-Strasse 9 Voice: ++49-6203-794-110 D-68542 Heddesheim Fax : ++49-6203-794-444 Germany Anfahrt: http://www.sp-lion.com/karte.html ======================================================
On Wednesday 30 June 2004 14.40, Andreas Christ wrote:
how can i find out the count of cpu ? I write a perl-script but i have only single-CPU-machines and cannot test this.
grep -c ^processor /proc/cpuinfo perhaps? No idea how cpuinfo looks on other archs though #include <unistd.h> #include <stdio.h> int main(int argc, char *argv[]){ int nr; nr = sysconf(_SC_NPROCESSORS_CONF); printf("Number of processors is %d\n", nr); return 0; } also works.
participants (2)
-
Anders Johansson
-
Andreas Christ