Skip to content
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

ccpp_prebuild.py: speed up recompiling unchanged code (again) #357

Merged
merged 1 commit into from
Mar 31, 2021

Conversation

climbfuji
Copy link
Collaborator

@climbfuji climbfuji commented Mar 26, 2021

This PR fixes an issue that has come up just recently due to unrelated build changes in the UFS. When recompiling the same, unchanged code, the auto-generated caps as well as the cmake include files can change and trigger a full recompile. While it is beyond my understanding why this didn't happen before, the solution is to make the framework more robust against such external changes:

Replace regular Python dictionaries with ordered dictionaries, sort lists where needed to avoid differences in the auto-generated code when recompiling the same code. Also: sanitize formatting in a few places. No code/answer changes.

Associated PRs:
#357
NCAR/ccpp-physics#600
NOAA-EMC/fv3atm#267
ufs-community/ufs-weather-model#498

For regression testing, see ufs-community/ufs-weather-model#498

…ists where needed to avoid differences in the auto-generated code when recompiling the same code
Copy link
Collaborator

@gold2718 gold2718 left a 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 why the output should have changed if the symbol names did not (I thought they came out in dictionary sort order) but I don't see anything wrong with these changes.

@climbfuji
Copy link
Collaborator Author

I'm not sure why the output should have changed if the symbol names did not (I thought they came out in dictionary sort order) but I don't see anything wrong with these changes.

Thanks for the quick review. Yes, at this point I don't want to spend too much time investigating a spurious problem that I can fix by simply replacing all {} with Collections.OrderedDict().

Copy link
Contributor

@llpcarson llpcarson left a comment

Choose a reason for hiding this comment

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

approved

@climbfuji climbfuji merged commit 186e76d into NCAR:master Mar 31, 2021
@climbfuji climbfuji deleted the speedup_recompile_again_20210326 branch June 27, 2022 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants