Single core?

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

eduherminio
Posts: 76
Joined: Mon Apr 05, 2021 12:00 am
Full name: Eduardo Caceres

Re: Single core?

Post by eduherminio »

First of all, thanks to everyone testing Lynx and apologies for any issues that it may be causing.
It's my first chess engine and I've been focusing more on actually implementing chess engine functionalities than paying attention to memory/cpu consumption, which can be tricky to fully control in memory-managed languages.

I can confirm Lynx currently uses only one thread for searching.
There are another two potential threads associated to both input and output, but they are idle most of the time and have close to none CPU impact.

As amanjpro pointed out, those occasional spikes are likely to be caused by automatic Garbage Collection kicking in every few minutes/hours, something which can probably be avoided by drastically removing allocations, as you can see in those other more elaborated .NET chess engines
I'll try to work on remediating that and keep you posted so that anyone who stop/doesn't test Lynx due to those issues can start doing it.
Author of Lynx chess engine (GitHub, Lichess)
User avatar
hgm
Posts: 28438
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Single core?

Post by hgm »

It is possible in the Windows task manager to define an affinity between a process and a certain virtual core (= hyper thread) or set of cores. So you can easily solve the problem of unauthorized CPU usage by assigning each engine process only a fraction of the number of cores. E.g. for single-CPU testing you can assign one engine core 0 and 1, another engine core 2 and 3, etc. Then each engine has two HT on the same physical core at its disposal, and it is up to the engine how it is going to compete with itself for that physical core with all its threads.