XB tourney manager

XBoard tourney-manager function

XBoard now has a built-in tournament manager. To have XBoard run a tourney, you have to create a tournament file. This can be done through the Match Options dialog. The tournament file is a special type of settings file, which contains all option settings needed to specify the tournament: the list of partcipating engines, the tournament type (round-robin, (multi-)gauntlet or Swiss), the number of games per pairing, the number of cycles, etc. For the rest a tournament behaves just like XBoard -matchMode, in fact it is just a special kind of match, where the games are chosen differently when there is a tournament file to specify how.

All the tourney parameters can also be specified from the command line, but that still would not cause XBoard to run a tourney. XBoard really needs a tournament file for that, because it uses the latter also for recording the progress of the tourney: which games have already been played (and how they ended), and which games are currently in progress.

As a consequence, a tourney that has been interrupted (by quitting XBoard) can be resumed, by re-starting XBoard with the existing tournament file:

xbooard -mm -tf MyTourney.trn
This will make XBoard pick up where it left off. Another consequence is that you can also have multiple instances of XBoard work on playing the tourney games. E.g. when you have a quad, and are playing single-CPU engines in ponder-off games, you only need one core per game, and can thus run four games simultaneously. By starting multiple instances of XBoard with the same tourney file, these instances will then cooperate on completing the tourney. Each one will 'grab' a game from the tourney file that has not yet been played and is not in progress, mark it as being in progress, and starts playing it. When it is done, it will replace the "in-progress" mark by the result, and grab the next game that has not had any attention yet, until the entire tourney is done. (There are options to delay starting games from a new round or cycle until the previous one has been completed.)

To specify the tourney, some new command-line options are defined in XBoard. These are -participants, (which holds a list of engines, one per line), -tourneyType, -tourneyCycles, and -results. The latter specifies which games have already been played, as a string of +-=* characters, where an asterisk means the game is currently in progress. The -tourneyType can be 0 for a round-robin, an integer N > 0 for (multi-)gauntlets, (where the first N participants of the list each play all others), or -N < 0 for N rounds of Swiss. (The latter is not yet implemented!).

The previously existing option -defaultMatchGames is used to indicate the number of games per pairing in a basic cycle of the tournament, so that the total number of games per pairing will be the product of the value of -defaultMatchGames and -tourneyCycles. The -loadGameFile and -loadPositionFile, and the corresponding index specification -loadGameIndex, -loadPositionIndex and -rewindIndex are used during the games of a pairing in the same way as they would be used in a simple match between two engines, and are also specified in the tourney file.

To start a tourney you can start XBoard with or without engine, and summon the Match Options dialog from the Options menu. There the most important thing you should do is specify a tournament file. If the file you specify already existed, it is all you have to specify, as all other settings will then be taken from that file (This is what you would do to resume an interrupted tourney.) If the file did not exist yet, it will be created as soon as you OK the dialog, but you have to complete the other parameters in the dialog first. Usually you will start picking the participants, and a combobox allows you to pick any installed engine as often as you want. The selected engines will be added to the displayed partcipants list. Remember this is a normal text edit, so that you can delete engines to correct mistakes, shuffle the order, etc. (Don't tryto type non-installed engines there, or change the names, though: they will not be recognized!) After 'OK' all the settings will be written on the specified tourney file, with -results last, (automatically set to an empty string, to indicate none of the games has been played yet), and XBoard will then switch to match mode to run the tourney.

Games played during the tourney will be saved as usual on the -saveGameFile, depending on your option settings for this. You don't have to save the PGN, if you don't want to.

-participants {glaurung
Fruit 2.1
Fairy-Max 4.8
Crafty 20.14
}
-tourneyType 0
-tourneyCycles 1
-defaultMatchGames 2
-syncAfterRound true
-syncAfterCycle true
-saveGameFile "tm.pgn"
-loadGameFile ""
-loadGameIndex 0
-loadPositionFile ""
-loadPositionIndex 1
-rewindIndex 0
-results "=-+*"

To the left you see an example of a tournament file of a (small) tourney in progress. Three games have been played, the fourth is in progress, as you can see in the -results string. When another XBoard instance starts a match with this tournament file specified, it will start playing the fifth game.

When you would quit the XBoard instance that is (apparently) playing game #4, it would change the result string to

-results "=+- *"
before it exits, indicating that game #4 is no longer in progress, but not yet played either. The XBoard instance that is still running (or a new one you start on this tournament file) will then grab it the next time.

Note that XBoard has no windows (yet?) to show you the standings or the cross table of the tournament. The idea is that there exist already plenty programs to generate those from the PGN file. When you let all XBoard instances save the games they play to the same file, (this XBoard version uses file locking to make sure this can't cause problems!), you can use your favorite PGN-to-cross-table utility on it any time you want.

Synchronization in concurrent play

When you use multiple instances of XBoard to concurrently work on playing a tourney, the option -syncAfterRound can be used to prevent XBoard from starting games from a new round, when there are still unfnished games of a previous round. XBoard will then wait until all these games are finished, and automatically resume after that with the game of the next round it already picked. This way you can guarantee that the rounds appear well-ordered in the PGN file. There is a similar option -syncAfterCycle. But as a cycle end coincides with the end of a round, this option is only meaningful when -syncAfterRound is false.