bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GnuBG doesn't use full cpu power


From: Superfly Jon
Subject: Re: GnuBG doesn't use full cpu power
Date: Thu, 27 Feb 2020 10:10:14 +0000

I initially wrote the multithreading code, unfortunately I've forgotten a lot of the minor details :)

Most of this email thread is correct, in particular multi-threading the rollouts was what I did first and that does scale well.  Note that the number of cores needs to be set to the logical core count (which is often double the physical core count as most modern cores are hyper-threaded) to max out the cpu - note though that this will likely only improve things by 20-30% as the hyper-threaded core isn't twice as quick.

The core count applies to all the multi-threading areas, e.g. the evaluation speed test (my laptop has 6 hyper-threaded cores):

1 thread: 177,000 (cpu 16%)
6 threads: 765 ,000 (cpu 40%)
12 threads: 1173 ,000 (cpu 70%)

The cache size does impact multi-threading as the cache causes most of the thread contention (as well as generally improving evaluation performance).  Here's a rough rollout example:
zero cache
1 thread: ~645 seconds (cpu 8%)
6 thread: ~100 seconds (cpu 50%)
12 thread: ~80 seconds (cpu 100%)
max cache
1 thread: ~480 seconds (cpu 8%)
6 thread: ~90 seconds (cpu 50%)
12 thread: ~66 seconds (cpu 100%)
This would likely show up if you had a very high number of cores and in general I doubt there is much difference between a small-ish cache and a larger one.

I did add some more general multi-threading code to enable other areas to be multi-threaded and analysing games/matches does multi-thread.  I think I stopped there as most other things are quick and/or difficult to split into tasks.

Jon


On Mon, 24 Feb 2020 at 23:35, Philippe Michel <address@hidden> wrote:
On Sun, Feb 23, 2020 at 03:29:09PM +0000, address@hidden wrote:

> I recently noticed that GnuBG doesn't use 100% of CPU when it's
> searching for a hint or analyzing a game. It uses around 15% of CPU
> power.
> I have increased Cache and Thread Count in settings but it didn't
> change anything.
> Is it desired behavior or I need to change something to let it use all
> CPU?

Hint doesn't use multithreading.

Analyzing a game of a match does but it doesn't do it perfectly
efficiently as the number of threads grows. For instance, analyzing a
match at 4ply with 16 threads (on a machine that has at least as many
cores), I see the load average varying between 3-4 and 15-16, with an
avarage of maybe 8-10. With only 2 or 4 cores, load averages would be
someting like 2 and 3.5 respectively.

Rollouts use multithreading as well, and do it more efficiently. I'd
exppect a rollout with 16 threads to be 12-15 times faster that with
only one.

Cache size shouldn't make a difference. Don't set it to 0. Setting it
higher than the default will help a little but this has nothing to do
with multithreading. Don't set the threads count higher than the number
of cores on your computer.

Could you tell more about your setup ? Whay OS and GNUbg version ? How
many cores does your computer have and how many threads did you use ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]