Skip to content

[feature/capgen-v1] Remove redundant suite name from suite cap symbols (#786) - #787

Open
climbfuji wants to merge 2 commits into
NCAR:feature/capgen-v1from
climbfuji:feature/bugfix_intel_symbol_mangling_length
Open

climbfuji wants to merge 2 commits into
NCAR:feature/capgen-v1from
climbfuji:feature/bugfix_intel_symbol_mangling_length

Conversation

@climbfuji

@climbfuji climbfuji commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Intel truncates the mangled global name <module>_mp_<SUBROUTINE> at 90 characters. For UFS suite FV3_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 when WARN_AS_ERROR was enabled.

Suite cap subroutines now drop the prefix the module name already supplies:

<suite>_register / _init / _final   ->  suite_register / suite_init / suite_final
<suite>_physics_<phase>             ->  suite_physics_<phase>
<suite>_suite_state_(de)alloc       ->  suite_state_(de)alloc

Group caps and ccpp_<suite>_data were already prefix-free. With this, the 94-character symbol becomes 70 characters.

  • No host-facing API change. The host cap use-renames them back to <suite>_<what> on import.
  • We use suite_ rather than a bare physics_ prefix, because suite caps use-associate <group>_<phase> and groups are commonly named physics. A new guard rejects a colliding group name.
  • Trace strings and runtime error messages keep the full <suite>_<what> form via a separate sub_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 TestMangledGlobalNameLength unit 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 section TestMangledGlobalNameLength.

Unrelated change

Update of Claude's project memory (all updates in doc/*) - ignore.

Issues

Fixes #786

Testing

  • unit tests (locally and CI)
  • end-to-end tests (locally and CI)
  • UFS
  • CCPP-SCM
  • NEPTUNE
  • CAM-SIMA (?)

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:

  • Host code — CAM-SIMA calls 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/python reference files — none contains generated suite-cap output. The *_host.F90 samples 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.
  • Build / 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:

  use ccpp_cld_suite_cap, only: &
    cld_suite_register => suite_register, &
    cld_suite_physics_run => suite_physics_run, &
    ...

…apgen/generator/suite_cap.py and unit tests to fix issue 786 - global name too long due to Intel's global symbol mangling
@climbfuji climbfuji self-assigned this Sep 16, 2026
@climbfuji climbfuji changed the title Feature/bugfix intel symbol mangling length [capgen-v1] Remove redundant suite name from suite cap symbols (#786) Sep 16, 2026
@climbfuji climbfuji added the capgen-unification Issues/PRs necessary for capgen/prebuild unification label Sep 16, 2026
@climbfuji
climbfuji marked this pull request as ready for review September 16, 2026 18:46
@climbfuji
climbfuji requested review from a team as code owners September 16, 2026 18:46
@climbfuji

Copy link
Copy Markdown
Collaborator Author

@dustinswales FYI. You got booted off the repo. I invited you back in, but can't add you as reviewer yet.

@climbfuji

Copy link
Copy Markdown
Collaborator Author

ufs-community/ufs-weather-model#3174 needs this update

@climbfuji climbfuji changed the title [capgen-v1] Remove redundant suite name from suite cap symbols (#786) [feature/capgen-v1] Remove redundant suite name from suite cap symbols (#786) Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capgen-unification Issues/PRs necessary for capgen/prebuild unification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant