<?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: Process Binding to 0th processor ,mpctl(0 behaviour. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/process-binding-to-0th-processor-mpctl-0-behaviour/m-p/2721770#M948147</link>
    <description>First of all, I don't think this will answer your question really but may help....&lt;BR /&gt;&lt;BR /&gt;Looking at the patch, PHKL_25475, it does alter one object file the mpctl() call is in.....althought doesn't include the mpctl.o object itself.&lt;BR /&gt;&lt;BR /&gt;# grep -il mpctl /usr/conf/lib/*&lt;BR /&gt;/usr/conf/lib/libdebug.a&lt;BR /&gt;/usr/conf/lib/libpm.a&lt;BR /&gt;/usr/conf/lib/libscall.a&lt;BR /&gt;# nm /usr/conf/lib/libscall.a |grep mpctl&lt;BR /&gt;mpctl               |          |undef |code   |        &lt;BR /&gt;&lt;BR /&gt;Putting the full output to a file and you can see the object is init_sent.o, which is included in the patch. Your best bet is to find what patch it superseded and check the symptoms it fixes between the last software level.&lt;BR /&gt;&lt;BR /&gt;In terms of difference between versions, all I can show is this....&lt;BR /&gt;&lt;BR /&gt;HPUX 11.11&lt;BR /&gt;# ar -x /usr/conf/lib/libpm.a mpctl.o&lt;BR /&gt;# cksum mpctl.o&lt;BR /&gt;1283031925 18968 mpctl.o  &lt;BR /&gt;&lt;BR /&gt;HPUX 11.00&lt;BR /&gt;# ar -x /usr/conf/lib/libpm.a mpctl.o&lt;BR /&gt;# cksum mpctl.o&lt;BR /&gt;1333892570 51112 mpctl.o   &lt;BR /&gt;&lt;BR /&gt;I have had a look and cannot find anything that says you can't schedule processes on the monarch processor.&lt;BR /&gt;&lt;BR /&gt;Lastly, some code to schedule processes....&lt;BR /&gt;&lt;BR /&gt;/* This program takes two inputs...first parameter is the cpu number */&lt;BR /&gt; /* to run a system command on and the second is the actual command   */&lt;BR /&gt; /* enclosed in quotes as follows:                                    */&lt;BR /&gt; /* set_processor 2 'date'                                            */&lt;BR /&gt;&lt;BR /&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;SYS&gt;&lt;BR /&gt;&lt;BR /&gt; extern errno;&lt;BR /&gt; extern char*sys_errlist[];&lt;BR /&gt; extern int sys_nerr;&lt;BR /&gt;&lt;BR /&gt; int main(argc, argv)&lt;BR /&gt; int     argc;&lt;BR /&gt; char    *argv[];&lt;BR /&gt; {&lt;BR /&gt;     spu_t  req_cpu, chosen_cpu;&lt;BR /&gt;     pid_t  pid;&lt;BR /&gt;     if (argc &amp;lt; 3) {&lt;BR /&gt;            printf("setprocessor spunum command");&lt;BR /&gt;            exit(1);&lt;BR /&gt;            }&lt;BR /&gt; req_cpu = atoi(argv[1]);&lt;BR /&gt; pid  = getpid();&lt;BR /&gt; chosen_cpu = mpctl(MPC_SETPROCESS,req_cpu, pid);&lt;BR /&gt; if (chosen_cpu == -1) {&lt;BR /&gt;     printf("error found in mpctl with MPC_setprocess \n");&lt;BR /&gt;     printf("Error number is 37;d.\n",(errno));&lt;BR /&gt;     if (errno &amp;gt; 0 &amp;amp;&amp;amp; errno &amp;lt; sys_nerr)&lt;BR /&gt;       printf("Error message is: 37;s.\n",sys_errlist[errno]);&lt;BR /&gt;     exit(1);&lt;BR /&gt;     }&lt;BR /&gt; printf ("chose_cpu = 37;8d pid = 37;8d\n", chosen_cpu, pid);&lt;BR /&gt; sleep(1);  /* make sure that we get scheduled on this processor */&lt;BR /&gt; printf("CPU# is 37;d\n", mpctl(MPC_GETCURRENTSPU,chosen_cpu,pid));&lt;BR /&gt; system(argv[2]);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SYS&gt;&lt;/SYS&gt;&lt;/SYS&gt;&lt;/SYS&gt;</description>
    <pubDate>Sat, 11 May 2002 10:58:52 GMT</pubDate>
    <dc:creator>James Murtagh</dc:creator>
    <dc:date>2002-05-11T10:58:52Z</dc:date>
    <item>
      <title>Process Binding to 0th processor ,mpctl(0 behaviour.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-binding-to-0th-processor-mpctl-0-behaviour/m-p/2721769#M948146</link>
      <description>It looks like behaviour of mpctl() call is &lt;BR /&gt;different on hp11.00 and hp11.11. There is &lt;BR /&gt;one patch PHKL_25475 on hp11.00 which is causing a problem in our code.&lt;BR /&gt;we have code where we check whether that processor is online or not.&lt;BR /&gt;&lt;BR /&gt;res = mpctl (MPC_GETFIRSTSPU,  (spu_t) 0,&lt;BR /&gt;            (pid_t) 0);&lt;BR /&gt;&lt;BR /&gt;Here mpctl() returns 0 as first available processor. now we assign 'res' to 'pross'.&lt;BR /&gt;for (pross=res;&lt;BR /&gt;     pross&amp;lt;=nprocs ; pross++)&lt;BR /&gt;{&lt;BR /&gt; result = mpctl (MPC_GETNEXTSPU, (spu_t) (pross-1), (pid_t) 0);&lt;BR /&gt; printf("For processor %d, result is %d\n",pross, result);&lt;BR /&gt; }     &lt;BR /&gt;This returns (-1) when pross=0 on hp11.11 and &lt;BR /&gt;hp11.00 with patch PHKL_25475. &lt;BR /&gt;&lt;BR /&gt;Eariler without patch PHKL_25475 &lt;BR /&gt;mpctl(MPC_GETNEXTSPU,pross-1,0)  used to return 0 where pross=0;&lt;BR /&gt;Is it that 0th processor is not available for process binding on hp11.11 onwards?&lt;BR /&gt;&lt;BR /&gt;Or is it that if 2nd parameter for mpctl(,-1,)&lt;BR /&gt;has negative value shud return -1 (as in hp11.11) and not 0(as in hp11.00 with out ptach PHKL_25475). ?&lt;BR /&gt;&lt;BR /&gt;Finally my question remains ..,&lt;BR /&gt;Can i bind my process to 0th processor on&lt;BR /&gt;hp11.11 or its reserved by OS ?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;Aniket.&lt;BR /&gt;</description>
      <pubDate>Fri, 10 May 2002 21:35:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-binding-to-0th-processor-mpctl-0-behaviour/m-p/2721769#M948146</guid>
      <dc:creator>Aniket</dc:creator>
      <dc:date>2002-05-10T21:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Process Binding to 0th processor ,mpctl(0 behaviour.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/process-binding-to-0th-processor-mpctl-0-behaviour/m-p/2721770#M948147</link>
      <description>First of all, I don't think this will answer your question really but may help....&lt;BR /&gt;&lt;BR /&gt;Looking at the patch, PHKL_25475, it does alter one object file the mpctl() call is in.....althought doesn't include the mpctl.o object itself.&lt;BR /&gt;&lt;BR /&gt;# grep -il mpctl /usr/conf/lib/*&lt;BR /&gt;/usr/conf/lib/libdebug.a&lt;BR /&gt;/usr/conf/lib/libpm.a&lt;BR /&gt;/usr/conf/lib/libscall.a&lt;BR /&gt;# nm /usr/conf/lib/libscall.a |grep mpctl&lt;BR /&gt;mpctl               |          |undef |code   |        &lt;BR /&gt;&lt;BR /&gt;Putting the full output to a file and you can see the object is init_sent.o, which is included in the patch. Your best bet is to find what patch it superseded and check the symptoms it fixes between the last software level.&lt;BR /&gt;&lt;BR /&gt;In terms of difference between versions, all I can show is this....&lt;BR /&gt;&lt;BR /&gt;HPUX 11.11&lt;BR /&gt;# ar -x /usr/conf/lib/libpm.a mpctl.o&lt;BR /&gt;# cksum mpctl.o&lt;BR /&gt;1283031925 18968 mpctl.o  &lt;BR /&gt;&lt;BR /&gt;HPUX 11.00&lt;BR /&gt;# ar -x /usr/conf/lib/libpm.a mpctl.o&lt;BR /&gt;# cksum mpctl.o&lt;BR /&gt;1333892570 51112 mpctl.o   &lt;BR /&gt;&lt;BR /&gt;I have had a look and cannot find anything that says you can't schedule processes on the monarch processor.&lt;BR /&gt;&lt;BR /&gt;Lastly, some code to schedule processes....&lt;BR /&gt;&lt;BR /&gt;/* This program takes two inputs...first parameter is the cpu number */&lt;BR /&gt; /* to run a system command on and the second is the actual command   */&lt;BR /&gt; /* enclosed in quotes as follows:                                    */&lt;BR /&gt; /* set_processor 2 'date'                                            */&lt;BR /&gt;&lt;BR /&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;SYS&gt;&lt;BR /&gt;&lt;BR /&gt; extern errno;&lt;BR /&gt; extern char*sys_errlist[];&lt;BR /&gt; extern int sys_nerr;&lt;BR /&gt;&lt;BR /&gt; int main(argc, argv)&lt;BR /&gt; int     argc;&lt;BR /&gt; char    *argv[];&lt;BR /&gt; {&lt;BR /&gt;     spu_t  req_cpu, chosen_cpu;&lt;BR /&gt;     pid_t  pid;&lt;BR /&gt;     if (argc &amp;lt; 3) {&lt;BR /&gt;            printf("setprocessor spunum command");&lt;BR /&gt;            exit(1);&lt;BR /&gt;            }&lt;BR /&gt; req_cpu = atoi(argv[1]);&lt;BR /&gt; pid  = getpid();&lt;BR /&gt; chosen_cpu = mpctl(MPC_SETPROCESS,req_cpu, pid);&lt;BR /&gt; if (chosen_cpu == -1) {&lt;BR /&gt;     printf("error found in mpctl with MPC_setprocess \n");&lt;BR /&gt;     printf("Error number is 37;d.\n",(errno));&lt;BR /&gt;     if (errno &amp;gt; 0 &amp;amp;&amp;amp; errno &amp;lt; sys_nerr)&lt;BR /&gt;       printf("Error message is: 37;s.\n",sys_errlist[errno]);&lt;BR /&gt;     exit(1);&lt;BR /&gt;     }&lt;BR /&gt; printf ("chose_cpu = 37;8d pid = 37;8d\n", chosen_cpu, pid);&lt;BR /&gt; sleep(1);  /* make sure that we get scheduled on this processor */&lt;BR /&gt; printf("CPU# is 37;d\n", mpctl(MPC_GETCURRENTSPU,chosen_cpu,pid));&lt;BR /&gt; system(argv[2]);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SYS&gt;&lt;/SYS&gt;&lt;/SYS&gt;&lt;/SYS&gt;</description>
      <pubDate>Sat, 11 May 2002 10:58:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/process-binding-to-0th-processor-mpctl-0-behaviour/m-p/2721770#M948147</guid>
      <dc:creator>James Murtagh</dc:creator>
      <dc:date>2002-05-11T10:58:52Z</dc:date>
    </item>
  </channel>
</rss>

