Skip to content

Finalize ESMF objects for components - #453

Open
danrosen25 wants to merge 1 commit into
ESCOMP:mainfrom
danrosen25:fix/cleanesmfobjs
Open

danrosen25 wants to merge 1 commit into
ESCOMP:mainfrom
danrosen25:fix/cleanesmfobjs

Conversation

@danrosen25

Copy link
Copy Markdown
Collaborator

Description of changes

This PR addresses memory leaks caused by creating ESMF objects that are not destroyed.

  • adds helper function for ESMF cleanup to dshr_strdata_mod
  • adds helper functions for ESMF cleanup to dshr_mod
  • finalize strdata: destroy ESMF objs in each pstrm for each cmp
  • finalize mesh: destroy ESMF mesh(es) for each cmp
  • finalize alarms: destroy alarms associated with each cmp clock
  • destroy temporary ESMF objects in datm_get_adjustment_factors
  • destroy temporary ESMF objects in dglc_datamode_noevolve_advance
  • destroy temporary ESMF objects in dshr_set_modelmask
  • destroy temporary ESMF objects in shr_strdata_readstrm
  • destroy temporary ESMF objects in shr_stream_init_from_esmfconfig

Specific notes

Contributors other than yourself, if any:
@billsacks @ekluzek

CDEPS Issues Fixed (include github issue #):
Partially addresses issue 261

Are there dependencies on other component PRs (if so list): No

Are changes expected to change answers (bfb, different to roundoff, more substantial): No

Any User Interface Changes (namelist or namelist defaults changes): No

Testing performed (e.g. aux_cdeps, CESM prealpha, etc):
Tested using cime --xml-category aux_cdeps
20261009_115334_g3s4bt: 37 tests

Hashes used for testing:
CESM: ba0a56365ae08a89cf8f68eda69af231fa67d49c
CDEPS: c918615

* adds helper function for ESMF cleanup to dshr_strdata_mod
* adds helper functions for ESMF cleanup to dshr_mod
* finalize strdata: destroy ESMF objs in each pstrm for each cmp
* finalize mesh: destroy ESMF mesh(es) for each cmp
* finalize alarms: destroy alarms associated with each cmp clock
* destroy temporary ESMF objects in datm_get_adjustment_factors
* destroy temporary ESMF objects in dglc_datamode_noevolve_advance
* destroy temporary ESMF objects in dshr_set_modelmask
* destroy temporary ESMF objects in shr_strdata_readstrm
* destroy temporary ESMF objects in shr_stream_init_from_esmfconfig

@mvertens mvertens left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for taking this on and doing a really clean implementation. This all looks good to me.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants