go-engine-tester
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -201,15 +201,27 @@ "use strict"; | ||
let processQueueTimer = setInterval(() => { | ||
if (processQueue.length < processQueueSize) { | ||
console.log("Filling process queue..."); | ||
let controller1 = new Controller(config1.command, config1.args, config1.spawnOptions); | ||
let controller2 = new Controller(config2.command, config2.args, config2.spawnOptions); | ||
controller1.start(); | ||
controller2.start(); | ||
processQueue.push({controller1: controller1, controller2: controller2}); | ||
} | ||
}, 500); | ||
let processQueueTimer = null; | ||
let initProcessQueueTimer = () => { | ||
processQueueTimer = setInterval(() => { | ||
if (processQueue.length < processQueueSize) { | ||
console.log("Filling process queue..."); | ||
let controller1 = new Controller(config1.command, config1.args, config1.spawnOptions); | ||
let controller2 = new Controller(config2.command, config2.args, config2.spawnOptions); | ||
controller1.start(); | ||
controller2.start(); | ||
processQueue.push({controller1: controller1, controller2: controller2}); | ||
} | ||
}, 500); | ||
}; | ||
(async () => { | ||
for (let i = 0; i < times; i++) { | ||
// Init the queue before the third game. We wait 2 games for the following reasons: | ||
// In the first game it may do GPU tuning, which seems better to be done in strict order | ||
// (not concurrently). | ||
// In the second game it's also likely to do tuning (if a model should be tuned for black | ||
// and white respectively). | ||
if (i === 2) { | ||
initProcessQueueTimer(); | ||
} | ||
await playGame(i % 2 === 1); | ||
@@ -216,0 +228,0 @@ console.log(`Game ${i} ended.`); |
{ | ||
"name": "go-engine-tester", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Go (围棋, 囲碁, 바둑) engine tester", | ||
@@ -5,0 +5,0 @@ "keywords": ["go", "engine", "test", "gtp", "bot", "weiqi", "baduk", "game"], |
13910
208