diff --git a/expetator/benchmarks/npbbench.py b/expetator/benchmarks/npbbench.py index de4ee1e9915da40fd1d1241aba3ebf0ff25c1dac..a3e24bcdd72aa096d5271dcd26edfe5fd6543bf0 100644 --- a/expetator/benchmarks/npbbench.py +++ b/expetator/benchmarks/npbbench.py @@ -1,5 +1,6 @@ import os import re +import math def standard_parameters(nbproc): if nbproc < 16: @@ -16,6 +17,38 @@ def standard_parameters(nbproc): 'is':'E', 'ft':'E', 'lu':'D', 'mg':'D'} + + +def test_lu(nb): + xdim = int(math.sqrt(nb)) + ydim = nb // xdim + while(xdim*ydim != nb and 2*ydim >= xdim): + xdim += 1 + ydim = nb // xdim + return xdim*ydim == nb and 2*ydim >= xdim + +def get_lu(nb): + val = max(nb, 1) + while(not test_lu(val)): + val -= 1 + return val + + +def get_square(nb): + tmp = int(math.sqrt(nb)) + return tmp*tmp + +def get_power_of_2(i): + return 2**int(math.log2(i)) + +def npb_constraints(name, nbproc): + if name in ['cg', 'is']: + return get_power_of_2(nbproc) + if name in ['lu']: + return get_lu(nbproc) + return nbproc # for 'ep', 'bt', 'sp', 'ft', 'mg' + + class NpbBench: 'Nas Parallel Benchmark' def __init__(self, names={'ep', 'bt', 'sp', 'cg', 'is', 'ft', 'lu', 'mg'}, @@ -42,13 +75,15 @@ class NpbBench: executor.local('cp /tmp/NPB3.4-MPI/bin/* /tmp/bin/') for key in self.params: - self.params[key] = [(self.params[key], nbproc)] + self.params[key] = [(self.params[key], npb_constraints(key, nbproc))] return self.params def run(self, bench, params, executor): """Runner for NPB benchmarks """ classtype, nbproc = params - output = executor.cores('/tmp/bin/%s.%s.x' % (bench, classtype)) + output = executor.mpi('/tmp/bin/%s.%s.x' % (bench, classtype), + executor.mpi_core_file, nbproc) + execution_time = float(re.search(' Time in seconds = *(.*)', output).group(1)) benchname = bench+'-'+classtype+'-'+str(nbproc) return execution_time, benchname diff --git a/expetator/experiment.py b/expetator/experiment.py index 6e8b9972ae9bd02f9578857b87411667b1c95cb8..fecbbe8a9bbd969d9bb1c6437b992233be72b61f 100755 --- a/expetator/experiment.py +++ b/expetator/experiment.py @@ -30,7 +30,7 @@ class Executor: self.hostnames = reduce(lambda l, x: l if x in l else l+[x], content, []) self.nbcores = len(content) self.nbhosts = len(self.hostnames) - self.mpi_options = '--mca orte_rsh_agent oarsh' + self.mpi_options = '--map-by node --mca orte_rsh_agent oarsh' self.sudo = 'sudo-g5k' self.ssh = 'oarsh' diff --git a/setup.py b/setup.py index b49532308a24f7fe05adc17d6e13af093a854a65..399f3c3573ace08e6af9dfe0ea09860386ab7591 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", "r") as fh: setuptools.setup( name="expetator", - version="0.2.7", + version="0.2.8", author="Georges Da Costa", author_email="georges.da-costa@irit.fr", description="A framework for monitoring HPC applications using DVFS",