08-28-2011 10:29 PM
I could see similar posts on this forum, but I could not find required information. I am interested in finding the number of cores per physical processor (need not to consider hyperthreading) across all 11.23 and 11.31 HP-UX machines. We are using Perl scripts to discover this information and hence it would be really helpful if I can find CLI's or Perl/shell scripts. I assume "ioscan -fk | grep processor" would give the available physical core count on the host. Please correct me if my assumption is incorrect.
To find find core density, I need to get available physical processor count on the host(along with core count). But, I could not find any CLI or script to get this information on all 11.23 and 11.31 hosts. I have tried "machinfo" which would give cores per socket in CPU info: section. But on some of the 11.23 hosts, "machinfo" is not available and on some other hosts getting some exception(failed to retrieve CPU info) while invoking "machinfo".
08-28-2011 10:41 PM
(The correct boards are under HP-UX. I asked the moderators to move this topic.)
>I am interested in finding the number of cores per physical processor (need not to consider hyperthreading)
Then the answer is always 1. Each core is a processor.
Now if you are talking about cores per socket, then it depends on the CPU model.
>I assume "ioscan -fk | grep processor"
You can use -C to speed this up.
>But on some of the 11.23 hosts, "machinfo" is not available
Only if the sysadmin removed it.
08-29-2011 04:48 AM
>>Only if the sysadmin removed it.
Or, it's a PA-RISC sysem...
Senior UNIX Admin
O'Leary Computers Inc
08-29-2011 05:29 AM
I've recently tried going through this exercise myself. To quote a disgraced former president, "I feel your pain".
As you've found, machinfo only works on ia64 systems. PA-Risc systems seem to be a bit harder to find this ifo.
A healthy bit of research indicated that *all* rp3440 and rp4440s were dual core. Another possibility that I haven't explored too far:
# echo "sc product cpu;il" | cstm > /tmp/cstm.out
# grep "CPU Number" /tmp/cstm.out
CPU Number: 0 CPU Slot Number 0
CPU Number: 1 CPU Slot Number 0
CPU Number: 2 CPU Slot number 1
CPU Number: 3 CPU Slot number 1
To me, that indicates dual core cpus; however, I haven't had a chance to independently verify that in any way.
Hope that helps.
Senior UNIX Admin
O'Leary Computers Inc
08-29-2011 10:39 AM
> machinfo only works on ia64 systems.
machinfo also works on any 11.31 system.
Also, note that that the only processor that can run HP-UX that has more than two cores per socket is the Tukwila (Itanium 9300 series) and is currently running on the i2 series blades and the Superdome2. Anything would be single or dual core.
Not helping your original question I am sure. Another way to see total processors or cores is 'sar -M'.
08-29-2011 10:41 PM
Thanks Doug and Bob. But still, I am unable resolve the issue.
sar: Can't open /var/adm/sa/sa30
#echo "sc product cpu;il" | cstm > /tmp/cstm.out
This also fails on few IA hosts with error
cstm>sc product cpu;il
^-- (InfoLog) is currently disabled. --
I cannot make any assumption that InfoLog would be enabled on the host where my script get executed.
Somehow I could manage to get this information on all other plaforms except HP-UX.
08-30-2011 05:52 AM
Sorry...should have been more specific. Run 'sar -M 1 1' (sar expects interval and time delay options as its a metrics/performance tool. For example, the following is showing 8 processors:
HP-UX rx7640a B.11.31 U ia64 08/30/11 08:53:40 cpu %usr %sys %wio %idle 08:53:41 0 0 0 0 100 1 0 0 0 100 2 0 1 1 98 3 0 0 0 100 4 0 0 0 100 5 0 0 0 99 6 0 0 0 100 7 0 0 0 100 system 0 0 0 100
09-05-2011 11:41 PM
Looks like 'sar -M 1 1' lists available core information. I am using ioscan to get this information.
Now I need to know either phycical processor/socket count or core density.
09-30-2012 03:50 AM
Under HP-UX 11i v3 (and maybe 2) the mpctl() function call has the MPC_GETNUMCORES_SYS, MPC_GETNUMSPUS_SYS, and the MPC_GETNUMSOCKETS_SYS operation.
The first gets the number of logical cores, which is twice the number of physical cores on Itanium systems with Intel Hyper-Thread Technology turned on; the second gets the number of physical processor cores; and the third one returns the number of sockets.
Only GETNUMSPUS is supported on 11i v1, not GETNUMSOCKETS, but only the PA-8800 and PA-8900 processors were dual-core, so if you can identify that you're on a PA-RISC system and running either one of those two processors, you'll know that your number of sockets is half the return value of mpctl(MPC_GETNUMSPUS_SYS, 0, 0). The good news is that there will never be a new PA-RISC processor so you can just do a case statement and forget it.
The cstm "sc product cpu; il" command will eventually show the following: "PA 8500-8500 CPU 2.1" (from my B1000 workstation), but I'm not sure yet how to do that in C - I suspect it has something to do with probing IO modules since that's the section where the processor info appears.
Here's the 11i v3 man page for mpctl(), which I've attached in case the link goes dead in a few years: