raspberry pi cluster versus fairymax

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
flok

raspberry pi cluster versus fairymax

Post by flok » Thu Oct 31, 2013 8:47 pm

Hi,

For fun and kicks I added "puppet master" functionality to my chess program. This allows it to connect via TCP to a chess program talking the UCI program (any will do: I connect it to a socket using "netcat").

This works pretty good!

For example: stockfish, toga2, fruit and glaurung all running on raspberry pies (700MHz ARM processors) versus fairymax running by itself on a Core I7 3930K processor (3.2GHz):

Code: Select all

[Event "Computer Chess Game"]
[Site "www.vanheusden.com"]
[Date "2013.10.31"]
[Round "-"]
[White "PuppetMaster/799"]
[Black "Fairy-Max 4.8Q"]
[Result "1-0"]
[TimeControl "40/300"]
[Annotator "1... +0.15"]

1. Nf3 d6 {+0.15/9 7} 2. Nc3 c5 {+0.18/9 8} 3. e4 Nf6 {+0.11/9 5} 4. Bc4
Nc6 {-0.07/9 4} 5. O-O Nxe4 {+0.04/9 7} 6. Nxe4 d5 {-0.09/11 12} 7. Qe2
dxe4 {-0.05/10 4} 8. Qxe4 e6 {-0.04/8 4} 9. d3 Be7 {+0.19/9 7} 10. Bf4 Qb6
{+0.37/9 5} 11. Rab1 f5 {+0.53/10 8} 12. Qe2 Na5 {+0.48/11 7} 13. Bg5 Bxg5
{+0.81/12 7} 14. Nxg5 Nxc4 {+0.73/12 11} 15. dxc4 O-O {+0.53/11 10} 16.
Rfd1 a5 {+0.26/10 6} 17. Qe5 Ra6 {+0.28/11 5} 18. Rd3 h6 {+0.33/9 4} 19.
Nf3 Qb4 {+0.29/11 5} 20. Rbd1 Qb6 {+0.01/11 5} 21. Nh4 Ra8 {+0.09/10 5} 22.
Ng6 Rf6 {-2.44/11 7} 23. Rb3 Qa6 {-2.35/11 4} 24. Rd8+ Kh7 {-79.96/16 4}
25. Rh8+ Kxg6 {-79.97/28 0.1} 26. Rg3+ Kh5 {-79.98/28 0.1} 27. Qf4 Qxc4
{-79.99/28 0.1} 28. Qg5#
{Xboard adjudication: Checkmate} 1-0
same setup but using gnuchess instead of fairymax:

Code: Select all

[Event "Computer Chess Game"]
[Site "www.vanheusden.com"]
[Date "2013.10.31"]
[Round "-"]
[White "PuppetMaster/799"]
[Black "GNU Chess"]
[Result "0-1"]
[TimeControl "40/300"]
[Annotator "1... -0.12"]

