From 795f1a05281b534806733d8cf940e71ce677a4d4 Mon Sep 17 00:00:00 2001 From: Andrew Grant Date: Wed, 18 Sep 2024 23:10:52 -0400 Subject: [PATCH] Correct massive flaws in Datagen genfens seeding --- Client/genfens.py | 9 ++++++++- Client/worker.py | 2 +- Config/config.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Client/genfens.py b/Client/genfens.py index 717d5c1..2fa355b 100644 --- a/Client/genfens.py +++ b/Client/genfens.py @@ -67,6 +67,13 @@ def genfens_book_input_name(config): return 'None' if book_none else os.path.join('Books', book_name) +def genfens_seed(config, N_per_thread, thread_index): + + x = config.workload['test']['book_seed'] + y = config.workload['test']['book_index'] + + return (x << 32) + (y + N_per_thread * thread_index) + def genfens_command_builder(binary, network, private, N, book, extra_args, seed): command = ['./%s' % (binary)] @@ -117,7 +124,7 @@ def create_genfens_opening_book(config, binary_name, network): processes = [ multiprocessing.Process( target=genfens_single_threaded, - args=(genfens_command_builder(*args, seed + ii * N), output)) + args=(genfens_command_builder(*args, genfens_seed(config, N, ii)), output)) for ii in range(config.threads) ] diff --git a/Client/worker.py b/Client/worker.py index 4ec0ade..55a7dfc 100644 --- a/Client/worker.py +++ b/Client/worker.py @@ -54,7 +54,7 @@ from genfens import create_genfens_opening_book ## Basic configuration of the Client. These timeouts can be changed at will -CLIENT_VERSION = 30 # Client version to send to the Server +CLIENT_VERSION = 31 # Client version to send to the Server TIMEOUT_HTTP = 30 # Timeout in seconds for HTTP requests TIMEOUT_ERROR = 10 # Timeout in seconds when any errors are thrown TIMEOUT_WORKLOAD = 30 # Timeout in seconds between workload requests diff --git a/Config/config.json b/Config/config.json index 87d5514..88f6776 100644 --- a/Config/config.json +++ b/Config/config.json @@ -1,5 +1,5 @@ { - "client_version" : 30, + "client_version" : 31, "client_repo_url" : "https://github.com/AndyGrant/OpenBench", "client_repo_ref" : "master",