Sometimes I notice a strange slow down in the search to the point that iteration N-1 almost equals iteration N's time in normal state.
here's an example output :
Slowdown
I ran the program while monitoring the CPU cores' clocks using HW-monitor , before starting the search all cores were near their lowest once the search started the clock of one core rose to the maximum but then this kept changing from one core to another rapidly so I set the affinity of the engine to one core and the slowdown disappeared , I tested this multiple times before I post this , did anyone else experience this and what could be the cause of this strange OS behavior , by the way this only started happening frequently lately , also do major engines set the affinity or leave it to the OS ?
PS: Windows 10 I7-5820K , & compiled using different compilers just to make sure.
Some multi-core engines have support for setting affinity (pinning threads to cores). I have not actually seen a big benefit from it in my testing, but YMMV.
It can be hard to do this portably. I use the hwloc library for this. Some other issues: logical vs physical cores (hyperthreading) - not always easy to distinguish these and you need to decide what your strategy is for that. Also core numbering is not standardized. Pinning works fine if one engine is using all cores on a machine, but if using multiple engines each with affinity support it can get tricky because they do it different ways.
jdart wrote:Some multi-core engines have support for setting affinity (pinning threads to cores). I have not actually seen a big benefit from it in my testing, but YMMV.
It can be hard to do this portably. I use the hwloc library for this. Some other issues: logical vs physical cores (hyperthreading) - not always easy to distinguish these and you need to decide what your strategy is for that. Also core numbering is not standardized. Pinning works fine if one engine is using all cores on a machine, but if using multiple engines each with affinity support it can get tricky because they do it different ways.
--Jon
Mine isn't multithreaded , so it even affects single threaded heavily when the OS manages it in a bad way , another thing that elevated the problem was setting the process priority to real-time , but setting the affinity still produced better performance.
Is there no way to ask the OS to keep us on the same core/s if possible instead of hardcoded affinity "to avoid load balancing problems too"?
Ferdy wrote:Turbo boost enabled or disabled?
Hyper-threading enabled or disabled?
both enabled
Assigning a process to a certain core by affinity is generally faster when ht is enabled in a system. In addition the system might have activated the turbo too, resulting in a faster search. When turbo is enabled it is difficult to predict the engine performance, there are a lot of conditions of when the system activates it. I disable turbo when running engine tests.