diff --git a/bin/donkey_benchmark_wrapper.py b/bin/donkey_benchmark_wrapper.py index 8e5740c800582e1f31ede4530e8da7d60429c431..b9158f416baa267a926f2134d4c4f870c90ef546 100755 --- a/bin/donkey_benchmark_wrapper.py +++ b/bin/donkey_benchmark_wrapper.py @@ -6,7 +6,7 @@ import os # Run the actual command command = "srun -p haswell10c -n 20 -c 2 --cpu_bin=verbose,core".split() -command.append(sys.argv[1]) +command.extend(sys.argv[1:]) ret = subprocess.call(command) # If that failed - fail! diff --git a/python/dune/perftool/error.py b/python/dune/perftool/error.py index 4d428b41b516845c3eb18803539edbf293f44cf1..fb77655aef3689b27b2764d76a3e20c158cbf982 100644 --- a/python/dune/perftool/error.py +++ b/python/dune/perftool/error.py @@ -19,3 +19,7 @@ class PerftoolLoopyError(PerftoolError): class PerftoolVectorizationError(PerftoolCodegenError): pass + + +class PerftoolAutotuneError(PerftoolVectorizationError): + pass diff --git a/python/dune/perftool/sumfact/autotune.py b/python/dune/perftool/sumfact/autotune.py index 41a8ff141a6614a3ba1bf28ff2556cd3d2ac87d2..244873c24b0b64cd61f8b04a6c66500599b15670 100644 --- a/python/dune/perftool/sumfact/autotune.py +++ b/python/dune/perftool/sumfact/autotune.py @@ -4,6 +4,7 @@ from dune.perftool.generation import cache_restoring, delete_cache_items from dune.perftool.loopy.target import DuneTarget from dune.perftool.sumfact.realization import realize_sumfact_kernel_function from dune.perftool.options import get_option, set_option +from dune.perftool.error import PerftoolAutotuneError import loopy as lp from pytools import product @@ -203,7 +204,8 @@ def autotune_realization(sf): generate_standalone_code(sf, filename) ret = subprocess.call(compiler_invocation(name, filename)) - assert ret == 0 + if ret != 0: + raise PerftoolAutotuneError("Compilation of autotune executable failed. Invocation: {}".format(" ".join(compiler_invocation(name, filename)))) # Check whether the user specified an execution wrapper call = [] @@ -216,7 +218,8 @@ def autotune_realization(sf): call.append(logname) devnull = open(os.devnull, 'w') ret = subprocess.call(call, stdout=devnull, stderr=subprocess.STDOUT) - assert ret == 0 + if ret != 0: + raise PerftoolAutotuneError("Execution of autotune benchmark failed. Invocation: {}".format(" ".join(call))) # Extract the result form the log file return float(next(iter(open(logname, "r")))) / 1000000