Use of OMP_NUM_THREADS

Hello,

I think it would be nice to use the OMP_NUM_THREADS environment setting to effectively limit the number of cores in the benchmarks. Or any other means to define it without having to write an entire custom config file.

@giordano Are there any plans to make something like OMP_NUM_THREADS available to limit the number of cores.

In the new version of hepscore (v2.0) the number of cores will be limited using a parameter --ncores.
It can be already tested in the release candidate v2.0rc6

I’ve just tried v2.0rc6 and specifying --ncores makes the benchmark fail. Running without this option is fine.

2024-04-10 12:50:22 hepscore._run_benchmark() [INFO] Starting run2
2024-04-10 12:50:22 hepscore._run_benchmark() [DEBUG] Running  ['singularity', 'run', '-i', '-c', '-e', '-B', '/tmp/tmp.kVX8vTGrFL/HEPscore_10Apr2024_124939/atlas-gen_sherpa-ma-bmk/run2:/results', '-B', '/tmp/tmp.kVX8vTGrFL/HEPscore_10Apr2024_124939/tmp:/tmp', '-B', '/tmp/tmp.kVX8vTGrFL/HEPscore_10Apr2024_124939/tmp:/var/tmp', 'oras://gitlab-registry.cern.ch/hep-benchmarks/hep-workloads-sif/atlas-gen_sherpa-ma-bmk:v2.0_x86_64', '-W', '--ncores', '64', '--threads', '1', '--events', '200']
2024-04-10 12:50:37 hepscore._check_return_code() [DEBUG] singularity terminated without errors
2024-04-10 12:50:37 hepscore._run_benchmark() [INFO] 
2024-04-10 12:50:37 hepscore._proc_results() [DEBUG] Looking for results in []
2024-04-10 12:50:37 hepscore._proc_results() [WARNING] No results: fail
2024-04-10 12:50:37 hepscore.run() [DEBUG] Removing singularity unpack directory /tmp/tmp.kVX8vTGrFL/HEPscore_10Apr2024_124939/unpack
2024-04-10 12:50:37 hepscore.run() [ERROR] BENCHMARK FAILURE

Hi, could you please tell us the exact command you used to running it?

Being a release candidate, the workloads that support the new ncores featuer are not the default yet. You need to use a config file which specifies them (with -f) ot use one of the built-in configurations. The latter can be listed with -l and used with -b; using -b hepscore-ncores should do the trick.

Ah, I overlooked the need to specify a different configuration. Indeed, with -b hepscore-ncores selected, -n works fine. Thanks!