Compare commits

...

7 Commits

Author SHA1 Message Date
Cameron Smith
9dead10d70 fix style 2024-01-11 19:21:57 -05:00
Angel Castillo
63ba7db2d2
find mpi exec (#42050) 2024-01-11 14:31:06 -05:00
Cameron Smith
19c0208c1a pumi: fix style 2024-01-10 10:34:12 -05:00
Cameron Smith
9682347254 pumi: fix mpi test paths 2024-01-10 10:34:12 -05:00
Cameron Smith
f4f7309504 pumi: test dir fixes
thank you @tldahlgren
2024-01-10 10:34:11 -05:00
Cameron Smith
071a34df27 double quotes 2024-01-10 10:34:11 -05:00
Cameron Smith
8d35a8498b pumi: fix path to smoketest input data 2024-01-10 10:34:11 -05:00

View File

@ -3,6 +3,8 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import warnings
from spack.package import * from spack.package import *
@ -114,22 +116,35 @@ def cmake_args(self):
def test(self): def test(self):
if self.spec.version <= Version("2.2.6"): if self.spec.version <= Version("2.2.6"):
return return
exe = "uniform" data_dir = self.prefix.share.testdata
options = ["../testdata/pipe.dmg", "../testdata/pipe.smb", "pipe_unif.smb"] exe = self.prefix.bin.uniform
expected = "mesh pipe_unif.smb written" options = [
join_path(data_dir, "pipe.dmg"),
join_path(data_dir, "pipe.smb"),
join_path(self.prefix.bin, "pipe_unif.smb"),
]
expected = "pipe_unif.smb written"
description = "testing pumi uniform mesh refinement" description = "testing pumi uniform mesh refinement"
self.run_test(exe, options, expected, purpose=description, work_dir=self.prefix.bin) self.run_test(exe, options, expected, purpose=description)
mpiexec = Executable(join_path(self.spec["mpi"].prefix.bin, "mpiexec")).command mpiexec = ""
mpiopt = ["-n", "2"] mpiexe_list = ["mpirun", "mpiexec", "srun"]
exe = ["split"] for mpiexe in mpiexe_list:
options = ["../testdata/pipe.dmg", "../testdata/pipe.smb", "pipe_2_.smb", "2"] if which(mpiexe) is not None:
expected = "mesh pipe_2_.smb written" mpiexec = Executable(mpiexe).command
break
if mpiexec == "":
warnings.warn("MPI exec not found")
data_dir = self.prefix.share.testdata
options = [
"-n",
"2",
join_path(self.prefix.bin, "split"),
join_path(data_dir, "pipe.dmg"),
join_path(data_dir, "pipe.smb"),
join_path(self.prefix.bin, "pipe_2_.smb"),
"2",
]
expected = "pipe_2_.smb written"
description = "testing pumi mesh partitioning" description = "testing pumi mesh partitioning"
self.run_test( self.run_test(mpiexec, options, expected, purpose=description)
mpiexec,
mpiopt + exe + options,
expected,
purpose=description,
work_dir=self.prefix.bin,
)