Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: Michael Kraemer <M.Kraemer@gsi.de>
Subject: Re: Determine number of CPUs
Date: Fri, 16 Oct 2009 08:14:56 +0200	[thread overview]
Message-ID: <hb9311$t2g$03$2@news.t-online.com> (raw)
In-Reply-To: <4ad7a761@212.67.96.135>

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



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

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-14 10:07 Determine number of CPUs Dave
2009-10-14 13:44 ` Leo
2009-10-15 22:51   ` Dave
2009-10-16  6:14     ` Michael Kraemer [this message]
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