gnubg python scripting: set threads

Following last week, I will play with gnubg.

I want to finish the process as soon as possible when analyzing the match. It takes about 1 minute to run by default.

In <5> > gnubg.command('import mat 87027157.txt')
 GNU Backgammon  Position ID: AAAAunEAAAAAAA
                 Match ID   : 8AqgAFAAAAAE
 +13-14-15-16-17-18------19-20-21-22-23-24-+     O: mkisono
 |                  |   |                  |OOO 5 points
 |                  |   |                  | OOO
 |                  |   |                  | OOO
 |                  |   |                  | OOO
 |                  |   |                  | OOO
v|                  |BAR|                  |5 point match(Cube: 1)
 |                  |   |                  | X
 |                  |   |                  | X
 |                  |   | X           X    | X
 |                  |   | X        X  X    | X
 |                  |   | X        X  X  X |XX 0 points
 +12-11-10--9--8--7-------6--5--4--3--2--1-+     X: cwm7296g

In <10> > %time gnubg.command('analyse match')
CPU times: user 1min 6s, sys: 112 ms, total: 1min 7s
Wall time: 1min 7s

My PC is Ultimate Game Machine, so there are 8 cores. It is useless if it is not processed by multithreading.

In <11> > gnubg.command('analyse clear match')

In <12> > gnubg.command('set threads 8')
The number of threads has been set to 8.

In <13> > %time gnubg.command('analyse match')
CPU times: user 2min 18s, sys: 176 ms, total: 2min 18s
Wall time: 18.4 s

The analysis is finished at Mach!

Thread = 1 setting Screenshot from 2016-07-09 10:47:55.png

Thread = 8 setting Screenshot from 2016-07-09 10:49:26.png

By the way, you can also set the number of threads in the GUI. If anyone hasn't set it, I think it's better to increase this value.

Screenshot from 2016-07-09 10:50:55.png

There are many other options in gnubg that I would like to study.

Recommended Posts

gnubg python scripting: set threads
gnubg python scripting
gnubg python scripting: gnubg.match ()
gnubg python scripting: gnubg.findbestmove ()
Python set arithmetic
Python set arithmetic
Set up Python 3.4 on Ubuntu
Set Up for Mac (Python)
[Gimp] Start scripting in Python
Set python test in jenkins
Set python compile options with pyenv
[Python] ARC006A (set strongest theory) [AtCoder]
Set up Python environment on CentOS