Giter Site home page Giter Site logo

Comments (8)

AndyGrant avatar AndyGrant commented on July 29, 2024 1

Resolved, soon to be merged.

Thanks for your help :)

from ethereal.

CoffeeOne avatar CoffeeOne commented on July 29, 2024

Change:

-  fun2_t fun2 = (fun2_t)(void(*)())GetProcAddress(k32, "GetNumaNodeProcessorMaskEx");
-  fun3_t fun3 = (fun3_t)(void(*)())GetProcAddress(k32, "SetThreadGroupAffinity");
+  fun2_t fun2 = (fun2_t)GetProcAddress(k32, "GetNumaNodeProcessorMaskEx");
+  fun3_t fun3 = (fun3_t)GetProcAddress(k32, "SetThreadGroupAffinity");

$ make
gcc -DNDEBUG -O3 -std=gnu11 -Wall -Wextra -Wshadow -march=native -flto *.c fathom/tbprobe.c -lpthread -lm -DUSE_POPCNT -msse3 -mpopcnt -o Ethereal
windows.c: In function 'bestGroup':
windows.c:39:25: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'void (*)()' [-Wcast-function-type]
   fun1_t fun1 = (fun1_t)(void(*)())GetProcAddress(k32, "GetLogicalProcessorInformationEx");
                         ^
windows.c:39:17: warning: cast between incompatible function types from 'void (*)()' to 'int (*)(LOGICAL_PROCESSOR_RELATIONSHIP,  struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *, DWORD *)' {aka 'int (*)(enum _LOGICAL_PROCESSOR_RELATIONSHIP,  struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *, long unsigned int *)'} [-Wcast-function-type]
   fun1_t fun1 = (fun1_t)(void(*)())GetProcAddress(k32, "GetLogicalProcessorInformationEx");
                 ^
windows.c: In function 'bindThisThread':
windows.c:103:17: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'int (*)(USHORT,  struct _GROUP_AFFINITY *)' {aka 'int (*)(short unsigned int,  struct _GROUP_AFFINITY *)'} [-Wcast-function-type]
   fun2_t fun2 = (fun2_t)GetProcAddress(k32, "GetNumaNodeProcessorMaskEx");
                 ^
windows.c:104:17: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'int (*)(void *, const GROUP_AFFINITY *, struct _GROUP_AFFINITY *)' {aka 'int (*)(void *, const struct _GROUP_AFFINITY *, struct _GROUP_AFFINITY *)'} [-Wcast-function-type]
   fun3_t fun3 = (fun3_t)GetProcAddress(k32, "SetThreadGroupAffinity");
```                 ^

from ethereal.

CoffeeOne avatar CoffeeOne commented on July 29, 2024

@AndyGrant One more comment about that.
stockfish has this code:

void Thread::idle_loop() {

  // If OS already scheduled us on a different group than 0 then don't overwrite
  // the choice, eventually we are one of many one-threaded processes running on
  // some Windows NUMA hardware, for instance in fishtest. To make it simple,
  // just check if running threads are below a threshold, in this case all this
  // NUMA machinery is not needed.
  if (Options["Threads"] >= 8)
      WinProcGroup::bindThisThread(idx);

Do you want to do something similar in Ethereal?
I connected a 64 core machine under Windows with http://chess.grantnet.us
and had super weird effects (only 16% cpu load with 60 threads) and only 0.1 MN/s.
I am quite sure it is because of that. Most likely all the threads were bound to the same physical node.

from ethereal.

AndyGrant avatar AndyGrant commented on July 29, 2024

Okay, this is easy enough to do.
What about the case when we run tests using 8threads at once with your machine?
It looks to me like this solution only pushes back the problem.

from ethereal.

CoffeeOne avatar CoffeeOne commented on July 29, 2024

You are right, the problem comes again at 8 threads with stockfish. But the vast majority of tests are 1 thread tests.

from ethereal.

AndyGrant avatar AndyGrant commented on July 29, 2024

Okay, well do you have any aversion to using Threads > 8 instead of Threads >= 8?

Stockfish usually does 7thread tests, but I do 8thread since the majority of workers are connected on 8 threads.

If not, I will submit a dummy patch where both master/test have the numa change

from ethereal.

CoffeeOne avatar CoffeeOne commented on July 29, 2024

No aversion :), I always use the full number of cores/threads when I use the engine for analysis or for engine-engine games in the internet ;)

from ethereal.

AndyGrant avatar AndyGrant commented on July 29, 2024

dd74700 resolved

from ethereal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.