1. Nf3 Nf6 {-0.12/14 14} 2. d4 e6 {-0.05/13 9} 3. Nc3 d5 {-0.09/13 6} 4. e3
Bb4 {-0.12/13 14} 5. Bd3 c5 {-0.06/13 0.8} 6. O-O c4 {+0.04/14 1.2} 7. Be2
Bxc3 {+0.00/14 1.6} 8. bxc3 Qa5 {+0.13/14 4} 9. Bb2 Ne4 {+0.07/14 9} 10.
Qe1 Nc6 {+0.00/13 3} 11. Nd2 Nxc3 {+0.22/13 9} 12. Bf3 Na4 {+0.57/14 4} 13.
Ba3 b5 {+0.52/13 0.5} 14. Rc1 Qc3 {+0.69/13 2.7} 15. Bd6 Ba6 {+0.86/13 0.1}
16. Qd1 Rd8 {+0.86/13 5} 17. Bc7 Rd7 {+1.11/14 11} 18. Bf4 Nb4
{+1.21/13 10} 19. Nb1 Qa1 {+1.22/14 8} 20. Qe1 Nxa2 {+1.46/14 3} 21. Rd1 c3
{+1.46/14 5} 22. Qe2 Nb4 {+1.54/13 3} 23. e4 Qa2 {+1.70/13 12} 24. exd5
Nxd5 {+1.67/13 10} 25. Be5 O-O {+1.78/13 2.4} 26. Be4 Rfd8 {+1.67/12 19}
27. Qd3 h6 {+1.60/12 11} 28. Bxd5 Qxd5 {+1.37/13 4} 29. Qg3 f6 {+1.72/15 8}
30. Bxf6 Rf8 {+1.92/15 4} 31. Be5 b4 {+1.99/15 2.9} 32. Rfe1 Nb2
{+1.99/14 4} 33. Rc1 Nc4 {+2.05/13 9} 34. Rcd1 Rf5 {+2.50/13 15} 35. Bb8
Bb7 {+2.62/13 6} 36. f3 Rg5 {+2.96/14 22} 37. Qh3 Qxf3 {+3.65/14 15} 38.
Bg3 Qf5 {+3.79/14 5} 39. Qxf5 exf5 {+3.90/13 9} 40. Re8+ Kh7 {+4.16/14 9}
41. d5 Rxd5 {+4.62/14 6} 42. Rde1 Rd4 {+4.86/14 9} 43. Rb8 Rd7
{+5.42/14 12} 44. Rf8 h5 {+5.56/13 11} 45. Rb8 Rg4 {+6.30/13 11} 46. Rbe8
Be4 {+6.70/12 10} 47. Rb8 a5 {+7.54/14 9} 48. Rc8 Bxc2 {+8.08/13 1.4} 49.
Nxc3 bxc3 {+8.00/12 0.1} 50. Bf2 Bb3 {+11.54/14 25} 51. Rb8 a4
{+11.99/14 4} 52. Rbe8 c2 {+13.74/14 6} 53. R8e2 Re4 {+14.18/14 3} 54. Rxc2
Bxc2 {+19.90/13 2.3} 55. Ra1 a3 {+20.37/15 2.8} 56. Bc5 Rd1+ {+21.99/13 3}
57. Rxd1 Bxd1 {+99.83/13 0.1} 58. Bxa3 Re1+ {+99.85/12 12} 59. Kf2 Re2+
{+99.87/15 0.1} 60. Kg3 h4+ {+99.89/22 0.3} 61. Kxh4 Rxg2 {+99.93/53 8} 62.
Kh3 Rg4 {+99.95/51 2.7} 63. Bc5 Bf3 {+99.97/49 7} 64. Bg1 Bg2#
{+99.99/44 2.4}
{Xboard adjudication: Checkmate} 0-1
and last but not least: against crafty:

Code: Select all

[Event "Computer Chess Game"]
[Site "www.vanheusden.com"]
[Date "2013.10.31"]
[Round "-"]
[White "PuppetMaster/799"]
[Black "Crafty-23.4"]
[Result "0-1"]
[TimeControl "40/300"]
[Annotator "1... +0.35"]

