Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: Dave <foo@coo.com>
Subject: Determine number of CPUs
Date: Wed, 14 Oct 2009 11:07:41 +0100	[thread overview]
Message-ID: <4ad5a2ed@212.67.96.135> (raw)

Does anyone know the best way to determine the number of CPUs on AIX, 
HP-UX? (I'll extend the code to test on Tru64 and IRIX if anyone wants 
to give me the info, but that is hardly high on the priority list).

The constraints are

1) It can be done from the shell.
2) It must not require root privileges
3) It gives the number of physical CPUs, rather than cores.

Finding the number of cores, and/or hardware threads would be a nice 
addition, but I'm trying to improve an autoconf macro

http://www.nongnu.org/autoconf-archive/ax_count_cpus.html

which has a description of "Attempt to count the number of processors 
present on the machine."

In practice, I suspect the number of cores would be a more useful value 
to have, but for now at least, I'll use physical processors, as that is 
what the macro implies it does. (It was undoubtedly written without 
multi-core CPUs in mind).  Perhaps I'll write another macros called 
AX_COUNT_CORES and AX_COUNT_THREADS, but for now, I just want to fix the 
above macro which is broken.

I've seen various methods on the web, but many simply do not work on the
hardware I've tried them on.

http://unix.ittoolbox.com/groups/technical-functional/hp-ux-l/command-to-determine-how-many-cpus-187381

says of HP to try

/opt/ignite/bin/print_manifest | pg

well, it does not work on my HP-UX box.

I've seen some suggestions for AIX which involve greping syslog. But one 
can hardly guarantee that the admin has not disabled that.

I'm perhaps looking for the impossible, but something which will always 
work, like:

$ psrinfo -p
2

does on Solaris.

-- 
I respectfully request that this message is not archived by companies as
unscrupulous as 'Experts Exchange' . In case you are unaware,
'Experts Exchange'  take questions posted on the web and try to find
idiots stupid enough to pay for the answers, which were posted freely
by others. They are leeches.


             reply	other threads:[~2009-10-14 10:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-14 10:07 Dave [this message]
2009-10-14 13:44 ` Determine number of CPUs Leo
2009-10-15 22:51   ` Dave
2009-10-16  6:14     ` Michael Kraemer
2009-10-14 15:57 ` Don Morris
2009-10-14 18:52 ` Rick Jones
2009-10-15 13:59 ` sjm
2009-10-15 18:00   ` Dave
2009-10-15 19:49     ` Henry
2009-10-19 22:18     ` John F. Carr
2009-10-20 12:16       ` Dave
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox