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

DEM mask to lower datatype size to reduce memory usage #344

Merged
merged 4 commits into from
Dec 7, 2023

Conversation

daanvaningen
Copy link
Contributor

area_mask is a boolean mask, so i reduced the datatype to be 1 byte (unfortunately we cannot go lower than 1 byte in both python/numpy and fortran). A model that previously took more than 18GB now takes around 9GB. This is corresponding to the data reduction of 2 bytes integers to 1 byte.

The mem usage can be further reduced by not creating a padded copy of the DEM in Fortran in the pad_area_mask routine. Finally, going through the DEM in tiles will of course be most memory safe of all solutions :)

Copy link
Collaborator

@martijn-siemerink martijn-siemerink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Next step padding in python!

@daanvaningen daanvaningen merged commit ad5cbcd into master Dec 7, 2023
7 checks passed
@daanvaningen daanvaningen deleted the daan-dem-mask-boolean branch December 7, 2023 09:35
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 this pull request may close these issues.

2 participants