Skip to content

Fix and re-enable ESMF garbage collection #518

@theurich

Description

@theurich

Currently much of the ESMF garabage collection is disabled by default: ESMF_RUNTIME_GARBAGE=SAFE. See #277.

For reasons that should be discussed in a new RefDoc section (as per #408), it is difficult to do all of the cleaning up of ESMF objects explicitly in user code. Especially for multi-component situations where ESMF objects (like geoms or fields, etc) are shared between other ESMF objects. Potentially even between components.

As it stands, if a user wants to use leak checkers like Valgrind or AddressSanitizer (for LLVM based compilers) they have to deal with an absurd number of "leaks" flagged for ESMF. These are not leaks in the sense that they would grow over time, but instead these are allocations that do not get cleaned up at the end of the execution as they should during ESMF_Finalize() if the ESMF garbage collection was enabled.

Bottom line though is that as it stands, leak checkers are almost unusable for applications when ESMF is in the mix! This is a problem and should be addressed by fixing and re-enabeling the ESMF garbage collection code.

A simple way to run with full ESMF garbage collection enabled right now is to set ESMF_RUNTIME_GARBAGE=FULL. However, this will currently crash for most non-trivial ESMF applications, which is why it is not the default setting at the moment.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions