When should I consider parallel search ?

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.
Dirt
Posts: 2851
Joined: Wed Mar 08, 2006 9:01 pm
Location: Irvine, CA, USA

Re: When should I consider parallel search ?

Post by Dirt » Sun Jun 11, 2017 8:14 am

MahmoudUthman wrote:
hgm wrote:Never consider parallel search. It is an inefficient usage of resources.
Never as in never or not right now ? , I thought that current algorithms scale quite well on low number of cores which what I'm interested in "for now" , I only have a I7-5820k processor.
That was a troll post by HGM. You're better off ignoring it.
Deasil is the right way to go.

User avatar
hgm
Posts: 24605
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: When should I consider parallel search ?

Post by hgm » Sun Jun 11, 2017 8:28 am

Not entirely. As evidenced by the fact that almost none of my engines is SMP. After having tried it once (on HaQiKi D), I realized that it would bring me nothing.

Komodo also only implemented SMP after it had reached the top as single-threaded engine. It seems like something desperate you do only when you run entirely out of other ideas to improve your engine.

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

Re: When should I consider parallel search ?

Post by elcabesa » Sun Jun 11, 2017 10:49 am

MahmoudUthman wrote: :) I'm but I lack the experience to judge whether or not It's worth the effort (coding & debugging) at this level before trying other things like the ones I mentioned.
I think you program the engine for fun, it's your hobby. so, as soon as you want to have fun trying to implement a smp engine you can try :)

a standard implementation of lazy smp shuld give you 100 elo point boost when comparing 4cores vs 1core at CCRL conditions :)

For SMP you have probably to refactor some of your code because you nned to choose what data structure should be shared between threads and which should not. I share only the hashtable and the const structures for move generation. no other data is shared between threads. this means that each core hs his own killer table and history tables

User avatar
hgm
Posts: 24605
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: When should I consider parallel search ?

Post by hgm » Sun Jun 11, 2017 12:22 pm

elcabesa wrote:For SMP you have probably to refactor some of your code because you nned to choose what data structure should be shared between threads and which should not.
In HaQiKi D I avoided that by using processes instead of threads. They only share the hash table.

The processes fork off each other in response to the 'cores' command, forming a pipeline along which all commands are passed to keep them in sync. The 'cores' command causes a slave process to be forked off, connected to the parent process by pipes, if more than a single core is requested. It is subsequently passed to that slave with the number of cores decremented by one. The 'memory' command is passed with an extra, non-standard parameter indicating the OS name of the shared memory area, so that the slaves can attach to it, instead of allocating memory themselves. Without this extra parameter (as when received from the GUI) a shared memory area of the requested size is created. A 'go' command is passed to the slave as 'analyze', and 'force' command as 'exit'. When the master makes a move, it doesn't only send it to the GUI as 'move XXX', but also to the slave as 'usermove XXX'. Other commands are passed as they are received.

syzygy
Posts: 4582
Joined: Tue Feb 28, 2012 10:56 pm

Re: When should I consider parallel search ?

Post by syzygy » Sun Jun 11, 2017 1:04 pm

hgm wrote:Not entirely. As evidenced by the fact that almost none of my engines is SMP. After having tried it once (on HaQiKi D), I realized that it would bring me nothing.

Komodo also only implemented SMP after it had reached the top as single-threaded engine. It seems like something desperate you do only when you run entirely out of other ideas to improve your engine.
Yes, one should at least have reached the strength of HGM's engine (about 1800 Elo?).

User avatar
hgm
Posts: 24605
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: When should I consider parallel search ?

Post by hgm » Sun Jun 11, 2017 1:07 pm

Uh uh, you are talking about the silver medalist in Pamplona 2009! (When it was still single core.)

flok

Re: When should I consider parallel search ?

Post by flok » Sun Jun 11, 2017 3:02 pm

Embla is smp yes - unfortunately it does not give any gain.

I've tried getting lazy smp to work. Took an hour. But: it did not work :-)
So I asked it because I was wondering what aspect I missed. Apparently there is one because of that one hour - a week difference.

syzygy
Posts: 4582
Joined: Tue Feb 28, 2012 10:56 pm

Re: When should I consider parallel search ?

Post by syzygy » Sun Jun 11, 2017 3:17 pm

flok wrote:Embla is smp yes - unfortunately it does not give any gain.

I've tried getting lazy smp to work. Took an hour. But: it did not work :-)
So I asked it because I was wondering what aspect I missed. Apparently there is one because of that one hour - a week difference.
You missed only three aspects: bugs, bugs and bugs.

elpapa
Posts: 203
Joined: Sun Jan 18, 2009 10:27 pm
Location: Sweden
Full name: Patrik Karlsson

Re: When should I consider parallel search ?

Post by elpapa » Sun Jun 11, 2017 6:54 pm

flok wrote:it did not work
flok wrote:I was wondering what aspect I missed
Imagine you give me a Rubik's cube and ask me to solve it. I finish it in only 15 seconds and this is what it looks like:

Image


Now, what aspect of solving Rubik's cube would you say I missed?

Guenther
Posts: 3280
Joined: Wed Oct 01, 2008 4:33 am
Location: Regensburg, Germany
Full name: Guenther Simon
Contact:

Re: When should I consider parallel search ?

Post by Guenther » Sun Jun 11, 2017 7:52 pm

syzygy wrote:
hgm wrote:Not entirely. As evidenced by the fact that almost none of my engines is SMP. After having tried it once (on HaQiKi D), I realized that it would bring me nothing.

Komodo also only implemented SMP after it had reached the top as single-threaded engine. It seems like something desperate you do only when you run entirely out of other ideas to improve your engine.
Yes, one should at least have reached the strength of HGM's engine (about 1800 Elo?).
HGM has done several programs and a lot of them are non 'western' chess ones which are quite strong. BTW even Joker, one of his chess programs is at least 2300.
https://rwbc-chess.de
https://rwbc-chess.de/chronology.htm
--------------------------------------------------
The troll explosion at talkchess:
https://docs.google.com/spreadsheets/d/ ... KSptBx9AUs

Post Reply