home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / vmsnet / internal / 1794 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  6.6 KB

  1. Path: sparky!uunet!mcsun!fuug!kulminator!savolainen_p
  2. From: savolainen_p@kulminator.salcom.fi (Pekka Savolainen, Salcom Finland)
  3. Newsgroups: vmsnet.internals
  4. Subject: Re: How to force a process into one CPU on a 6640?
  5. Message-ID: <1993Jan24.113735.141@kulminator.salcom.fi>
  6. Date: 24 Jan 93 11:37:35 +0200
  7. References: <1993Jan24.003820.13857@rks.se>
  8. Reply-To: Pekka.Savolainen@Salcom.Fi
  9. Organization: Salcom Finland, Jyvaskyla Finland
  10. Lines: 187
  11.  
  12.  
  13. In article <1993Jan24.003820.13857@rks.se>, vaxmith@rks.se writes:
  14. > I have a small but maybe a littlebit tricky question.
  15. > I want to force some processes in a 6640 to run on only one and always the 
  16. > same processor. Is this possible and if so, can someone explain how or 
  17. > include an MAR-example of how to do it. I can't relink the images so it has 
  18. > to be a utility that can change the PCB when the process is running.
  19.  
  20.  
  21. Included, please find sys$examples:bind_read_me.txt
  22. In the same location you'll also find bind_main.exe and bind.cld.
  23. This is exactly what you want. This example came with VMS 5.5-2, I think.
  24. If you don't have 5.5-2, please drop me a message, so I'll get
  25. the files to you.
  26.  
  27. > Thanks
  28. > -- Michael
  29.  
  30. Pekka
  31.  
  32.  
  33. ------------------------ c u t ----------------------------------
  34.  
  35. /****************************************************************************
  36. *                                        *
  37. *  COPYRIGHT (c) 1992 BY                                         *
  38. *  DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS.            *
  39. *  ALL RIGHTS RESERVED.                                    *
  40. *                                         *
  41. *  THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED    * 
  42. *  ONLY IN  ACCORDANCE WITH  THE  TERMS  OF  SUCH  LICENSE  AND WITH THE    *
  43. *  INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR  ANY  OTHER    *
  44. *  COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY    *
  45. *  OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE IS  HEREBY    *
  46. *  TRANSFERRED.                                        *
  47. *                                         *
  48. *  THE INFORMATION IN THIS SOFTWARE IS  SUBJECT TO CHANGE WITHOUT NOTICE    *
  49. *  AND  SHOULD  NOT  BE  CONSTRUED AS  A COMMITMENT BY DIGITAL EQUIPMENT    *
  50. *  CORPORATION.                                 *
  51. *                                         *
  52. *  DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE  OR  RELIABILITY OF ITS    *
  53. *  SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.            *
  54. *                                         *
  55. *                                        *
  56. ****************************************************************************/
  57.  
  58. /***************************************************************************** 
  59. *
  60. *  AUTHOR:
  61. *
  62. *    Nasser Abbasi, VMS Engineering
  63. *
  64. *  CREATION DATE:  FEB 10, 1992
  65. *
  66. *  VAX/VMS Version Supported:
  67. *
  68. *    These files should be compiled, linked and run on VMS V5.2 and above
  69. *    only since support for Process Affinity was not added until VMS 5.2.
  70. *
  71. *  FACILITY:  BIND command
  72. *
  73. *    This program implements the BIND command.
  74. *
  75. *    The BIND command is the user interface to the VMS scheduler entry
  76. *    points SCH$REQUIRE_AFFINITY and SCH$RELEASE_AFFINITY. These two
  77. *    scheduler routines are described in detail in the "VAX/VMS
  78. *    Internals and Data Structures" book, V5.2, pages 288-290.
  79. *
  80. *    The function of the BIND command is to make a process execute on
  81. *    a specific CPU in an SMP configuration. In other words, to give a
  82. *    process a permanent affinity for a specific CPU. The command also has a
  83. *    REMOVE qualifier that can be used to remove process permanent affinity.
  84. *
  85. *    The BIND command syntax is:
  86. *
  87. *        BIND [ /CPU=<cpu> ] [ <name> ]
  88. *             [ /ID=<pid> ]
  89. *         [ /REMOVE ]
  90. *
  91. *    where:
  92. *        <name>  Process name of the target process.
  93. *        <pid>   Process identifier (PID) of the target process (specified as
  94. *            a hexadecimal string).
  95. *        <cpu>   The number of the CPU for which affinity is to be required
  96. *            (specified as a decimal integer in the range 0 thru 31).
  97. *
  98. *    Items enclosed in square brackets are optional.
  99. *
  100. *    Either /CPU or /REMOVE must be specified (but not both).
  101. *
  102. *    The PID and process name cannot be specified at the same time.  
  103. *
  104. *    If you do not specify a PID or a process name, then the calling process
  105. *    is assumed.
  106. *
  107. *    For example:
  108. *        
  109. *        $ BIND /CPU=2        ! Binds this process to CPU 2
  110. *        $ BIND /CPU=2 /ID=5B    ! Bind a process to CPU 5
  111. *        $ BIND /CPU=0 MY_PROCESS    ! Bind a process to CPU 0
  112. *        $ BIND /REMOVE        ! Remove affinity for current process
  113. *        $ BIND /REMOVE /ID=5B    ! Remove affinity for specified PID
  114. *        $ BIND /REMOVE MY_PROCESS    ! Remove affinity for specified process
  115. *
  116. *    Before using the BIND verb, it must be defined as follows:
  117. *
  118. *        $ SET COMMAND BIND        ! BIND.CLD is part of the kit
  119. *
  120. *    BIND.CLD expects the image to be located in SYS$EXAMPLES. You will have
  121. *    to edit    the CLD file if the image is located in some other directory.
  122. *
  123. *    To find what CPU's you have in your SMP system, and to see any existing
  124. *    process affinities, use the SHOW CPU command:
  125. *
  126. *        $ SHOW CPU /FULL
  127. *
  128. *    NOTE:    BIND removes any previous affinity for a CPU before requiring
  129. *        affinity for a different CPU.
  130. *
  131. *
  132. *  Example of using BIND and $SHOW CPU/FULL
  133. *  ----------------------------------------
  134. *
  135. *    $ bind /cpu=8 /id=41
  136. *    $ show cpu /full
  137. *   
  138. *    CHOLLY, a VAXstation 3540
  139. *    Multiprocessing is ENABLED. Streamlined synchronization image loaded.
  140. *    Minimum multiprocessing revision levels: CPU = 3 FBIC = 1.
  141. *    Default CPU capabilities:
  142. *        QUORUM RUN
  143. *    Default process capabilities:
  144. *        QUORUM RUN
  145. *   
  146. *    PRIMARY CPU = 08
  147. *   
  148. *    CPU 08 is in RUN state
  149. *    Current Process: *** None ***
  150. *    Revision levels: CPU = 5 FBIC = 1.
  151. *    Capabilities of this CPU:
  152. *        PRIMARY QUORUM RUN
  153. *    Processes which can only execute on this CPU:
  154. *        MY_APPL          PID = 00000041  Reason: Bound to this CPU
  155. *   
  156. *    $!
  157. *    $! Now we remove the process's affinity for CPU 8
  158. *    $!
  159. *    $ bind /remove /id=41
  160. *    $ show cpu /full
  161. *   
  162. *    CHOLLY, a VAXstation 3540
  163. *    Multiprocessing is ENABLED. Streamlined synchronization image loaded.
  164. *    Minimum multiprocessing revision levels: CPU = 3 FBIC = 1.
  165. *    Default CPU capabilities:
  166. *        QUORUM RUN
  167. *    Default process capabilities:
  168. *        QUORUM RUN
  169. *   
  170. *    PRIMARY CPU = 08
  171. *   
  172. *    CPU 08 is in RUN state
  173. *    Current Process: *** None ***
  174. *    Revision levels: CPU = 5 FBIC = 1.
  175. *    Capabilities of this CPU:
  176. *        PRIMARY QUORUM RUN
  177. *    Processes which can only execute on this CPU:
  178. *        *** None ***
  179. *
  180. *
  181. *  WARNING:
  182. *  --------
  183. *  Do not use BIND /REMOVE to remove affinity for a process that you did not
  184. *  explicitely set via a previous BIND.
  185. *
  186. *
  187. *  PRIVILEGES NEEDED:
  188. *  ------------------
  189. *  CMKRNL is required to use the BIND program. You also need access to the
  190. *  process you wish to affect; GROUP or WORLD privilege is needed to affect
  191. *  processes in your group or outside.
  192. *
  193. *****************************************************************************/
  194.  
  195.