- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to determine the number of processors?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2000 12:50 AM
11-30-2000 12:50 AM
How to determine the number of processors?
CPU count is useful info when implementing optimal threading algorithms.
On Solaris it the info is available through sysconf(), but apparently not on HP-UX 11.00.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2000 12:58 AM
11-30-2000 12:58 AM
Re: How to determine the number of processors?
#include
main () {
struct pst_dynamic psd;
pstat_getdynamic(&psd, sizeof(struct pst_dynamic), 1, 0);
printf("Number of Active Processors: %d\n", psd.psd_proc_cnt);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2000 01:02 AM
11-30-2000 01:02 AM
Re: How to determine the number of processors?
echo "processor_count/D" | adb -k /stand/vmunix /dev/mem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2000 01:05 AM
11-30-2000 01:05 AM
Re: How to determine the number of processors?
Besides the programmatical way, there is another possibility, via the command line; as root, issue the following command:
echo 'processor_count/D' | adb -k /stand/vmunix /dev/kmem | tail -1 | awk '{print $2}'
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2000 01:07 AM
11-30-2000 01:07 AM
Re: How to determine the number of processors?
#ioscan -fnkCprocessor | grep processor | wc -l
Also the top command could help you. type:
#top
and you will see the Cpu states with their number
Federico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2000 04:35 AM
11-30-2000 04:35 AM
Re: How to determine the number of processors?
cat /var/adm/syslog/syslog.log|grep processor
or
cat /var/adm/syslog/syslog.log|grep processor|wc -l
or
dmesg|pg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2000 07:23 AM
11-30-2000 07:23 AM
Re: How to determine the number of processors?
sar -M 1 1| tail +6|wc -l
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2000 07:52 AM
11-30-2000 07:52 AM
Re: How to determine the number of processors?
vi /var/tombstones/ts99 and look for the PA's. You will also see the firmware and others under the Revision table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2000 01:52 AM
12-01-2000 01:52 AM
Re: How to determine the number of processors?
You can try this command:
ioscan -k | grep proc
Jiri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2000 03:12 AM
12-01-2000 03:12 AM
Re: How to determine the number of processors?
I wanted to do this programmatically, so the C code answer was what I was looking for. Should have given it 10 points, 6 was by accident.
Interactive answers were also useful, so I gave some points for those, more to those were you don't have to be root.
Some suggestions gave bogus answers, like 32 processors, (I wish).