Answers.Body: <p>According to the readme.</p>
  <pre><code>    -n &lt;nodes per second&gt;                         default: 0 (no limit)
         Limits the speed to weaken the engine and to use less resources: The
         speed of the machine does not matter here, it uses usleep() during
         the search, so with low NPS it does not raise the machine load.
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-26T15:42:19.050Z
Answers.Text: Thanks. I understand now. I just did 'man usleep', and it simply suspends the execution of the program.
Answers.UserDisplayName: chesskobra
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-26T17:20:17.457Z
Answers.Text: Doesn't usleep only give a minimum time to sleep? does it actually calibrate NPS?
Answers.UserDisplayName: qwr
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-27T02:21:35.210Z
Answers.Text: Is it reasonable to assume that the same program running on two different hardwares at the same NPS (and keeping other parameters same) would play at roughly the same level?
Answers.UserDisplayName: chesskobra
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-27T03:47:31.780Z
Answers.Text: @chesskobra yes, but you have to test it, as the nps may not be perfectly the same. At one point, it may stop searching after 400000 or 390000 or 395000. Depends on how this feature is implemented by the author.
Answers.UserDisplayName: ferdy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-26T12:16:30.097Z
Answers.LastActivityDate: 2022-07-26T12:16:30.097Z
Answers.UserDisplayName: ferdy
Body: <p>I am trying to experiment with the parameter -n  in Phalanx XXV. I play a match between phalanx0 (phalanx without any options) vs phalanx1 (phalanx -n 512000 -t 131072). Both phalanx0 and phalanx1 are set to make 40 moves per minute in my test, and in fact use nearly all of 1 minute for 40 moves. I notice that phalanx0 gives about 800k NPS on my laptop. I would imagine that NPS would depend only on the hardware, i.e., a given algorithm (say phalanx) with given number of moves per second would do a certain number of NPS on a given machine. So my question is how is NPS controlled by the program?</p>
  
Tags: <engines><programming>
Title: How are nodes per second in engines controlled?
ThreadText: # How are nodes per second in engines controlled?
  
  (Asked by: username_0 on 2022-07-26)
  
  I am trying to experiment with the parameter -n in Phalanx XXV. I play a match between phalanx0 (phalanx without any options) vs phalanx1 (phalanx -n 512000 -t 131072). Both phalanx0 and phalanx1 are set to make 40 moves per minute in my test, and in fact use nearly all of 1 minute for 40 moves. I notice that phalanx0 gives about 800k NPS on my laptop. I would imagine that NPS would depend only on the hardware, i.e., a given algorithm (say phalanx) with given number of moves per second would do a certain number of NPS on a given machine. So my question is how is NPS controlled by the program?
  
  **Tags:** engines, programming
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-07-26. Score: 2 | Accepted answer
  
  According to the readme.
      -n                          default: 0 (no limit)
         Limits the speed to weaken the engine and to use less resources: The
         speed of the machine does not matter here, it uses usleep() during
         the search, so with low NPS it does not raise the machine load.
  
  > **Comments:**
  > **username_0**: Thanks. I understand now. I just did 'man usleep', and it simply suspends the execution of the program.  
  > **username_2**: Doesn't usleep only give a minimum time to sleep? does it actually calibrate NPS?  
  > **username_0**: Is it reasonable to assume that the same program running on two different hardwares at the same NPS (and keeping other parameters same) would play at roughly the same level?  
  > **username_1**: @username_0 yes, but you have to test it, as the nps may not be perfectly the same. At one point, it may stop searching after 400000 or 390000 or 395000. Depends on how this feature is implemented by the author.  
  
  ---
  
  