forgot this in my last commit

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3958]
This commit is contained in:
Guillaume Raffy 2024-11-22 13:43:54 +01:00
parent 7976d67860
commit b8bb991abd
4 changed files with 17 additions and 2 deletions

View File

@ -4,6 +4,8 @@ from .version import __version__ as iprbench_version
import socket
import subprocess
import re
import os
import pwd
class MeasurementTime(IAutoParam):
@ -50,6 +52,16 @@ class HostFqdn(IAutoParam):
return socket.getfqdn()
class User(IAutoParam):
def __init__(self):
bench_param = BenchParam('user', BenchParam.Type.PARAM_TYPE_STRING, 'the user that triggered the benchmark (eg "root")')
super().__init__(bench_param)
def get_value(self) -> BenchParamType:
return pwd.getpwuid(os.getuid())[0]
class NumCpus(IAutoParam):
def __init__(self):

View File

@ -43,7 +43,8 @@ class BenchmarksTestCase(unittest.TestCase):
'blas_library': '<default-libblas>:<default>',
'matrix_size': 1024,
'num_loops': 10,
'num_cores': 2
'num_cores': 2,
'launcher': 'iprbench.unittest',
}
test_benchmark(benchmark_id, benchmark_config, self.results_root_dir)

View File

@ -40,6 +40,7 @@ class ClusterBenchTestCase(unittest.TestCase):
'blas_library': '<default-libblas>:<default>',
'matrix_size': 1024,
'num_loops': 10,
'launcher': 'iprbench.unittest',
}
test_clusterbench_submit_with_benchmark(benchmark_id, benchmark_config, self.results_root_dir)

View File

@ -24,7 +24,8 @@ def test_resultsdb(resultsdb_params: ResultsDbParams, results_root_path: Path):
'blas_library': '<default-libblas>:<default>',
'matrix_size': 1024,
'num_loops': 10,
'num_cores': 2
'num_cores': 2,
'launcher': 'iprbench.unittest',
}
command = f'iprbench-run --benchmark-id \'{benchmark_id}\' --config \'{json.dumps(benchmark_config)}\' --results-dir {results_dir} --resultsdb-params \'{json.dumps(resultsdb_params)}\''
subprocess.run(command, shell=True, check=True, executable='/bin/bash')