Skip to content

Commit a527d2e

Browse files
committed
fix: use shared MPI config in coverage cache builder
The coverage cache builder had its own hardcoded MPI launcher detection that ignored the -c <computer> passthrough. On systems where flux is required (e.g. Tuolumne), it would silently use mpirun instead. Now uses _get_mpi_config() and _mpi_cmd() from case.py, consistent with TestCase.run().
1 parent 537014d commit a527d2e

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

toolchain/mfc/test/coverage.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,8 @@ def _run_single_test_direct(test_info: dict, gcda_dir: str, strip: str) -> tuple
310310

311311
env = {**os.environ, "GCOV_PREFIX": test_gcda, "GCOV_PREFIX_STRIP": strip}
312312

313-
# MPI-compiled binaries must be launched via an MPI launcher (even ppn=1).
314-
# Use --bind-to none to avoid binding issues with concurrent launches.
315-
if shutil.which("mpirun"):
316-
mpi_cmd = ["mpirun", "--bind-to", "none", "-np", str(ppn)]
317-
elif shutil.which("srun"):
318-
mpi_cmd = ["srun", "--ntasks", str(ppn)]
319-
else:
320-
raise MFCException("No MPI launcher found (mpirun or srun). MFC binaries require an MPI launcher.\n On Ubuntu: sudo apt install openmpi-bin\n On macOS: brew install open-mpi")
313+
# Use the same MPI config as TestCase.run() so -c <computer> is respected.
314+
from .case import _get_mpi_config, _mpi_cmd
321315

322316
failures = []
323317
for target_name, bin_path in binaries:
@@ -336,7 +330,8 @@ def _run_single_test_direct(test_info: dict, gcda_dir: str, strip: str) -> tuple
336330
failures.append((target_name, "missing-inp", f"{inp_file} not found before launch"))
337331
break
338332

339-
cmd = mpi_cmd + [bin_path]
333+
cfg = _get_mpi_config()
334+
cmd = _mpi_cmd(cfg, ppn, bin_path)
340335
try:
341336
result = subprocess.run(cmd, check=False, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env, cwd=test_dir, timeout=600)
342337
if result.returncode != 0:

0 commit comments

Comments
 (0)