Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 9 additions & 21 deletions easybuild/easyblocks/h/hpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -137,24 +134,15 @@ 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

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}'
self.log.warning("MPI tests disabled from buildoption. Skipping tests")
return

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

Expand Down
Loading