Skip to content

Convert masks to int type in cull() function#521

Merged
xylar merged 2 commits intoMPAS-Dev:masterfrom
xylar:type-conversion-in-cull
Aug 18, 2023
Merged

Convert masks to int type in cull() function#521
xylar merged 2 commits intoMPAS-Dev:masterfrom
xylar:type-conversion-in-cull

Conversation

@xylar
Copy link
Collaborator

@xylar xylar commented Aug 17, 2023

The new version of the cell culler requires masks in int (rather than int64 or float) format.

This is needed because output in NETCDF4 format is producing int64, rather than int32, arrays but the cell culller is then reading a full int64 data array into memory allocated for an int32 array, thus overwriting a lot of memory allocated for other arrays with garbage.

@xylar xylar self-assigned this Aug 17, 2023
@xylar xylar force-pushed the type-conversion-in-cull branch 3 times, most recently from ff12f8e to dbdfb22 Compare August 17, 2023 19:53
@xylar xylar force-pushed the type-conversion-in-cull branch from dbdfb22 to 09626a4 Compare August 17, 2023 20:23
@xylar
Copy link
Collaborator Author

xylar commented Aug 17, 2023

Testing

I was able to cull the mesh in the QUwISC240 and RRSwISC6to18 mesh test cases with output in NETCDF4 format in compass with this branch, whereas it was crashing without these changes.

The new version of the cell culler requires masks in int (rather
than int64 or float) format.
@xylar xylar force-pushed the type-conversion-in-cull branch from 09626a4 to 45291ef Compare August 18, 2023 06:09
@xylar xylar merged commit 9da23ab into MPAS-Dev:master Aug 18, 2023
@xylar xylar deleted the type-conversion-in-cull branch August 18, 2023 11:17
xylar added a commit to xylar/MPAS-Tools that referenced this pull request Nov 4, 2025
This debug output was inadvertently left in MPAS-Dev#521
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant