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

Store regrid weights #2631

Merged
merged 11 commits into from
Mar 7, 2024
Merged

Store regrid weights #2631

merged 11 commits into from
Mar 7, 2024

Conversation

bena-nasa
Copy link
Collaborator

@bena-nasa bena-nasa commented Mar 6, 2024

This PR provide several things. With the regridding weights which should be a big help at large resolutions/core counts

  1. The ability for MAPL_ESMFRegridder to retrieve and store the route handle weights from/to a file. Off by default. If turned on it will take the source grid dimensions, source layout, destination dimensions, destination layout, the regrids method and generate a unique file name. If the file exists, it will read rather than generate weights. If the file does not exists will generate weight as normal and then write them to a file.
  2. An expanded use the "hints" option to enable item 1
  3. Disable the computation of the transpose by default, this an unnecessary expense for anything other than the tangent linear model.
  4. Another hint to enable the transpose in make_regridder
  5. Options in the History.rc and extdata.yaml files to turn on the the write/read weights option

These weights are of course specific to a particular layout so only for a longer run where multiple executions of the model will be done and the layout doesn't change.
This should make a big difference on higher resolution runs. Even at say c180 though it still dramatically reduces the ExtData run time for a day by a factor 5 to 6

Bill claims at large core counts the writing may have issues, but since this is off by default should not harm. I will see if I can reproduce, if so though, we would have to bring up with ESMF.

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Trivial change (affects only documentation or cleanup)

Checklist:

  • I have tested this change with a run of GEOSgcm (if non-trivial)
  • I have added one of the required labels (0 diff, 0 diff trivial, 0 diff structural, non 0-diff)
  • I have updated the CHANGELOG.md accordingly following the style of Keep a Changelog

@bena-nasa bena-nasa added 🎁 New Feature This is a new feature 0 Diff The changes in this pull request have verified to be zero-diff with the target branch. labels Mar 6, 2024
@bena-nasa bena-nasa requested a review from a team as a code owner March 6, 2024 19:36
@bena-nasa bena-nasa requested a review from tclune March 6, 2024 19:36
Copy link
Contributor

@atrayano atrayano left a comment

Choose a reason for hiding this comment

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

We should deallocate ims and jms at the bottom of MAPL_GiedGet

base/MaplGrid.F90 Outdated Show resolved Hide resolved
tclune
tclune previously approved these changes Mar 7, 2024
Copy link
Collaborator

@tclune tclune left a comment

Choose a reason for hiding this comment

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

It is unfortunate that we needed such substantial changes in ESMFRegridder, as the MAPL3G version is much cleaner. OTOH, this probably helps us to "get it right" in 3g rather than rushing to get something working in there.

@bena-nasa
Copy link
Collaborator Author

It is unfortunate that we needed such substantial changes in ESMFRegridder, as the MAPL3G version is much cleaner. OTOH, this probably helps us to "get it right" in 3g rather than rushing to get something working in there.

@tclune Yeah, but unfortunately I can't think of significantly cleaner way to do this. And this is not anywhere close to what we could do. As you say we really need to encode everything about the route handle in way so this is just scratching the surface...
Given the performance gains Bill was seeing and even what I've seen, this capability is something that I think we should support. It's just too beneficial I think throw in the towel and not pursue.

@tclune
Copy link
Collaborator

tclune commented Mar 7, 2024

It is unfortunate that we needed such substantial changes in ESMFRegridder, as the MAPL3G version is much cleaner. OTOH, this probably helps us to "get it right" in 3g rather than rushing to get something working in there.

@tclune Yeah, but unfortunately I can't think of significantly cleaner way to do this.

I was not critiquing your change - just came out wrong. I meant I'd rather have treated this layer as frozen as it has been superseded. But ... as we cannot yet use MAPL3 for the full model, and we need the capability "now" ... we must implement it twice.

@bena-nasa bena-nasa merged commit b08fb71 into develop Mar 7, 2024
29 checks passed
@bena-nasa bena-nasa deleted the feature/bmauer/store_regrid_weights branch March 7, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 Diff The changes in this pull request have verified to be zero-diff with the target branch. 🎁 New Feature This is a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants