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

Permanent 3-d arrays unnecessarily allocated for diagnostics #1226

Open
Hallberg-NOAA opened this issue Oct 19, 2020 · 0 comments
Open

Permanent 3-d arrays unnecessarily allocated for diagnostics #1226

Hallberg-NOAA opened this issue Oct 19, 2020 · 0 comments

Comments

@Hallberg-NOAA
Copy link
Collaborator

An examination of the MOM6 code reveals a number of instances in the MOM6 code where 3-dimensional arrays that are used for diagnostics are being allocated in the control structures of modules and retained for the length of the runs. It at least some cases (like MOM_bkgnd_mixing.F90), this is true even for diagnostics that are not in use!

This behavior is going to be problematic for performance, because MOM6 appears to be limited by data access, and it may prevent the model from running at all on smaller processor counts because it unnecessarily enlarges the memory footprint.

I am proposing that every 3-d (and 4-d) array in module control structures or other permanent types needs to be examined to determine whether it is necessary. Diagnostics should use automatically allocated memory within the module, because this memory can be reused by other modules and may not contribute to the model's memory high-water mark. Also, 3-d arrays that are only used for diagnostics should not be stored if the related diagnostics are not in use, because setting a 3-d array (even just via a copy) is an expensive operation.

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

No branches or pull requests

1 participant