Skip to content

Client server communication

Gianluca Amato edited this page Oct 28, 2019 · 2 revisions

The client program is autogtp. When launched, it will connect to SAI server, get a task to do (self-play or match games) and start playing games. At the end of each game, the client will upload the game data to the server and start a new task.

To play these games, the client will download the needed networks (these will be the large .gz files in the networks subdirectory), and repeatedly execute SAI main program, sai.

For the client to work properly, you need credentials, which must be supplied to it, and which are checked when getting a task and when uploading games data. If you see an error from autogtp, in particular if you get

      Upload failed. Curl Exit code: 22

it usually means that there is a problem with your credentials.

Basic usage

The client program autogtp may be used from the command line. autogtp --help will show the available options and parameters. You need at least to provide --url --username and --password. The typical command would be something like

   autogtp  --url http://sai.unich.it/ --username <computername> --password <password> <other_params>

Under Windows, this can be done smoothly simply running the script sai.hta included inside the zip file. (It might ask you authorization for this operation; if so please grant it.)

Under Linux and macOS, you must be sure that sai executable location is included in the PATH environment variable, or that it is in the same directory from where you are launching autogtp.

How to stop

The client autogtp can be terminated at any time with Ctrl-C. Better yet, if you press q and then enter, autogtp will exit saving progress, so that it can resume when you run it the next time.

Internet connection

Communication from the client to the server happens only at the beginning and at the end of each game. You must be connected to the internet in those moments.

See your games

A single game will typically last for 250-400 moves, with exceptions. The moves are regularly displayed during these games (so that you can check progress), but without a simulation of the goban. If you want to see your contributed games, you can find the most recent ones on the main SAI page; follow these indications. Another possibility is to ask autogtp to save locally the sgf's of its games. This is done with the option -k <savedir>. Then you can see the games with any sgf viewer.

Multiple games

If your computer is quite powerful, playing one game at a time will use just a fraction of its potential. If you want to try more, it is possible and suggested to ask autogtp to play more than one game at the same time. This is done with the option -g<n>, where <n> is the desired number of games (default 1). For example, on a computer with a NVIDIA GTX 1080 GPU, you can use -g6 or even -g8, in particular until the networks are small.

It may be difficult to tell if you are providing more or less games per unit of time, when you change this option, because each game is slower, but you are doing more than one at the same time. The number to look for is the average time per move, measured in ms/move (the lower the better). You can experiment with the -g option until you find the value for which you get the best performance.

243 ms/move

Beware! During match games the performance is different (and worst) than during self-play games, because autogtp needs to use two instances of sai for each game.

Clone this wiki locally