1. Nf3 d6 {+0.35/18 10} 2. Nc3 e6 {+0.34/18 1.4} 3. d4 Nf6 {+0.34/19 8} 4.
e4 Be7 5. Bd3 Nc6 {+0.41/18 8} 6. O-O O-O 7. h3 Nb4 {+0.16/17 8} 8. Bg5
Nxd3 {-0.09/18 8} 9. Qxd3 h6 10. Bf4 b6 {-0.20/17 8} 11. a4 a5 {-0.31/18 9}
12. d5 Qd7 {-0.34/17 8} 13. Rfe1 e5 {-0.32/18 9} 14. Bd2 Ba6 {-0.40/18 1.8}
15. Nb5 Bb7 {-0.36/18 2.8} 16. Na3 c6 {-0.53/19 9} 17. Nc4 Qc7 {-1.23/19 9}
18. dxc6 Qxc6 19. Be3 Ra6 20. b3 Qxe4 {-1.64/18 9} 21. Nxb6 Qxd3
{-2.07/21 12} 22. cxd3 Bxf3 {-2.06/22 6} 23. gxf3 d5 {-2.31/22 5} 24. d4 e4
25. Nxd5 Nxd5 26. fxe4 Nxe3 {-2.55/21 5} 27. Rxe3 Rb6 28. Rd3 Rfb8
{-3.16/21 7} 29. Rb1 Rb4 {-3.22/21 7} 30. Kg2 Rxa4 {-3.33/22 12} 31. bxa4
Rxb1 {-3.74/22 8} 32. e5 Ra1 {-3.92/21 7} 33. d5 Rxa4 {-3.98/20 9} 34. Rc3
Bh4 {-4.50/20 14} 35. d6 Kh7 {-4.88/21 9} 36. Rd3 Kg6 {-4.83/24 9} 37. d7
Bd8 38. Rg3+ Kf5 39. Rxg7 Ke6 40. Rh7 Rh4 {-5.76/22 15} 41. Rg7 a4
{-6.46/22 8} 42. Rg3 Rd4 43. f4 Rxf4 {-7.46/21 8} 44. Rc3 Rd4
{-7.46/21 2.5} 45. Rc6+ Kxe5 46. Ra6 Be7 {-7.46/21 8} 47. Kf3 a3
{-8.44/19 9} 48. Rxh6 Ra4 {-10.90/17 8} 49. Rc6 a2 {-11.77/18 8} 50. Rc1
a1=Q {-12.46/18 18} 51. Rxa1 Rxa1 {-12.98/18 0.1} 52. Kg3 Rd1
{-327.50/17 4} 53. Kf3 Rd3+ 54. Kf2 Bh4+ {-327.54/13 0.1} 55. Kf1 Rxd7
{-327.56/11 0.1} 56. Kg1 Ke4 57. Kg2 Rd3 58. Kf1 Kf3 59. Kg1 Rd1+ 60. Kh2
Bg3#
{Xboard adjudication: Checkmate} 0-1

flok

Re: raspberry pi cluster versus fairymax

Post by flok » Sun Nov 03, 2013 6:07 pm

If anyone wants to play against it: it is now playing on H.G. Muller's website under the name "PuppetMaster".

Currently it has the following drones:

Code: Select all

# 192.168.62.254:55223 # stockfish on incontrol
# 192.168.39.2:55223 # toga2 on fork
# 192.168.62.129:55223 # fruit on weerpi
# 192.168.64.168:55223 # glaurung on detijd
# 192.168.64.18:55223 # minkochess on hetlicht
# 192.168.62.136:55223 # bikjump on slaapkamer
These are all raspberry pi's model b. "slaapkamer" is not literally in my bed room. It was supposed to be but I got complaints so now it is in the living room.

As you see only UCI capable engines although in theory xboard should work as well. Well more or less: the engine needs to support "setboard". And also gnuchess has this strange 5 second delay at start which goofs up time management.


regards

laoliveirajr
Posts: 138
Joined: Tue Sep 25, 2012 9:39 pm
Location: Brasilia DF Brazil
Contact:

raspberry pi cluster

Post by laoliveirajr » Sat Nov 16, 2013 3:12 am

Hello Folkert,

For some time I think riding a cluster, as a way to parallelize the my chess engine, but I have no financial resources "to spend only a hobby."

After reading this thread I started to have some hope, because with Raspberry Pis, the cost per node would drop considerably.

But first of all I need to know a few things:
- What operating system are you using?
- What is the mode you use to parallelize the application? MPI, OpenSSI, OpenMosix or another, what?
- How has your cluster nodes? I can only get a few, but I know I can go slowly adding nodes, while I develop the project ...

Another thing, how do you integrate the cluster to another network? (Obviusly I use a router, but the question is:) Do you run the engine in console mode in the cluster, with a GUI on another machine on another network?

I'm anxiously awaiting the arrival of the first Raspberry Pi , by postal mail , ordered this week . This will be the first own case , keyboard, mouse , TV and everything, the others are stacked in towers of Raspberry Pi.

best
Lourenço.

flok

Re: raspberry pi cluster

Post by flok » Sun Nov 17, 2013 11:07 am

Hi,

My RPIs run Debian Linux but that should not matter too much.
What I do is: my DBP has a "puppet master" mode where it does not do any calculations itself but connects using tcp to an xboard or uci engine which is listening on such a tcp socket. Then it is the usual uci/xboard communication.
Further more: my cluster consists of all kinds of chess engines combined. Each is asked a certain position and then the most chosen (or a random one) is used.
So it is not DBP spreading its calculations over multiple nodes.

Post Reply