diff --git a/OpenBench/templatetags/mytags.py b/OpenBench/templatetags/mytags.py index 97d6cf0..7b8f0fa 100644 --- a/OpenBench/templatetags/mytags.py +++ b/OpenBench/templatetags/mytags.py @@ -155,9 +155,6 @@ def prettyDevName(test): return prettyName(test.dev.name) -def testIsFRC(test): - return "FRC" in test.book_name.upper() or "960" in test.book_name.upper() - def testIdToPrettyName(test_id): return prettyName(OpenBench.models.Test.objects.get(id=test_id).dev.name) @@ -215,7 +212,6 @@ register.filter('sumAttributes', sumAttributes) register.filter('insertCommas', insertCommas) register.filter('prettyName', prettyName) register.filter('prettyDevName', prettyDevName) -register.filter('testIsFRC', testIsFRC) register.filter('testIdToPrettyName', testIdToPrettyName) register.filter('testIdToTimeControl', testIdToTimeControl) register.filter('cpuflagsBlock', cpuflagsBlock) @@ -356,6 +352,19 @@ def git_diff_text(workload, N=24): return '%s vs %s' % (dev_name, base_name) + +def test_is_smp_odds(test): + dev_threads = int(OpenBench.utils.extract_option(test.dev_options , 'Threads')) + base_threads = int(OpenBench.utils.extract_option(test.base_options, 'Threads')) + return dev_threads != base_threads + +def test_is_time_odds(test): + return test.dev_time_control != test.base_time_control + +def test_is_fischer(test): + return 'FRC' in test.book_name.upper() or '960' in test.book_name.upper() + + register.filter('spsa_param_digest', spsa_param_digest) register.filter('spsa_original_input', spsa_original_input) register.filter('spsa_optimal_values', spsa_optimal_values) @@ -367,3 +376,7 @@ register.filter('workload_url', workload_url) register.filter('workload_pretty_name', workload_pretty_name) register.filter('git_diff_text', git_diff_text) + +register.filter('test_is_smp_odds' , test_is_smp_odds ) +register.filter('test_is_time_odds' , test_is_time_odds ) +register.filter('test_is_fischer' , test_is_fischer ) \ No newline at end of file diff --git a/OpenBench/workloads/get_workload.py b/OpenBench/workloads/get_workload.py index 7e45f53..86f0738 100644 --- a/OpenBench/workloads/get_workload.py +++ b/OpenBench/workloads/get_workload.py @@ -149,21 +149,19 @@ def valid_assignment(machine, test, distribution): # Extract the information from our machine threads = machine.info['concurrency'] - sockets = machine.info['sockets'] - # hyperthreads = machine.info['physical_cores'] < threads + hyperthreads = machine.info['physical_cores'] < threads + + # For core-odds tests, disable hyperthreads, by halving the thread count + if hyperthreads and dev_threads != base_threads: + threads = threads // 2 # SPSA plays a pair at a time, not a game at a time is_spsa = test.test_mode == 'SPSA' - is_sprt = test.test_mode != 'SPSA' - # Refuse if there are not enough threads-per-socket for the test - if (1 + is_spsa) * max(dev_threads, base_threads) > (threads / sockets): + # Refuse if there are not enough threads for the test + if (1 + is_spsa) * max(dev_threads, base_threads) > threads): return False - # # Refuse thread odds if we are using hyperthreads - # if dev_threads != base_threads and hyperthreads: - # return False - # Refuse to assign more workers than the test will allow current_workers = distribution[test.id]['workers'] if test.id in distribution else 0 if test.worker_limit and current_workers >= test.worker_limit: @@ -320,18 +318,24 @@ def extract_option(options, option): def game_distribution(test, machine): - # Every Option contains Threads= for both engines dev_threads = int(extract_option(test.dev_options, 'Threads')) base_threads = int(extract_option(test.base_options, 'Threads')) - # "concurrency" is the total number of connected Threads worker_threads = machine.info['concurrency'] worker_sockets = machine.info['sockets'] - # Concurrency per cutechess, if splitting by sockets - concurrency = (worker_threads // worker_sockets) // max(dev_threads, base_threads) + # For core-odds tests, disable hyperthreads, by halving the thread count + if machine.info['physical_cores'] < worker_threads and dev_threads != base_threads: + worker_threads = worker_threads // 2 - # Number of params being evaluated at a single time + # Ignore sockets for concurrent cutechess, when playing with more than one thread + if max(dev_threads, base_threads) > 1: + worker_sockets = 1 + + # Max possible concurrent engine games, per copy of cutechess + max_concurrency = (worker_threads // worker_sockets) // max(dev_threads, base_threads) + + # Number of params being evaluated at a single time, if doing SPSA in SINGLE mode spsa_count = (worker_threads // max(dev_threads, base_threads)) // 2 # SPSA is treated specially, if we are distributing many parameter sets at once @@ -339,6 +343,6 @@ def game_distribution(test, machine): return { 'cutechess-count' : spsa_count if is_multiple_spsa else worker_sockets, - 'concurrency-per' : 2 if is_multiple_spsa else concurrency, - 'games-per-cutechess' : 2 * test.workload_size * (1 if is_multiple_spsa else concurrency), + 'concurrency-per' : 2 if is_multiple_spsa else max_concurrency, + 'games-per-cutechess' : 2 * test.workload_size * (1 if is_multiple_spsa else max_concurrency), } diff --git a/Templates/OpenBench/Blocks/testsummary.html b/Templates/OpenBench/Blocks/testsummary.html index 68f5623..c4c10fd 100644 --- a/Templates/OpenBench/Blocks/testsummary.html +++ b/Templates/OpenBench/Blocks/testsummary.html @@ -4,11 +4,12 @@ {{test|prettyDevName}} {% if test.error %} * {% endif %} - {% if test|testIsFRC %} * {% endif %} + {% if test|test_is_fischer %} * {% endif %} diff {{test.dev_time_control}} - {% if test.dev_time_control != test.base_time_control %} * {% endif %} + {% if test|test_is_time_odds %} * {% endif %} + {% if test|test_is_smp_odds %} * {% endif %} {{test|shortStatBlock|linebreaksbr}}