MPAS-Dev / MPAS-Model

Repository for MPAS models and shared framework releases.
237 stars 318 forks source link

Reduce static field interpolation memory usage #1059

Closed dimomatt closed 1 year ago

dimomatt commented 1 year ago

Reduce the memory usage of static field interpolation by deallocating tiles as they are used.

Static field interpolation occasionally failed by overflowing the memory of the compute nodes when running core_init_atmosphere. Running valgrind revealed that this was not due to a memory leak, but simply loading all of the required geotiles in to memory during the depth first search for candidate tiles, and only deallocating them once the interpolation was finished. This pull request deallocates the memory associated with the geotile each time that we process a tile, leading to significant memory use reductions- on an x1.40962 grid, static field interpolation peak memory usage has dropped from ~43GiB to ~6GiB.