diff --git a/python/scripts/numa_speedup.py b/python/scripts/numa_speedup.py deleted file mode 100644 index a07c32446e06a0a5e6e6773083f81ce7f7500eff..0000000000000000000000000000000000000000 --- a/python/scripts/numa_speedup.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python3 -"""Run a speedup series benchmark of a given executable on a node with libnuma - -Usage: numa_speedup.py MIN_CORE MAX_CORE ARG_FMT... - -Arguments: - ARG_FMT A python format string to allow core count injection in args. - Example: 'mpirun -np {CORECOUNT} my_executable -global.datadir data_{CORECOUNT}' - MIN_CORE Start run at this many cores - MAX_CORE Stop run at this many cores -""" - -import subprocess -import numa -import docopt -import itertools -from collections import deque -from copy import deepcopy - - -def coremap(): - if not numa.available(): - raise RuntimeError("Numa not available") - node_to_core = {int(i): deque([int(k) for k in numa.node_to_cpus(i)]) for i in range(numa.get_max_node()+1)} - total_core = max(itertools.chain(*node_to_core.values())) + 1 - return node_to_core, total_core - - -def _single_run(cores, arg_fmt): - args = [a.format(CORES=cores, CORECOUNT=len(cores)) for a in arg_fmt] - corestring = ','.join([str(i) for i in cores]) - subprocess.call(['numactl', '-C', corestring] + args) - - -def _assign_core(node_to_core, core_count): - cores = [] - node_to_core = deepcopy(node_to_core) - nodes = deque([k for k in node_to_core.keys()]) - left = True - while core_count > 0: - if left: - cores.append(node_to_core[nodes[0]].popleft()) - else: - cores.append(node_to_core[nodes[0]].pop()) - left = not left - nodes.rotate(1) - core_count -= 1 - return cores - - -def run(min_core, max_core, arg_fmt): - node_to_core, total_cores = coremap() - core_count = min_core - max_core = min(max_core, total_cores) - while core_count <= max_core: - cores = _assign_core(node_to_core, core_count) - _single_run(cores, arg_fmt) - core_count *= 2 - - -if __name__ == '__main__': - arguments = docopt.docopt(__doc__) - min_core = int(arguments['MIN_CORE']) - max_core = int(arguments['MAX_CORE']) - arg_fmt = arguments['ARG_FMT'] - run(min_core, max_core, arg_fmt) diff --git a/python/setup.py b/python/setup.py index a98f62b6906d75315d9d37252c788db87cb165f2..d53fc6690164fce295f855d28b1d1aea2a6f3962 100644 --- a/python/setup.py +++ b/python/setup.py @@ -21,9 +21,8 @@ setup(name='dune.xt', author_email='dune-xt-dev@listserv.uni-muenster.de', url='https://github.com/dune-community/dune-xt-common', packages=['dune.xt'], - install_requires=['binpacking==1.3', 'cython', 'jinja2', 'numa', 'docopt'], + install_requires=['binpacking==1.3', 'jinja2'], scripts=['./scripts/generate_compare_functions.py', './scripts/distribute_testing.py', './scripts/dxt_code_generation.py', - './scripts/numa_speedup.py', './wrapper/dune_xt_execute.py'])