Implement workarounds for modern diag manager with NVHPC#1897
Draft
edoyango wants to merge 7 commits into
Draft
Conversation
Forwarding an absent optional class(*) actual into an explicit-shape dummy varRANGE(2) makes nvfortran (NVHPC 26.3/26.5) emit an unconditional copy-in from the absent descriptor, segfaulting register_static_field when the optional range is omitted (nvbugs TPR #38728). Change the dummy to assumed-shape varRANGE(:) in both fms_register_diag_field_obj entry points, and enforce the size-2 contract explicitly now that the shape is no longer fixed.
) nvfortran (NVHPC 26.3/26.5) miscomputes the per-element c_loc offset for a len=* assumed-shape character dummy, so c_loc(my_array(i)) is wrong for every element past the first, corrupting the modern diag_manager file/variable sort (nvbugs TPR #38727). Give the dummy an explicit element length (character(len=FMS_MAX_FILE_LEN)) so the stride is computed correctly. This requires callers to pass a matching len=FMS_MAX_FILE_LEN array; the two diag callers already do, and the string_utils unit test is updated from len=10 to len=FMS_MAX_FILE_LEN to match.
8 tasks
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.
Description
This PR is built on top of #1873
There are a couple compiler bugs in nvfortran that cause segfaults when using the modern diag manager. One is when sorting filenames (see #1895), and the other is when registering diagnostics (see #1896). This PR addresses them both with workarounds.
The filename sorting issue uses the workaround suggested by nvidia, which was to specify the input character length explicitly in
fms_array_to_pointer, rather than using deferred shape arrays. This worked because the call sites passes arrays of character length 255. However, the test needed to be updated as the test passed in characters of length 10. This does reduce the flexibility offms_array_to_pointer. An alternative workaround is to inline the routines manually (I think this would only be needed in two places).The registration issue is addressed by changing explicit shape to deferred shape (same workaround as suggested in the issue).
Fixes #1895
Fixes #1896
How Has This Been Tested?
Checklist:
make distcheckpassesdiag_yamlchecks would hang, but now they pass (but fail). Next hang at reduction checks.