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

Reduce memory increase from PRs 1567 and 1616 #1722

Merged
merged 5 commits into from
Apr 22, 2022
Merged

Reduce memory increase from PRs 1567 and 1616 #1722

merged 5 commits into from
Apr 22, 2022

Conversation

weiwangncar
Copy link
Collaborator

@weiwangncar weiwangncar commented Apr 20, 2022

Reduce memory used by the model from two previous PRs

TYPE: bug fix

KEYWORDS: qnbca, wif_input_opt, package

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
PR1567 changed default wif_input_opt from 0 to 1, which increased memory use by about 12%. PR1616 added new variable qnbca, but it is not packaged.

Solution:
Change default wif_input_opt option back to 0, and add qnbca to package for mp_physics=28 and its dfi counterpart. Testing the latest release 4.4 code shows a memory reduction (when mp_physics=28 is not used) is down by 11%.

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M Registry/registry.new3d_wif

TESTS CONDUCTED:

  1. Do mods fix problem? The fix reduces memory use in the model.
  2. The Jenkins tests are all passing.

RELEASE NOTE:

@weiwangncar weiwangncar requested a review from a team as a code owner April 20, 2022 15:26
@dudhia
Copy link
Collaborator

dudhia commented Apr 20, 2022

Need to update PR message if this is the final version.

@weiwangncar
Copy link
Collaborator Author

The Jenkins tests have passed (with adding wif_input_opt = 1 to two of the test namelists):

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           58
Number of Simulations  : 158           156        0
Number of Comparisons  : 95           92        0

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

@weiwangncar
Copy link
Collaborator Author

@dudhia @kkeene44 @twjuliano This PR is ready for review.

@twjuliano
Copy link
Contributor

@weiwangncar Thanks for looking into this memory issue. The only concern I have is that we added the BC aerosols to be included in mp=28 only when wif_input_opt=2 (we kept wif_input_opt=1 the same so that a user can run a simulation without BC). Thus, I added qnbca (but not dfi_qnbca) in the use_wif_input_bc package in the new3d_wif registry. Just want to make sure that it is OK to have qnbca included in the general Thompson package even when wif_input_opt=1 (i.e., BC not included).

@dudhia
Copy link
Collaborator

dudhia commented Apr 21, 2022

Was #1567 after the last release or will this change the behavior of a release?

@weiwangncar
Copy link
Collaborator Author

@dudhia PR1567 is for v4.4. Is that what you're asking?

@dudhia
Copy link
Collaborator

dudhia commented Apr 21, 2022 via email

@weiwangncar
Copy link
Collaborator Author

@twjuliano I don't think this matters to your concern. Without this PR, qnbca array is available ALL the time - that is why it increases the memory used by the model whether you are using mp_physics = 28 or not. With this change, the array is made available only to this microphysics option. Does it make sense? It wouldn't hurt if you could run a test to verify that.

@dudhia
Copy link
Collaborator

dudhia commented Apr 21, 2022 via email

@weiwangncar
Copy link
Collaborator Author

@dudhia Yes. It has been on the develop branch all this time, until the cut-over to release-v4.4.

@weiwangncar
Copy link
Collaborator Author

@dudhia That will change with this PR - this PR sets wif_input_opt = 0.

@dudhia
Copy link
Collaborator

dudhia commented Apr 21, 2022

OK, need to make sure that if a user forgets to set that to 1 or 2, there is a reasonable message from real and probably a stop for option 28.

@weiwangncar
Copy link
Collaborator Author

@dudhia The default value for wif_input_opt is 0 in previous releases.

@twjuliano
Copy link
Contributor

@twjuliano I don't think this matters to your concern. Without this PR, qnbca array is available ALL the time - that is why it increases the memory used by the model whether you are using mp_physics = 28 or not. With this change, the array is made available only to this microphysics option. Does it make sense? It wouldn't hurt if you could run a test to verify that.

@weiwangncar I see, that makes sense, thanks. I can run the test later today if that isn't too late.

@weiwangncar
Copy link
Collaborator Author

@twjuliano No, it's not too late. I will wait for your test results.

@twjuliano
Copy link
Contributor

@weiwangncar I just ran a test: this works as intended, thanks!

@weiwangncar
Copy link
Collaborator Author

@twjuliano Thanks for running the test!
@kkeene44 Can you review this and if it is ok, approve it?

@weiwangncar weiwangncar merged commit 5e02ac1 into wrf-model:release-v4.4 Apr 22, 2022
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
TYPE: bug fix

KEYWORDS: qnbca, wif_input_opt, package

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
PR1567 changed default wif_input_opt from 0 to 1, which increased memory use by about 12%. PR1616 added new variable qnbca, but it is not packaged.

Solution:
Change default wif_input_opt option back to 0, and add qnbca to package for mp_physics=28 and its dfi counterpart. Testing the latest release 4.4 code shows a memory reduction (when mp_physics=28 is not used) is down by 11%.

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M Registry/registry.new3d_wif

TESTS CONDUCTED:

Do mods fix problem? The fix reduces memory use in the model.
The Jenkins tests are all passing.
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.

None yet

4 participants