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

Add edge masks to default arguments of make_region_masks landice framework function #786

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

andrewdnolan
Copy link
Contributor

@andrewdnolan andrewdnolan commented Mar 5, 2024

Description:
This PR adds edge region masks to the default options of the make_region_masks function within the mesh module of the landice framework.

The addition of edge masks for regions is needed the by the recent addition of SGH quantities to regional stats analysis member in MALI-Dev (MALI-Dev/E3SM#105).

Originally, we planned on adding vertex masks aswell, to forestall future problems. But after some experimentation with the antarctic/mesh_gen testcase, the additional masks slow down testcase execution considerably (~50%). As very few variables are defined on vertices, we've opted to leave them out of the defaults for now.

Checklist

  • Document (in a comment titled Testing in this PR) any testing that was used to verify the changes

The vertex (and Edge) masks slow down the `antarctic/mesh_gen` testcase
considerably (~50% for default config options). As _very_ few fields
are defined on vertices, we've opted to remove vertex masks from the
defaults and only include cell and edge maks, as those are where
variables are more commonly defined.
@andrewdnolan
Copy link
Contributor Author

Testing

In order to test this PR, I've run the antarctic/mesh_gen testcase.

The testcase passes:

landice/antarctica/mesh_gen
  * step: mesh
  test execution:      SUCCESS

and the edge masks are present in the region mask files:

$ ncdump -h Antarctica_ismip6_regionMasks.nc

netcdf Antarctica_ismip6_regionMasks {
dimensions:
        nCells = 384370 ;
        nRegions = 16 ;
        StrLen = 18 ;
        string208 = 208 ;
        nEdges = 1158404 ;
variables:
        int regionEdgeMasks(nEdges, nRegions) ;
        int regionCellMasks(nCells, nRegions) ;
        char history(nRegions, string208) ;
                history:_Encoding = "utf-8" ;
        char regionNames(nRegions, StrLen) ;

The compass test case ran in 40:08 using the default config options, which is notable slowdown. Without the edge masks the testcase ran in 29:55 .

@andrewdnolan andrewdnolan changed the title Add edge and vertex masks as defaults to make_region_masks landice framework function Add edge masks to default arguments of make_region_masks landice framework function Mar 7, 2024
Copy link
Member

@matthewhoffman matthewhoffman left a comment

Choose a reason for hiding this comment

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

@andrewdnolan , thanks for taking care of this and testing out the impact on performance.

@matthewhoffman matthewhoffman merged commit e4b4851 into MPAS-Dev:main Mar 7, 2024
4 checks passed
@andrewdnolan andrewdnolan deleted the regionEdgeMasks branch March 8, 2024 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants