country
hp home hp products & services support solutions how to buy
spacer
HP - Invent
corner IT resource center corner
go search
go online help
go contact hp
go IT resource center home
go my profile
go login
go maintenance and support
go training and education
go planning, design, and implementation
forums
corner corner

go register now!
corner corner
online multimedia presentations:

  • crisis management team performance troubleshooting - Ken Johnson

    For more information, go to hp experts present within planning, design, and implementation of the IT resource center.
  • corner corner
    corner corner
    hp engineer HP engineer
    expert expert in this area
    user status
    ITRC Pro ITRC Pro
    250 points
    ITRC Graduate ITRC Graduate
    500 points
    ITRC Wizard ITRC Wizard
    1000 points
    ITRC Royalty ITRC Royalty
    2500 points
    go how to earn points
    question status
    Magical Answer Magical Answer
    Message with a response that solved the author's question
    corner corner
    spacer
     
    Assign a process to a processor
    forums > hp-ux > workload/resource management > Assign a process to a processor
    receive e-mail notification if a new reply is posted reply to this message post new message
    author subject: Assign a process to a processor
    Matteo Pignoni


    June 07, 2001 20:27 PM GMT

    Hi!
    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.
    Note: If you are the author of this question and wish to assign points to any of the answers, please login first. Click here for more information on assigning points.

    Sort Answers By: Date or Points
    James R. Ferguson

    This user has accumulated 2500 or more points 
    June 07, 2001 20:32 PM GMT   [ 10 pts ]

    Hi:

    Take 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...
    Patrick Wallek

    This user has accumulated 2500 or more points 
    June 07, 2001 21:06 PM GMT   [ unassigned ]

    Here's some more information on PRM. This includes pricing info.

    http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=B3835CA
    Bill McNAMARA

    This user has accumulated 1000 or more points 
    June 08, 2001 13:15 PM GMT   [ unassigned ]

    This one is free.. instructions below

    Later,
    Bill


    =======================================================================
    Program to set processor affinity: (setproc.c)
    -------------------------------------------------------------------------

    #include <stdio.h>
    #include <sys/types.h>
    #include <sys/syscall.h>
    #include <sys/mp.h>
    #include <grp.h>

    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 <pid>

    to force to process <pid> to processor 0, or use

    setproc 1 <pid>

    to force process <pid> to processor 1, etc.


    John Bolene

    This user has accumulated 500 or more points 
    June 08, 2001 15:05 PM GMT   [ unassigned ]

    As Bill wisely said, you can dedicate a process to a processor, but you must have access to the source code and be able to compile it.

    PRM is the only way that I know how to do it if you only have an executable binary file.
    hp engineer  Carsten Krege expert in this area 

    This user has accumulated 500 or more points 
    June 08, 2001 16:32 PM GMT   [ unassigned ]

    With PRM you CANNOT force a process to run on a specific CPU. PRM can be used to ensure that a process (specifically a PRM group consisting of one ore more processes) cannot use more than a specific percentage of the total CPU resource (in times of high workload). The processes are not forced to run on a specific CPU though. THis would break many programs.

    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
    John Bolene

    This user has accumulated 500 or more points 
    June 08, 2001 19:14 PM GMT   [ unassigned ]

    Darn, every once in awhile you make a mistake.
    Looks like this is my day.
    I'll go to the doghouse for the rest of the day.
    corner corner
    · Visit Customer Care for Pavilion questions.
    · Software Call Manager
    · Technical Knowledge Base
    corner corner
    printing instructions
    go printing instructions
    Privacy Statement Legal Notices © 1994-2000 Hewlett-Packard Company