+Fix myStats global indexing segmentation faults#565
Closed
Hallberg-NOAA wants to merge 7 commits into
Closed
Conversation
Revised the interfaces to the myStats routine in the horizontal_regridding module to avoid segmentation faults due to inconsistent horizontal indices and array extents in global indexing mode. Rather than passing in absolute array extents to work on, an ocean grid type is now passed as an argument to myStats, with the new optional full_halo argument used to capture the case where the tracer statistics are being taken over the full data domain. The most frequently encountered problems occurred when the hard-coded debug variable in the horiz_interp_and_extrap_tracer routines are changed from false to true. When global indexing is not used, this revised work exactly as before, but when it is used with global indexing, it avoids segmentation faults that were preventing the model from running in some cases with all debugging enabled.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev/gfdl #565 +/- ##
============================================
- Coverage 37.17% 37.16% -0.01%
============================================
Files 271 271
Lines 80657 80660 +3
Branches 15047 15048 +1
============================================
Hits 29981 29981
- Misses 45102 45105 +3
Partials 5574 5574 ☔ View full report in Codecov by Sentry. |
- It was blowing up with "forrtl: error (65): floating invalid" when accessing dz in the halo at the boundary, but just sometimes. My default layout is trouble while my testing layout of 48 cores is not.
-even for PPM advection and OBCs.
Removed allocated tests for the potentially statically allocated arrays CS%uhtr and CS%vhtr in a newly added line testing whether there are OBCs in use that would require a halo update on these arrays. Even in dynamic memory mode, these arrays are always being allocated, so these tests served no purpose, but in static memory mode they led to compile time errors. All answers are bitwise identical.
marshallward
approved these changes
Mar 9, 2024
Member
|
Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/22554 ✔️ |
Member
|
This PR got a bit mangled because I merged in an unsquashed PR which I retroactively squashed. Since it is passing all of our tests, I manually rebased this one into dev/gfdl: 0ff03ae |
This was referenced May 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revised the interfaces to the
myStats()routine in thehorizontal_regriddingmodule to avoid segmentation faults due to inconsistent horizontal indices and array extents in global indexing mode. Rather than passing in absolute array extents to work on, an ocean grid type is now passed as an argument tomyStats(), with the new optionalfull_haloargument used to capture the case where the tracer statistics are being taken over the full data domain. The most frequently encountered problems occurred when the hard-codeddebugvariables in thehoriz_interp_and_extrap_tracer()routines are changed from false to true. When global indexing is not used, this revised work exactly as before, but when it is used with global indexing, it avoids segmentation faults that were preventing the model from running in some cases with all debugging enabled.