Skip to content

Runtime checks on registry file generation and add ability to run out-of-source#1909

Closed
islas wants to merge 4 commits intowrf-model:developfrom
islas:registryChecksAndFixes
Closed

Runtime checks on registry file generation and add ability to run out-of-source#1909
islas wants to merge 4 commits intowrf-model:developfrom
islas:registryChecksAndFixes

Conversation

@islas
Copy link
Collaborator

@islas islas commented Aug 15, 2023

TYPE: bug fix

KEYWORDS: registry, out-of-source

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
Registry code generation continues regardless of errors and missing fields are not caught until sometimes ~40 minutes into compilation when a subsequent source file is missing registry-generated fields. Additionally, the generated code clutters the source development environment with hundreds of files, requiring many .gitignore entries that seem counterintuitive (e,g. ignoring all *.f90 source files). Finally, there is a bug in the the gen_allocs conditionally compiled code

Solution:
Check returns of gen_...() functions that create files to output if respective call failed to generate the registry code
Add the ability to supply a root registry directory to utilize instead of assumed relative directories to allow out-of-source registry code generation outside of the WRF repo. Make assumed relative still the default method so previous builds not using this new capability still work.
Fix gen_allocs.c define macro

LIST OF MODIFIED FILES:
M tools/gen_allocs.c
M tools/gen_streams.c
M tools/reg_parse.c
M tools/registry.c

TESTS CONDUCTED:

  1. Do mods fix problem? Local compilation demonstrates fixes working as expected
  2. Are the Jenkins tests all passing? Yes

RELEASE NOTE:
Runtime checks on registry file generation and add ability to run out-of-source. Minor bug fix in gen_allocs.c

@islas islas requested a review from a team as a code owner August 15, 2023 22:24
@islas
Copy link
Collaborator Author

islas commented Aug 15, 2023

@dudhia @weiwangncar
At the suggesting of @mgduda I've split #1899 into more digestible PRs addressing individual issues

@weiwangncar
Copy link
Collaborator

The regtest results:

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           57
Number of Simulations  : 158           150        0
Number of Comparisons  : 95           86        0

Failed Simulations are: 
None
Which comparisons are not bit-for-bit: 
None

@mgduda
Copy link
Collaborator

mgduda commented Jan 4, 2024

I'd suggest splitting this PR into three separate PRs:

  • registry code generation should fail if an error is encountered
  • one-line fix for bug in gen_allocs
  • support out-of-source builds

@islas
Copy link
Collaborator Author

islas commented Jan 5, 2024

three separate PRs

Will close this one and open new ones shortly

@islas islas closed this Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants