Conversation
…apgen/generator/suite_cap.py and unit tests to fix issue 786 - global name too long due to Intel's global symbol mangling
climbfuji
marked this pull request as ready for review
September 16, 2026 18:46
Collaborator
Author
|
@dustinswales FYI. You got booted off the repo. I invited you back in, but can't add you as reviewer yet. |
4 of 32 tasks
Collaborator
Author
|
ufs-community/ufs-weather-model#3174 needs this update |
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
Intel truncates the mangled global name
<module>_mp_<SUBROUTINE> at 90 characters. For UFS suiteFV3_GFS_v17_coupled_p8_ugwpv1, Intel generated a global name of 94 characters,ccpp_FV3_GFS_v17_coupled_p8_ugwpv1_cap_mp_FV3_GFS_V17_COUPLED_P8_UGWPV1_PHYSICS_TIMESTEP_FINAL; UFS builds failed whenWARN_AS_ERRORwas enabled.Suite cap subroutines now drop the prefix the module name already supplies:
Group caps and
ccpp_<suite>_datawere already prefix-free. With this, the 94-character symbol becomes 70 characters.<suite>_<what>on import.suite_rather than a barephysics_prefix, because suite caps use-associate<group>_<phase>and groups are commonly namedphysics. A new guard rejects a colliding group name.<suite>_<what>form via a separatesub_label.Longest supported suite name is now 40 characters, bounded by the host cap's alias against Fortran's 63-char name limit and enforced at generation time. The new
TestMangledGlobalNameLengthunit test generates at that ceiling and asserts no emitted symbol contains the suite name.🤖 Generated with Claude Code
https://claude.ai/code/session_018LCwe5wtTR5m9qJtPRGMWe
Note. I trimmed down the comments from Claude in
capgen/generator/*for this change, but I didn't bother doing that for the newly added unit test sectionTestMangledGlobalNameLength.Unrelated change
Update of Claude's project memory (all updates in
doc/*) - ignore.Issues
Fixes #786
Testing
Note for CAM-SIMA developers
No CAM-SIMA-side changes are needed; the renamed symbols are internal to the generated suite cap. Specifically, all of these were checked and are unaffected:
ccpp_physics_<phase>on<host>_ccpp_cap; those entry points are unchanged. No CAM-SIMA source names a suite-cap subroutine.cime_config/capgen_compat/— no references.test/unit/pythonreference files — none contains generated suite-cap output. The*_host.F90samples use capgen v0's<host>_ccpp_physics_<stage>naming and are hand-written inputs.datatable.xml— records suite, group and scheme entry points; no suite-cap subroutine names.cam_autogen.py/ CMake — generated file names are unchanged (ccpp_<suite>_cap.F90); only subroutine names inside changed.The one thing you will see is a longer use statement in the generated host cap, now wrapped one import per continued line: