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

Memory leak in ST6 post v.6.07 #1340

Open
stefanzieger opened this issue Jan 2, 2025 · 0 comments
Open

Memory leak in ST6 post v.6.07 #1340

stefanzieger opened this issue Jan 2, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@stefanzieger
Copy link

Describe the bug
ST6 package is running out of memory on SMC grid with O(2.5M) points (or 3.9GB per MPI process) under development branch. No issues in version 6.07. It appears to be an issues related to Intel's legacy compiler ifort and Intel's OneAPI compiler ifx. No issues found with GCC compiler gfortran.

@stefanzieger stefanzieger added the bug Something isn't working label Jan 2, 2025
stefanzieger added a commit to stefanzieger/WW3 that referenced this issue Jan 2, 2025
It appears that changing the file extension
from .ftn in v6.07 to .F90 in v7 triggered a memory leak in
Intel's Fortran compilers. The issue occurs when mapping
from a dynamically allocated array to a static array.
GCC gfortran on the other hand will make sure that allocated
arrays will be freed on exit of a subroutine.

The leak is about 250B per grid point and subroutine call.
This translates to 5MB per time step on a 2.5M proint grid.

Updates
-------
 [x] Change array type from static to allocatalbe.
 [x] Explicitely add DEALLOCATE statements.
 [x] Move arrays with constantes to MODULE level.
 [x] Add checks for allocation status.
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

No branches or pull requests

1 participant