-
Notifications
You must be signed in to change notification settings - Fork 165
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
Fix additional memory leaks in GEOS-Chem #2104
Conversation
Headers/phot_container_mod.F90 - Deallocate the Phot object before setting it to NULL() Headers/state_chm_mod.F90 - Deallocate State_Chm%AerMass before setting it to NULL() CHANGELOG.md - Updated accordingly Signed-off-by: Bob Yantosca <[email protected]>
@lizziel @msulprizio: I have traced the memory leak in the History component to routine geos-chem/History/metahistitem_mod.F90 Lines 348 to 380 in 3cd802e
The issue is that we allocate a local variable HEAD (to serve as the head of the linked list) but then we never deallocate it. So the memory is leaked. This might be a by-product of the original code on which I based the History linked lists (see: https://github.com/mapmeld/fortran-machine/blob/main/flibs-0.9/flibs/src/datastructures/linkedlist.f90, which has a similar issue). It might take a bit of doing to be able to rethink solving this memory leak in the GCClassic History diagnostics. I propose to thus fix the memory leaks #3 and #4 and then return to solving #2 later. |
All GEOS-Chem Classic integration tests passed: ==============================================================================
GEOS-Chem Classic: Execution Test Results
GCClassic #c7aa8ee Merge pull request #48 for branch 'dev/no-diff-to-benchmark' into dev/14.3.0
GEOS-Chem #78fc20489 Fix memory leaks in State_Chm%AerMass and State_Chm%Phot
HEMCO #0c7e10e Merge pull request #252 from branch 'origin/feature/geosit_meteorology_constants_file_year_change' into dev/3.8.0
Using 24 OpenMP threads
Number of execution tests: 26
Submitted as SLURM job: 14850037
==============================================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% All execution tests passed! %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
Name and Institution (Required)
Name: Bob Yantosca
Institution: Harvard + GCST
Confirm you have reviewed the following documentation
Describe the update
This is a placeholder PR and should not yet be merged. I have made the base branch
main
but will change it later.This is a companion PR to #2102. Configuring GEOS-Chem with
-DSANITIZE=y
has revealed the following memory leaks in GEOS-Chem and HEMCO:Leak 1 is in HEMCO and will be addressed by a separate PR at https://github.com/geoschem/hemco. We are still investigating.
Leak 2 is in the GEOS-Chem Classic History code. We are still investigating.
Leaks 3 and 4 were resolved by adding DEALLOCATE statements (see commit 78fc204).
Tagging @msulprizio @lizziel
Expected changes
This will be a zero-diff update that will remove memory leaks. It will not change results.
Reference(s)
N/A
Related Github Issue(s)