find mpi exec (#42050)

This commit is contained in:
Angel Castillo 2024-01-11 14:31:06 -05:00 committed by GitHub
parent 19c0208c1a
commit 63ba7db2d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
import warnings
class Pumi(CMakePackage):
@ -125,7 +126,14 @@ def test(self):
description = "testing pumi uniform mesh refinement"
self.run_test(exe, options, expected, purpose=description)
mpiexec = self.spec["mpi"].prefix.bin.mpiexec
mpiexec = ""
mpiexe_list = ["mpirun", "mpiexec", "srun"]
for mpiexe in mpiexe_list:
if which(mpiexe) is not None:
mpiexec = Executable(mpiexe).command
break
if mpiexec == "":
warnings.warn("MPI exec not found")
data_dir = self.prefix.share.testdata
options = [
"-n",