<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Assign a process to a processor in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538032#M915499</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Take a look at PRM (Process Resource Manager) for this.  Here's a link to the guide:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/hpux/onlinedocs/B8733-90005/B8733-90005.html" target="_blank"&gt;http://docs.hp.com/hpux/onlinedocs/B8733-90005/B8733-90005.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Thu, 07 Jun 2001 19:32:36 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2001-06-07T19:32:36Z</dc:date>
    <item>
      <title>Assign a process to a processor</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538031#M915498</link>
      <description>Hi!&lt;BR /&gt;Is it possible to assign a process to a processor?&lt;BR /&gt;For example if I have a server with 4 processor, can I decide to execute a process only in the CPU #3 ?&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 07 Jun 2001 19:27:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538031#M915498</guid>
      <dc:creator>Matteo Pignoni</dc:creator>
      <dc:date>2001-06-07T19:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a process to a processor</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538032#M915499</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Take a look at PRM (Process Resource Manager) for this.  Here's a link to the guide:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/hpux/onlinedocs/B8733-90005/B8733-90005.html" target="_blank"&gt;http://docs.hp.com/hpux/onlinedocs/B8733-90005/B8733-90005.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 07 Jun 2001 19:32:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538032#M915499</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-06-07T19:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a process to a processor</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538033#M915500</link>
      <description>Here's some more information on PRM.  This includes pricing info.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=B3835CA" target="_blank"&gt;http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=B3835CA&lt;/A&gt;</description>
      <pubDate>Thu, 07 Jun 2001 20:06:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538033#M915500</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-06-07T20:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a process to a processor</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538034#M915501</link>
      <description>This one is free.. instructions below&lt;BR /&gt;&lt;BR /&gt;Later,&lt;BR /&gt;Bill&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;=======================================================================&lt;BR /&gt;Program to set processor affinity: (setproc.c)&lt;BR /&gt;-------------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;GRP.H&gt;&lt;BR /&gt;&lt;BR /&gt;main(argc,argv)&lt;BR /&gt;int     argc;&lt;BR /&gt;char    *argv[];&lt;BR /&gt;{&lt;BR /&gt;       gid_t   sgid;&lt;BR /&gt;       int i;&lt;BR /&gt;       int pid;&lt;BR /&gt;&lt;BR /&gt;       if (argc &amp;lt; 2) {&lt;BR /&gt;               printf("Usage: setproc spunum pid0 [pid1 ... pidn]\n");&lt;BR /&gt;               exit(1);&lt;BR /&gt;       }&lt;BR /&gt;       sgid = atoi (argv[1]);&lt;BR /&gt;       i = argc;&lt;BR /&gt;       printf("Attempting to set process affinity for processor %d\n",&lt;BR /&gt;sgid);&lt;BR /&gt;       while  (i-- &amp;gt;2) {&lt;BR /&gt;               pid = atoi(argv[i]);&lt;BR /&gt;               if ((sgid = SETPROCESS(sgid, pid)) &amp;lt; 0)&lt;BR /&gt;                       perror("setprocess failed");&lt;BR /&gt;               printf ("processor %d pid = %d\n", sgid, pid);&lt;BR /&gt;       }&lt;BR /&gt;}&lt;BR /&gt;-------------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Compile the above program with&lt;BR /&gt;&lt;BR /&gt;  cc -o setproc setproc.c&lt;BR /&gt;&lt;BR /&gt;The following shell script can be used to test that processor affinity&lt;BR /&gt;is working correctly:&lt;BR /&gt;--------------------------------------------------------------------&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;echo process id = $$&lt;BR /&gt;i=1&lt;BR /&gt;&lt;BR /&gt;while [ "$i" -lt 10000 ]&lt;BR /&gt;do&lt;BR /&gt;       echo " $i\r\c"&lt;BR /&gt;       i=`expr $i + 1`&lt;BR /&gt;       sleep 1&lt;BR /&gt;done&lt;BR /&gt;--------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;You can start an instance of this script and use the setproc  program on a&lt;BR /&gt;dual processor system to switch processes between   processors. You should&lt;BR /&gt;run this on a seperate terminal since it will  send the count to the&lt;BR /&gt;terminal every second.&lt;BR /&gt;&lt;BR /&gt;You can then use the setproc program to move the process between&lt;BR /&gt;processors.&lt;BR /&gt;&lt;BR /&gt;Usage:&lt;BR /&gt;&lt;BR /&gt;  setproc 0 &lt;PID&gt;&lt;BR /&gt;&lt;BR /&gt;to force to process &lt;PID&gt; to processor 0, or use&lt;BR /&gt;&lt;BR /&gt;  setproc 1 &lt;PID&gt;&lt;BR /&gt;&lt;BR /&gt;to force process &lt;PID&gt; to processor 1, etc.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PID&gt;&lt;/PID&gt;&lt;/PID&gt;&lt;/PID&gt;&lt;/GRP.H&gt;&lt;/SYS&gt;&lt;/SYS&gt;&lt;/SYS&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 08 Jun 2001 12:15:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538034#M915501</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2001-06-08T12:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a process to a processor</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538035#M915502</link>
      <description>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.&lt;BR /&gt;&lt;BR /&gt;PRM is the only way that I know how to do it if you only have an executable binary file.</description>
      <pubDate>Fri, 08 Jun 2001 14:05:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538035#M915502</guid>
      <dc:creator>John Bolene</dc:creator>
      <dc:date>2001-06-08T14:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a process to a processor</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538036#M915503</link>
      <description>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. &lt;BR /&gt;&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;Carsten</description>
      <pubDate>Fri, 08 Jun 2001 15:32:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538036#M915503</guid>
      <dc:creator>Carsten Krege</dc:creator>
      <dc:date>2001-06-08T15:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Assign a process to a processor</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538037#M915504</link>
      <description>Darn, every once in awhile you make a mistake.&lt;BR /&gt;Looks like this is my day.&lt;BR /&gt;I'll go to the doghouse for the rest of the day.</description>
      <pubDate>Fri, 08 Jun 2001 18:14:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/assign-a-process-to-a-processor/m-p/2538037#M915504</guid>
      <dc:creator>John Bolene</dc:creator>
      <dc:date>2001-06-08T18:14:51Z</dc:date>
    </item>
  </channel>
</rss>

