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

Large memory footprint when appending to an existing netCDF file #7

Closed
DavidHuber-NOAA opened this issue Oct 12, 2023 · 1 comment · Fixed by #8
Closed

Large memory footprint when appending to an existing netCDF file #7

DavidHuber-NOAA opened this issue Oct 12, 2023 · 1 comment · Fixed by #8

Comments

@DavidHuber-NOAA
Copy link
Contributor

Testing has revealed that the GSI is using far too much memory when compiled with netCDF 4.9.2/gsi-ncdiag 1.1.1 and attempting to append to existing netCDF diagnostic files. For the global_4denvar test, this first shows up when the temperature operator setup function is called the second time. This tracks down to the ncdiag subroutine nc_diag_init with append=.true.. Running the test with just 12 PEs, the memory allocations suddenly jump from ~1.5GB/PE to ~6GB/PE. The exact function/subroutine called within nc_diag_init that causes this is still under investigation.

@DavidHuber-NOAA
Copy link
Contributor Author

The issue is the way that the existing netCDF file is open when appending. The optional parameter specifies an override HDF5 cache size of 16GB. I suspect this was intended to be 16MB (the default is 1 MB). This occurs at nc_diag_write_mode.F90:326-327:

call nclayer_check( nf90_open(filename, NF90_WRITE, ncid, &
         bsize, cache_nelems = 16777216) ) ! Optimization settings

Excluding the cache_nelems parameter (i.e. using the default 1MB) results in a much smaller memory allocation as does using a 16MB value (cache_nelems = 16384), the latter being what I will use to fix this issue.

FYI @aerorahul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant