Skip to content

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

Merged
climbfuji merged 1 commit into
NCAR:masterfrom
climbfuji:speedup_recompile_again_20210326
Mar 31, 2021
Merged

ccpp_prebuild.py: speed up recompiling unchanged code (again)#357
climbfuji merged 1 commit into
NCAR:masterfrom
climbfuji:speedup_recompile_again_20210326

Conversation

@climbfuji
Copy link
Copy Markdown
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/ufsatm#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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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