New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pumi: fix path to smoketest input data #32446
base: develop
Are you sure you want to change the base?
Conversation
It looks like you had an issue with style checks! I can help with that if you ask me! Just say:
... and I'll try to fix style and push a commit to your fork with the fix. Alternatively, you can run: $ spack style --fix And then update the pull request here. |
1 similar comment
It looks like you had an issue with style checks! I can help with that if you ask me! Just say:
... and I'll try to fix style and push a commit to your fork with the fix. Alternatively, you can run: $ spack style --fix And then update the pull request here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good though testing in the install prefix creates a problem for some use cases.
exe = "uniform" | ||
options = ["../testdata/pipe.dmg", "../testdata/pipe.smb", "pipe_unif.smb"] | ||
options = ["../share/testdata/pipe.dmg", "../share/testdata/pipe.smb", "pipe_unif.smb"] | ||
expected = "mesh pipe_unif.smb written" | ||
description = "testing pumi uniform mesh refinement" | ||
self.run_test(exe, options, expected, purpose=description, work_dir=self.prefix.bin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stand-alone tests should not be run from the prefix due to issues with permissions in read-only installations. This can be avoided by either providing the full path to the files in the prefix or by copying the test data to the test stage and using the full path to executable(s). For example,
exe = "uniform" | |
options = ["../testdata/pipe.dmg", "../testdata/pipe.smb", "pipe_unif.smb"] | |
options = ["../share/testdata/pipe.dmg", "../share/testdata/pipe.smb", "pipe_unif.smb"] | |
expected = "mesh pipe_unif.smb written" | |
description = "testing pumi uniform mesh refinement" | |
self.run_test(exe, options, expected, purpose=description, work_dir=self.prefix.bin) | |
data_dir = self.prefix.share.testdata | |
exe = self.prefix.bin.uniform | |
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" | |
self.run_test(exe, options, expected, purpose=description) |
@@ -109,15 +109,15 @@ def test(self): | |||
if self.spec.version <= Version("2.2.6"): | |||
return | |||
exe = "uniform" | |||
options = ["../testdata/pipe.dmg", "../testdata/pipe.smb", "pipe_unif.smb"] | |||
options = ["../share/testdata/pipe.dmg", "../share/testdata/pipe.smb", "pipe_unif.smb"] | |||
expected = "mesh pipe_unif.smb written" | |||
description = "testing pumi uniform mesh refinement" | |||
self.run_test(exe, options, expected, purpose=description, work_dir=self.prefix.bin) | |||
|
|||
mpiexec = Executable(join_path(self.spec["mpi"].prefix.bin, "mpiexec")).command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to pass an executable to run_test
so you could simply set this to:
mpiexec = Executable(join_path(self.spec["mpi"].prefix.bin, "mpiexec")).command | |
mpiexec = self.spec["mpi"].prefix.bin.mpiexec |
expected = "mesh pipe_unif.smb written" | ||
description = "testing pumi uniform mesh refinement" | ||
self.run_test(exe, options, expected, purpose=description, work_dir=self.prefix.bin) | ||
|
||
mpiexec = Executable(join_path(self.spec["mpi"].prefix.bin, "mpiexec")).command | ||
mpiopt = ["-n", "2"] | ||
exe = ["split"] | ||
options = ["../testdata/pipe.dmg", "../testdata/pipe.smb", "pipe_2_.smb", "2"] | ||
options = ["../share/testdata/pipe.dmg", "../share/testdata/pipe.smb", "pipe_2_.smb", "2"] | ||
expected = "mesh pipe_2_.smb written" | ||
description = "testing pumi mesh partitioning" | ||
self.run_test( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As stated above, the test should not be executed in the installation directory so you want to remove the work_dir
argument.
expected = "mesh pipe_unif.smb written" | ||
description = "testing pumi uniform mesh refinement" | ||
self.run_test(exe, options, expected, purpose=description, work_dir=self.prefix.bin) | ||
|
||
mpiexec = Executable(join_path(self.spec["mpi"].prefix.bin, "mpiexec")).command | ||
mpiopt = ["-n", "2"] | ||
exe = ["split"] | ||
options = ["../testdata/pipe.dmg", "../testdata/pipe.smb", "pipe_2_.smb", "2"] | ||
options = ["../share/testdata/pipe.dmg", "../share/testdata/pipe.smb", "pipe_2_.smb", "2"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can provide full paths here:
options = ["../share/testdata/pipe.dmg", "../share/testdata/pipe.smb", "pipe_2_.smb", "2"] | |
options = [ | |
join_path(data_dir, "pipe.dmg"), | |
join_path(data_dir, "pipe.smb"), | |
"pipe_2_.smb", | |
"2", | |
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See prior suggestions and comments.
Hi @tldahlgren, I made the suggested edits (outside github) and was able to run |
exe = ["split"] | ||
options = ["../testdata/pipe.dmg", "../testdata/pipe.smb", "pipe_2_.smb", "2"] | ||
expected = "mesh pipe_2_.smb written" | ||
mpiexec = self.spec["mpi"].prefix.bin.mpiexec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a case where the full path to the mpi executable is necessary? There are software environments where only the mpi compilers are provided in the mpi bin directory and the executors are located elsewhere. This test is breaking for us in that situation. Also, mpiexec is not always available. I recommend using something like this:
mpiexe_list = ["mpirun", "mpiexec", "srun"]
for mpiexe in mpiexe_list:
if which(mpiexe) is not None:
mpiexec = Executable(mpiexe).command
break
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. If the full path was not set, how would the spack test mechanism locate the mpi executor that matches the mpi install used for the build? I haven't tried mixing an mpi executor from one mpi install with libraries/headers from another.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct mpi environment would have to be loaded for the test to run successfully so it would pick up the executor from the path. I think that is generally how spack smoke tests are implemented. This isn't to support mixing and matching mpi components but a single mpi with an atypical directory structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Thank you. I'll make the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick spack/python question. Should we handle the case where mpirun
, mpiexec
or srun
is not found? If so, what is the clean way to report the error and exit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be safer. Maybe skip the mpi test with a warning rather than a failure in that case? Ideally we should have an mpi executor method provided by spack so every mpi enabled test doesn't have to reimplement this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have tests that pick the first of those executables it finds and runs with it. If you want to demonstrate running with all available, you could do that.
(FYI. I'm refactoring stand-alone testing support so maybe I can sneak this in. 😉 )
@cwsmith did you get a chance to take a look at the review feedback. Is this PR still something you'd like to pursue? |
@alecbcs Yes. Sorry. I'll get back to this after the holiday. |
1289a40
to
19c0208
Compare
This PR fixes the path to the input data needed to successfully run
spack test run pumi
.SCOREC/core#370