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-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Michael Kraemer Newsgroups: comp.sys.hp.hpux,comp.unix.aix,comp.unix.tru64 Subject: Re: Determine number of CPUs Date: Fri, 16 Oct 2009 08:14:56 +0200 Organization: T-Online Message-ID: References: <4ad5a2ed@212.67.96.135> <402175f9-1707-4871-b076-9371fc977ee9@y21g2000yqn.googlegroups.com> <4ad7a761@212.67.96.135> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.t-online.com 1255673697 03 n29776 pQTbpDTJfu6D+kk 091016 06:14:57 X-Complaints-To: usenet-abuse@t-online.de X-ID: r6yrBGZrQenZJiZaFjggkgwCwycBtTYT4gTuh4qG-m5EnqHyW3aBQT User-Agent: Mozilla/5.0 (OS/2; U; Warp 4.5; de-DE; rv:1.3) Gecko/20030616 X-Accept-Language: en-us, en In-Reply-To: <4ad7a761@212.67.96.135> Xref: g2news2.google.com comp.sys.hp.hpux:1326 comp.unix.aix:3684 comp.unix.tru64:120 Dave schrieb: > Leo wrote: > >> 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 > > > Thank you for the help on AIX. Would I be right in assuming this box has > a pair of dual core processors? > > $ lsdev -Cc processor > proc0 Available 00-00 Processor > proc2 Available 00-02 Processor > $ bindprocessor -q > The available processors are: 0 1 2 3 > $ prtconf | grep Processors > Number Of Processors: 2 > > Do you know if the format of the output has been stable over the various > AIX releases, so it can be parsed and used in scripts which will work on > most AIX releases? Well, almost, but not quite. Releases earlier than 4.3 apparently lack the latter two commands, but I presume those are not your targets anyway. The proc0/1 naming scheme seems to depend on whether one has a true single processor system or a crippled dual-core one (the IntelliStation example below). On Power5 and above, with AIX 5.3 and above, SMT might be enabled, which gives twice as many "threads" than you have cores, but it's not clear whether this is an advantage for your app. So the pragmatic approach might be to assume single core for everything below AIX 5.1 (4.3?) and go with prtconf for the CPU count. Here's a collection what I get on some of my systems: AIX 5.1, 43P-240: $ lsdev -Cc processor; bindprocessor -q; prtconf | grep Processors proc0 Available 00-00 Processor proc1 Available 00-01 Processor The available processors are: 0 1 Number Of Processors: 2 AIX 4.2, 25T $ lsdev -Cc processor; bindprocessor -q; prtconf | grep Processors proc0 Available 00-00 Processor ksh: bindprocessor: not found. ksh: prtconf: not found. AIX 5.2, IntelliStation 275 $ lsdev -Cc processor; bindprocessor -q; prtconf | grep Processors proc1 Available 00-01 Processor The available processors are: 0 Number Of Processors: 1 AIX 5.2, p510 $ lsdev -Cc processor; bindprocessor -q; prtconf | grep Processors proc0 Available 00-00 Processor proc2 Available 00-02 Processor The available processors are: 0 1 Number Of Processors: 2 AIX 5.3, p505Q, SMT enabled $ lsdev -Cc processor; bindprocessor -q; prtconf | grep Processors proc0 Available 00-00 Processor proc2 Available 00-02 Processor proc4 Available 00-04 Processor proc6 Available 00-06 Processor The available processors are: 0 1 2 3 4 5 6 7 /usr/sbin/prtconf[156]: /usr/lib/boot/bin/dmpdt_chrp: cannot execute Number Of Processors: 4 AIX 6.1, power 520, SMT enabled $ lsdev -Cc processor; bindprocessor -q; prtconf | grep Processors proc0 Available 00-00 Processor proc2 Available 00-02 Processor proc4 Available 00-04 Processor proc6 Available 00-06 Processor The available processors are: 0 1 2 3 4 5 6 7 Number Of Processors: 4