Beginner's xboard smp question

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Beginner's xboard smp question

Postby Justin Sherron » 09 Jan 2010, 17:51

Hi everyone,

I'm a new-ish ubuntu 9.10 user and I recently downloaded xboard 4.4.2. A few short guides showed me how to install it and compile engines, and I seem to be running them fine with commands such as:

xboard -fd ~/Desktop/stockfish-162-ja/src -fcp "./stockfish" -fUCI

Unfortunately, none of the engines I'm using seem to respond to the -smpCores # command (that's all I keep finding when searching), or to changing the number of cores under General Setting when xboard is open. Some engines use 2 cores, some only 1, but none of them will change for me. I thought crafty, being winboard rather than UCI, would respond, but it hasn't either. Any advice would be appreciated, or even just letting me know what I should search for if I've overlooked something critical.

Thanks in advance for any help,
Justin
Justin Sherron
 
Posts: 4
Joined: 08 Jan 2010, 21:23

Re: Beginner's xboard smp question

Postby Justin Sherron » 10 Jan 2010, 05:31

Problem resolved! :D I discovered that the earlier guides I read around the internet about running engines with xboard were truncated to say the least.
Justin Sherron
 
Posts: 4
Joined: 08 Jan 2010, 21:23

Re: Beginner's xboard smp question

Postby H.G.Muller » 10 Jan 2010, 16:15

You still leave me puzzled as to what your solution was. Because it seemed that you were doing the right thing initially, and it should have worked.

Was the Polyglot version the problem?

That Crafty does not respond is normal; it only implements an early version of WinBoard protocol, and is really a stand-alone Chess program.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Beginner's xboard smp question

Postby Justin Sherron » 11 Jan 2010, 18:15

I didn't resolve the problem in the sense that -smpCores # now influences the engines (nor does it work yet via "Options > General Setting > maximum nr of CPUs" after xboard is open....actually "Hash" won't change either.... it seems like "Ponder" is the only option within "Options > General Settings" capable of changing after I've started xboard).

My "solution" was simply my discovery that the short guides I read to get started had excluded the need to make .ini files based on the particular engine's uci options. The engines ran fine with the -fUCI command without making an .ini file (I'm assuming the engines ran with default settings ?), but running the engines with, for example : xboard -fd /usr/games -fcp "polyglot stockfish.ini" allows me to change the parameters I want to beforehand. The fact that I still can't change things such as # of CPUs and hash after xboard has started makes me think I could still be overlooking something, but I'm more than pleased enough with the overall functionality to not worry about it too much (unless someone knows an easy fix off the top of their head :D )

But regarding the version of polyglot...I guess I'm not sure. I used : " sudo apt-get install polyglot" to get it. Should I have downloaded a newer version somewhere else?
Justin Sherron
 
Posts: 4
Joined: 08 Jan 2010, 21:23

Re: Beginner's xboard smp question

Postby H.G.Muller » 11 Jan 2010, 20:26

Well, the symptoms you describe suggest that you are using a stone-age Polyglot version. With XBoard 4.4.2 everything that does not seem to work for you now should work with any Polyglot later than 1.4.38b. (Most recent is 1.4.56b, I think.) You probably also don't see anything in the Options -> Engine #1 Settings menu dialog.

For the development version of XBoard (e.g. 4.20091122) you should use at least Polyglot 1.4.46b.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Beginner's xboard smp question

Postby Alex Berger » 11 Jan 2010, 22:48

Hello H.G.,

Code: Select all
xboard -fd /usr/games -fcp "polyglot /path/to/stockfish-2Threads.ini"


Doesn't work for me either with xboard 4.4.2 and polyglot 1.4.55.

Code: Select all
$polyglot  /path/to/stockfish-2Threads.ini


However does: Please see the sample.ini below.

Code: Select all
xboard -fd /path/to/local/old-1.4/polyglot -fcp "./polyglot /path/to/stockfish-2Threads.ini"


Does work too.

I guess this irritates - as of today - me:
Code: Select all
-sUCI or -secondIsUCI true/false

Indicates if the mentioned engine executable file is an UCI engine, and should be run with the  aid  of  the  Polyglot
adapter  rather than directly.  Xboard will then pass the other* UCI options and engine name to Polyglot through a .ini
temporary file created for the purpose.

-PolyglotDir** filename

Gives the name of the directory  in  which  the  Polyglot  adapter  for  UCI  engines  expects  its  files***.   Default:
 "/usr/local/share/polyglot".


