From 41bddb4c00b49160a6ae82cf138e8cfb5c3737b4 Mon Sep 17 00:00:00 2001 From: crivella Date: Wed, 10 Sep 2025 18:25:49 +0200 Subject: [PATCH 1/2] Switch to oversubscription by autogenerated by EB --- easybuild/easyblocks/h/hpl.py | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/easybuild/easyblocks/h/hpl.py b/easybuild/easyblocks/h/hpl.py index 7dccc70e260..771d561fcc0 100644 --- a/easybuild/easyblocks/h/hpl.py +++ b/easybuild/easyblocks/h/hpl.py @@ -125,9 +125,6 @@ def test_step(self): srcdir = os.path.join(self.cfg['start_dir'], 'bin', 'UNKNOWN') change_dir(srcdir) - pre_cmd = "" - post_cmd = "" - # xhpl needs atleast 4 processes to run the test suite req_cpus = 4 @@ -140,21 +137,12 @@ def test_step(self): self.log.info("MPI tests disabled from buildoption. Setting parallel to 1") parallel = 1 - if parallel < req_cpus: - self.log.info("Running tests with 1 oversubscribed process") - - pin_str = ','.join(["0"] * req_cpus) - if mpi_fam in [toolchain.INTELMPI]: - pre_cmd = f"I_MPI_PIN_PROCESSOR_LIST=\"{pin_str}\" I_MPI_PIN=on " - elif mpi_fam in [toolchain.OPENMPI]: - post_cmd = f"--cpu-set {pin_str}" - elif mpi_fam in [toolchain.MPICH]: - post_cmd = f"-bind-to user:{pin_str}" - else: - self.report_test_failure("Don't know how to oversubscribe for `%s` MPI family" % mpi_fam) - - cmd = self.toolchain.mpi_cmd_for(f'{post_cmd} ./xhpl', req_cpus) - cmd = f'{pre_cmd} {cmd}' + oversubscribe = parallel < req_cpus + + try: + cmd = self.toolchain.mpi_cmd_for(f'./xhpl', req_cpus, oversubscribe=oversubscribe) + except EasyBuildError as err: + self.report_test_failure(f"Could not create MPI command to run xhpl: {err}") res = run_shell_cmd(cmd) out = res.output From 6f4141a1804182c1a7de07a84a15a56d4649a4a7 Mon Sep 17 00:00:00 2001 From: crivella Date: Tue, 16 Sep 2025 10:30:35 +0200 Subject: [PATCH 2/2] Properly avoid running MPI tests since we are not doing pinning anymore --- easybuild/easyblocks/h/hpl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/h/hpl.py b/easybuild/easyblocks/h/hpl.py index 771d561fcc0..e50d0e4b31b 100644 --- a/easybuild/easyblocks/h/hpl.py +++ b/easybuild/easyblocks/h/hpl.py @@ -134,8 +134,8 @@ def test_step(self): parallel = self.cfg.parallel if not build_option('mpi_tests'): - self.log.info("MPI tests disabled from buildoption. Setting parallel to 1") - parallel = 1 + self.log.warning("MPI tests disabled from buildoption. Skipping tests") + return oversubscribe = parallel < req_cpus