1834625 Members
3402 Online
110069 Solutions
New Discussion

HP-UX 11.0 CPU

 
David Ryan_3
Occasional Advisor

HP-UX 11.0 CPU

How can I fix a process to a single CPU in a mutli processor environment?
6 REPLIES 6
Luk Vandenbussche
Honored Contributor

Re: HP-UX 11.0 CPU

Hi,

Under HPUX 11.00 this is only possible with PRM (not for free)

Under hpux 11i, you can do this with PSET

http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=PSETS
Victor BERRIDGE
Honored Contributor

Re: HP-UX 11.0 CPU

Hi David,

set_cpu PID CPU-ID

Still looking for the source... (compiled hpux11.11 but just tested on 11.00 and it works...)


All the best
Victor
David Ryan_3
Occasional Advisor

Re: HP-UX 11.0 CPU

Hi,

Victor CPU_ID it that the number displayed in 'top'?
Victor BERRIDGE
Honored Contributor

Re: HP-UX 11.0 CPU

Yes David...

Still looking for the source code, I wonder if it were not procura the author...


e.g.
Cpu states:
CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0 0.00 0.0% 0.0% 0.2% 99.8% 0.0% 0.0% 0.0% 0.0%
1 0.02 0.2% 0.0% 0.2% 99.6% 0.0% 0.0% 0.0% 0.0%
--- ---- ----- ----- ----- ----- ----- ----- ----- -----
avg 0.01 0.0% 0.0% 0.2% 99.8% 0.0% 0.0% 0.0% 0.0%

Memory: 144296K (91020K) real, 151728K (105580K) virtual, 1046840K free Page# 1/8

CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
1 ? 3376 patrol 154 30 48064K 44356K sleep 5416:45 2.45 2.45 PatrolAgent

$ /sm/bin/set_cpu 3376 0
Fri Dec 9 15:45:24 2005
Load averages: 0.03, 0.03, 0.04
127 processes: 124 sleeping, 3 running
Cpu states:
CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0 0.00 0.0% 1.8% 0.6% 97.6% 0.0% 0.0% 0.0% 0.0%
1 0.05 0.0% 0.0% 0.2% 99.8% 0.0% 0.0% 0.0% 0.0%
--- ---- ----- ----- ----- ----- ----- ----- ----- -----
avg 0.03 0.0% 0.8% 0.4% 98.8% 0.0% 0.0% 0.0% 0.0%

Memory: 144296K (92756K) real, 151728K (107836K) virtual, 1046840K free Page# 1/8

CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
0 ? 3376 patrol 154 30 48064K 44356K sleep 5416:50 4.80 4.79 PatrolAgent


All the best
Victor
Victor BERRIDGE
Honored Contributor

Re: HP-UX 11.0 CPU

Hi again David,
The output you just saw in my previous reply comes from a K360 - it is the only multiprocessor box I have running HPUX11.00, the program was compiled on a RP5450 with HPUX11.11...


All the best
Victor
Laurent Menase
Honored Contributor

Re: HP-UX 11.0 CPU

#include

main(c,v)
int c;
char **v;
{
mpctl( MPC_SETPROCESS,atoi(v[1]),atoi(v[2]));
}

./a.out