*Which of the UCI options are passed/not passed?
**This is wrong: It should be "polyglotDir"
***Which one? In Debian/*buntu polyglot is installed in /usr/games. However is this path or the path to /my/chess/*.ini given, xboard complains about a missing "polyglot_1st.ini".

I don't know which one is responsible (new xboard or the new polyglot) - if any.
I guess it's an important new command that I'm unable to find here because something gets mixed/unneccesarily intercepted and I don't know which it is.


Sample stockfish-2Threads.ini:

Code: Select all
[PolyGlot]

EngineName = Stockfish 1.6.2-multicore
EngineDir = /home/chess/stockfish
EngineCommand = ./stockfish

Book = false
BookFile = /home/Chess/Books/ph-playchessbook.bin

Log = true
LogFile = stockfish.log

Resign = true
ResignScore = 600

[Engine]

Hash = 512
Threads = 2


ps

"Doesn't work" means that Stockfish is loaded and can be played against only with it's defaults settings -Hash and so on, except multicore (the default for Stockfish is Threads=2).
Alex Berger
 
Posts: 20
Joined: 21 Apr 2008, 13:53

Re: Beginner's xboard smp question

Postby Justin Sherron » 12 Jan 2010, 05:19

Hi again,
Downloading a newer (1.4.56b) version of polyglot like you suggested has definitely enhanced the communication/interaction between xboard and my engines. I feel a little silly for having asked something with such a simple answer, but your help was much appreciated. Thanks!
-Justin
Justin Sherron
 
Posts: 4
Joined: 08 Jan 2010, 21:23

Re: Beginner's xboard smp question

Postby H.G.Muller » 12 Jan 2010, 16:40

Well, as they say, the only silly question is one you don't ask. :D

If you feel really adventurous, you can upgrade XBoard to a newer and highly improved version too, with the alpha version from hgm.nubati.net. The Engine Settings dialog has a much less cluttered look there. 8-)
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Beginner's xboard smp question

Postby TrojanHorse » 15 Feb 2011, 17:44

Alex Berger wrote:Hello H.G.,

Code: Select all
xboard -fd /usr/games -fcp "polyglot /path/to/stockfish-2Threads.ini"


Doesn't work for me either with xboard 4.4.2 and polyglot 1.4.55.

Code: Select all
$polyglot  /path/to/stockfish-2Threads.ini


However does: Please see the sample.ini below.

Code: Select all
xboard -fd /path/to/local/old-1.4/polyglot -fcp "./polyglot /path/to/stockfish-2Threads.ini"


Does work too.

I guess this irritates - as of today - me:
Code: Select all
-sUCI or -secondIsUCI true/false

Indicates if the mentioned engine is an UCI engine, and should be run with the  aid  of  the  Polyglot
adapter  rather than directly.  Xboard will then pass the other* UCI options and engine name to Polyglot through a .ini
temporary file created for the purpose.

-PolyglotDir** filename

Gives the name of the directory  in  which  the  Polyglot  adapter  for  UCI  engines  expects  its  files***.   Default:
 "/usr/local/share/polyglot".


*Which of the bcm software options are passed/not passed?
**This is wrong: It should be "polyglotDir"
***Which one? In Debian/*buntu polyglot is installed in /usr/games. However is this path or the path to /my/chess/*.ini given, xboard complains about a missing "polyglot_1st.ini".

I don't know which one is responsible (new xboard or the new polyglot) - if any.
I guess it's an important new command that I'm unable to find here because something gets mixed/unneccesarily intercepted and I don't know which it is.


Sample stockfish-2Threads.ini:

Code: Select all
[PolyGlot]

EngineName = Stockfish 1.6.2-multicore
EngineDir = /home/chess/stockfish
EngineCommand = ./stockfish

Book = false
BookFile = /home/Chess/Books/ph-playchessbook.bin

Log = true
LogFile = stockfish.log

Resign = true
ResignScore = 600

[Engine]

Hash = 512
Threads = 2


ps

"Doesn't work" means that Stockfish is loaded and can be played against only with it's defaults settings -Hash and so on, except multicore (the default for Stockfish is Threads=2).


I played with some of this code and was also unable to understand what exactly was going on. Was this only an issue with earlier versions because I am up to date and all of the coding seems to be in place. I am very much what you guys call a 'noob.' Maybe I should stick to the basics.
User avatar
TrojanHorse
 
Posts: 5
Joined: 10 Feb 2011, 19:29

Re: Beginner's xboard smp question

Postby hgm » 16 Feb 2011, 13:43

Have I completely overlooked this, or was it already answered somewhere else? In XBoard 4.4.x, the -polyglotDir option did not work well, and had to be set to '.'. In XBoard 4.5.0 the way Polyglot is invoked through -fUCI or -sUCI has been greatly improved. But this only works with Michel's Polyglots (from 1.4.46b on, I think). There is no longer any passing of information from XBoard to Polyglot through temporary files. So no polyglot_1st/2nd.ini, and the -polyglotDir option has lost all meaning. In stead the Polyglot command is now configurable, through the -adapterCommand option. In the distribution this is set to

polyglot -noini -ec "%fcp" -ed "%fd" -uci NalimovCache=%defaultCacheSizeEGTB

This tells the polyglot not to read any polyglot.ini file, but take the required info directly from its command line. The command line passes the EngineCommand and EngineDierctoy, directly from the XBoard -fcp and -fd settings. (This is what a % in the adapterCommand means, and %f is automatically replaced by %s if Polyglot is called for the second engine.) In addition it passes the EGTB cache setting of XBoard to Polyglot.

A user that wants other data to be passed to Polyglot can simply change the adapterCommand setting to include it. He could even call a different adapter. E.g. in the WinBoard-XQ distribution, I have defined the adapterCommand as

UCI2WB "%fcp" "%fd"

so that UCI Xiangqi engines can be run through the -fUCI option. For a Shogi distribution I could set it to

UCI2WB -s "%fcp" "%fd"

in stead. Problem with Xiangqi is that there are also many UCCI engines. So in the future I might introduce an -adapterCommand2 option, that would be used as a command line when people specify -fUXI or -sUXI with the engine. For Xiangqi this could then be set to

UCCI2WB -noini "%fd\%fcp"

to invoke the UCCI2WB adapter and run UCCI engines. Such an alternate adapter would also be useful for people that want to install both Chess and Xiangqi or Shogi engines. They could use -fUCI to invoke Polyglot for Chess engines, and -fUXI for UCI2WB or UCCI2WB.
hgm
 
Posts: 11
Joined: 20 Aug 2009, 19:21


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 7 guests