8000 Copy MPAS model executable to work directory by xylar · Pull Request #360 · MPAS-Dev/compass · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Copy MPAS model executable to work directory #360

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

Merged
merged 3 commits into from
Oct 13, 2022

Conversation

xylar
Copy link
Collaborator
@xylar xylar commented Apr 18, 2022

A directory (either mpas-ocean or mpas-albany-landice) is made within the base of the work directory and the MPAS model executable (ocean_model or landice_model) is copied there. Symlinks within the work directory are to that copy.

This is useful if you want to delete the E3SM branch used to set up test cases or suites but you still want the ability to run the code after the fact.

closes #345

@xylar xylar added enhancement New feature or request framework labels Apr 18, 2022
@xylar xylar requested review from sbrus89 and matthewhoffman April 18, 2022 11:02
@xylar xylar self-assigned this Apr 18, 2022
@xylar
Copy link
Collaborator Author
xylar commented Apr 18, 2022

Testing

I ran the ocean nightly test case on my Linux laptop with this change. I verified that the ocean_model executable was copied as desired and that the steps that use this executable are symlinked the copy, not to the original.

@xylar
Copy link
Collaborator Author
xylar commented Apr 18, 2022

@sbrus89, please verify that this meets you needs for #345.

@xylar
Copy link
Collaborator Author
xylar commented Apr 18, 2022

@matthewhoffman, I suspect this is not a functionality that you and the MALI team necessarily need. Even if not, could you run a test to make sure it does no harm?

@matthewhoffman
Copy link
Member

@xylar , thanks for tagging me. Does this mean that if you recompile the executable, you would now need to rerun compass setup / suite before re-running any tests? I can understand the problem this PR is wanting to solve (and "freezing" the exe that was used for the tests could help with reproducibility), but if the answer to my question is yes, then it disrupts a different part of a common workflow. For a debugging workflow where you are repeatedly editing code to get a test to stop failing, you would need an extra compass setup command after every time you recompile, which could be easily forgotten and lead to confusion. What do you think?

@xylar
Copy link
Collaborator Author
xylar commented Apr 18, 2022

@matthewhoffman, that's right. I'm glad I flagged you on this. We should make this off by default and only on if a certain flag (say --copy_executable) is used.

@matthewhoffman
Copy link
Member

I'm not sure what the best solution is. I could be convinced that this new way is a better overall design choice. I think it's a tradeoff between convenience and reproducibility. My preference is certainly the existing functionality for the reason I mentioned, but there might be other users for who the proposed functionality makes more sense.

@pep8speaks
Copy link
pep8speaks commented Apr 18, 2022

Hello @xylar! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-07-08 11:49:36 UTC

@xylar xylar force-pushed the copy_mpas_model_exec branch from 767c042 to 60da8e5 Compare April 18, 2022 17:42
@xylar
Copy link
Collaborator Author
xylar commented Apr 18, 2022

@matthewhoffman, I agree with you. The more frequent need is to rebuild frequently to debug. The ability to preserve the executable is not needed very often. It was a request from @sbrus89 so it clearly could be useful, but need not be the default.

I believe I have set it up to be off by default, but on with --copy_executable. @sbrus89, again, please try this out for yourself.

@sbrus89
Copy link
Collaborator
sbrus89 commented Apr 18, 2022

I totally agree that copying the executable should not be the default behavior. The majority of the time, it's much better to have things linked for debugging as you've both mentioned.

What I had in mind when I brought this up was using compass set up a series of runs for a paper, for example. In that case it would probably be better to not have the potential for the executable to change behind a sim link.

I think another use case would be to keep around a long-lived baseline test. In this case, I think it's nice to have the executable to produced the baseline results preserved.

Copy link
Member
@matthewhoffman matthewhoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is a useful option, and I like the solution of using --copy_executable as an optional flag. I tested this branch without the flag (old behavior) and see no problems. I also tested with the new --copy_executable flag. Tests still pass and now I see the exe is copied into the working dir as expected. Symlinks in the individual tests point to the copied exe in the root of the workdir. So everything seems to work as expected.

I'm not sure if there is somewhere in the docs this should be mentioned, but the help messages in the --help output for compass setup and compass suite look good.

@xylar
Copy link
Collaborator Author
xylar commented Apr 19, 2022

Great. @sbrus89, if you can test this out, I'll merge it.

@xylar
Copy link
Collaborator Author
xylar commented Apr 19, 2022

I'm not sure if there is somewhere in the docs this should be mentioned

I added a paragraph to the User's Guide (the Quick Start) that explains this flag and the motivation, using @sbrus' examples from above.

@xylar xylar force-pushed the copy_mpas_model_exec branch from 445e4c8 to 3f96622 Compare April 28, 2022 19:43
@xylar xylar force-pushed the copy_mpas_model_exec branch from 3f96622 to 8e6c354 Compare July 8, 2022 11:49
Copy link
Collaborator
@sbrus89 sbrus89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xylar. I have tested this and it works as expected. Thanks!

@xylar xylar merged commit a402621 into MPAS-Dev:master Oct 13, 2022
@xylar xylar deleted the copy_mpas_model_exec branch October 13, 2022 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider copying rather than linking load script and executable
4 participants
0