From 00afb8abe226740ae033da374ba500d99ffc47f1 Mon Sep 17 00:00:00 2001 From: mhouppin <45004383+mhouppin@users.noreply.github.com> Date: Sat, 6 Feb 2021 21:24:28 +0100 Subject: [PATCH] Make the Client use multiprocessed 'make' commands for engines that support it (#86) --- Client/Client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Client/Client.py b/Client/Client.py index 8f04e5d..5addd7e 100644 --- a/Client/Client.py +++ b/Client/Client.py @@ -211,7 +211,7 @@ def getMachineID(): print('[NOTE] Machine Is Unregistered') return 'None' -def getEngine(data, engine, network): +def getEngine(arguments, data, engine, network): print('Engine {0}'.format(data['test']['engine'])) print('Branch {0}'.format(engine['name'])) @@ -241,6 +241,9 @@ def getEngine(data, engine, network): if data['test']['engine'] in CUSTOM_SETTINGS: command.extend(CUSTOM_SETTINGS[data['test']['engine']]['args']) + # Allow for multiprocessed build up to the number of requested threads + command.append('-j' + arguments.threads) + # Build the engine. If something goes wrong with the # compilation process, we will figure this out later on subprocess.Popen(command, cwd=pathway).wait(); print("") @@ -494,7 +497,7 @@ def verifyEngine(arguments, data, engine, network): # Download the engine if we do not already have it name = savedEngineName(engine['sha'], network) pathway = addExtension(pathjoin('Engines', name).rstrip('/')) - if not os.path.isfile(pathway): getEngine(data, engine, network) + if not os.path.isfile(pathway): getEngine(arguments, data, engine, network) # Run a group of benchmarks in parallel in order to better scale NPS # values for this worker. We obtain a bench and average NPS value