- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Assign a process to a processor
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
Discussions
Discussions
Forums
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
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
тАО06-07-2001 12:27 PM
тАО06-07-2001 12:27 PM
Is it possible to assign a process to a processor?
For example if I have a server with 4 processor, can I decide to execute a process only in the CPU #3 ?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2001 12:32 PM
тАО06-07-2001 12:32 PM
SolutionTake a look at PRM (Process Resource Manager) for this. Here's a link to the guide:
http://docs.hp.com/hpux/onlinedocs/B8733-90005/B8733-90005.html
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2001 01:06 PM
тАО06-07-2001 01:06 PM
Re: Assign a process to a processor
http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=B3835CA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2001 05:15 AM
тАО06-08-2001 05:15 AM
Re: Assign a process to a processor
Later,
Bill
=======================================================================
Program to set processor affinity: (setproc.c)
-------------------------------------------------------------------------
#include
#include
#include
#include
#include
main(argc,argv)
int argc;
char *argv[];
{
gid_t sgid;
int i;
int pid;
if (argc < 2) {
printf("Usage: setproc spunum pid0 [pid1 ... pidn]\n");
exit(1);
}
sgid = atoi (argv[1]);
i = argc;
printf("Attempting to set process affinity for processor %d\n",
sgid);
while (i-- >2) {
pid = atoi(argv[i]);
if ((sgid = SETPROCESS(sgid, pid)) < 0)
perror("setprocess failed");
printf ("processor %d pid = %d\n", sgid, pid);
}
}
-------------------------------------------------------------------------
Compile the above program with
cc -o setproc setproc.c
The following shell script can be used to test that processor affinity
is working correctly:
--------------------------------------------------------------------
#!/bin/ksh
echo process id = $$
i=1
while [ "$i" -lt 10000 ]
do
echo " $i\r\c"
i=`expr $i + 1`
sleep 1
done
--------------------------------------------------------------------
You can start an instance of this script and use the setproc program on a
dual processor system to switch processes between processors. You should
run this on a seperate terminal since it will send the count to the
terminal every second.
You can then use the setproc program to move the process between
processors.
Usage:
setproc 0
to force to process
setproc 1
to force process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2001 07:05 AM
тАО06-08-2001 07:05 AM
Re: Assign a process to a processor
PRM is the only way that I know how to do it if you only have an executable binary file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2001 08:32 AM
тАО06-08-2001 08:32 AM
Re: Assign a process to a processor
This can only be achieved with a program like Bill uses and which can force any PID to run on one specific CPU (ie you don't need the programs source), done by SETPROCESS which is a mpctl() system call.
Carsten
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2001 11:14 AM
тАО06-08-2001 11:14 AM
Re: Assign a process to a processor
Looks like this is my day.
I'll go to the doghouse for the rest of the day.