From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: e63b27eb52,f19613495899e6db X-Google-Attributes: gide63b27eb52,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!y21g2000yqn.googlegroups.com!not-for-mail From: Leo Newsgroups: comp.sys.hp.hpux,comp.unix.aix,comp.unix.tru64 Subject: Re: Determine number of CPUs Date: Wed, 14 Oct 2009 06:44:52 -0700 (PDT) Organization: http://groups.google.com Message-ID: <402175f9-1707-4871-b076-9371fc977ee9@y21g2000yqn.googlegroups.com> References: <4ad5a2ed@212.67.96.135> NNTP-Posting-Host: 198.240.128.75 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1255527893 22901 127.0.0.1 (14 Oct 2009 13:44:53 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 14 Oct 2009 13:44:53 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y21g2000yqn.googlegroups.com; posting-host=198.240.128.75; posting-account=j41nSgoAAABbik-_CBR8CUnhIs-JUNmo User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/4.0.206.1 Safari/532.0,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.sys.hp.hpux:1311 comp.unix.aix:3671 comp.unix.tru64:111 Hi, You can use "prtconf | grep Processors" which will display the number of processors. you can use "lsdev -Cc processor" which will display all the processors and id's. you can count the number of lines which gives the total number of processors by the command "lsdev -Cc processor | wc - l" And you can use "bindprocessor -q" which shows the number of cores. all the above commands can be used by a basic user. hope it helps -LeO On Oct 14, 11:07=A0am, Dave wrote: > 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). =A0Perhaps 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... > > 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' =A0take 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.