lazy smp questions

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
elcabesa
Posts: 815
Joined: Sun May 23, 2010 11:32 am
Contact:

lazy smp questions

Post by elcabesa » Mon Dec 21, 2015 11:15 am

Hi everyone, I'm finally trying to implement lazy smp into my engine.
I was finally able to launch more than one thread. Let them search in parallel and comunicate using only hash table.
I'm just testing whether or not I can have some elo gain.

I'd like to understood and study some lazy smp engines code. Stockfish for example launch n different Id loops. My engine launch only one Id loop and launch n parallel alpha beta.
What are the trends abd state of the arts in lazy smp?
What are engines that implementers it?

User avatar
cdani
Posts: 2104
Joined: Sat Jan 18, 2014 9:24 am
Location: Andorra
Contact:

Re: lazy smp questions

Post by cdani » Mon Dec 21, 2015 1:03 pm

Andscacs launches 1 id loop and n alpha_beta. I suppose the two alternatives are not different in strength.

Of course you should have a lot of elo gain, once there are no bugs.

As open source, you can see Cheng for example.

Another engine that have it is Nirvanachess.

mar
Posts: 2001
Joined: Fri Nov 26, 2010 1:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: lazy smp questions

Post by mar » Mon Dec 21, 2015 2:19 pm

Well, one thing that I don't like about my implementation is the way I stop helpers.
Currently I stop one by one, waiting on an event. This may cause problems when number of helper threads is large.
So I'm considering to either use an atomic counter and only set one event once it counts to zero
or simply use busy waiting in master thread, i.e. spinning and waiting for the counter to reach zero.
Otherwise I too use 1 id loop, I consider this superior (but I may be wrong - from what I've seen on various rating lists there's probably no elo difference).

I'm not sure one can say that lazy smp is state of the art. Let's say it's just lazy - but somehow it works :)

elcabesa
Posts: 815
Joined: Sun May 23, 2010 11:32 am
Contact:

Re: lazy smp questions

Post by elcabesa » Wed Dec 23, 2015 7:45 am

Vajolet is now working with multi thread code.

I'm j us t trying to understand if it's stronger than the single thread one.
I'm collecting some stat and i'll compare them whit the result of multi thread implementation of cheng.
Up to now 2 thread vs 1 at 6s+0.05 games give me a 25 elo gain

Post Reply