Skip to content

Workflows: add homme standalone testing on ghci runners - #8952

Merged
bartgol merged 5 commits into
masterfrom
claude/tender-albattani-n2zxdo
Oct 27, 2026
Merged

bartgol merged 5 commits into
masterfrom
claude/tender-albattani-n2zxdo

Conversation

@bartgol

@bartgol bartgol commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Add a GitHub workflow that runs the standalone homme tests (gnu, intel, and cuda) on the self-hosted ghci runners whenever files in components/homme are touched.

[BFB]


Summary

Add .github/workflows/homme-testing.yml, which runs components/homme/utils/test_homme.py on the same self-hosted runners used by the eamxx workflows, for PRs touching components/homme/** (plus the workflow itself, get-cuda-arch, config_machines.xml, externals/ekat, and externals/scorpio). A manual workflow_dispatch with bless generates baselines.

The PR has 5 commits, one per logical change: (1) --machine-file option for test_homme.py, (2) build cprnc along with the test executables, (3) the ghci machine files, (4) the workflow, (5) a fix for a unit test that passes device pointers to MPI (cuda).

This is the first of a few stacked PRs. bfb testing (cxx vs f90, without baselines) is left to a follow-up PR stacked on this one.

Workflow

  • Matrix: runner in {gnu, intel, cuda}. The runner label is also the name of the machine file; the CIME compiler for the cuda runner is gnugpu.
  • Only the submodules homme needs (cime, ekat, scorpio) are checked out. The ssh urls in .gitmodules are rewritten to https for the clone.
  • A Set test resources step splits the node, since homme tests do not reserve cpus/gpus: max ranks per test (USE_NUM_PROCS, passed with --cmake-opt: 4 on cpu, 2 on gpu) x threads per rank (2 on cpu, 1 on gpu) x number of concurrent tests (--run-parallel-level) must fit in the node size taken from CIME (MAX_MPITASKS_PER_NODE: 32 cores, or 2 gpus for gnugpu). OMP_NUM_THREADS and OMP_STACKSIZE are set explicitly, and the tests run with an unlimited stack (with few ranks per test, each rank holds a lot of data).
  • On failure, the failed tests and the error messages of the first failing runs are printed, and the .err files are uploaded.

Machine files (cmake/machineFiles)

  • ghci.cmake (common settings), plus ghci-gnu, ghci-intel, and ghci-cuda.
  • Kokkos_ENABLE_DEPRECATED_CODE_5 must stay ON: with it OFF, Kokkos 5.1 aborts if the vector length of a TeamPolicy is not a power of 2, and Homme's CPU code uses the number of level packs (e.g., 3 for nlev20) as vector length in BoundaryExchange.cpp.
  • HOMMEXX_MPI_ON_DEVICE is OFF for cuda, since the runners' MPI is not cuda-aware yet.

Changes to existing homme files (all opt-in; behavior is unchanged when the new options are not used)

  • test_homme.py: new --machine-file (pick the machine file by name). It now passes the name of the machine file (including the -bfb suffix) to ctest_script.cmake via MACHINE_FILE. The EXTRA_CMAKE_OPTIONS argument is now shell-quoted (identical for a single option; with 2+ options the unquoted ; used to split the shell command).
  • ctest_script.cmake: support for the option above (MACHINE_FILE).
  • test_execs/CMakeLists.txt: the test-execs target now depends on cprnc, as check already does. This matters when cprnc is compiled from the CIME sources: ctest_script.cmake only builds test-execs, so the tests would otherwise miss cprnc. If cprnc is a prebuilt binary (found via CPRNC_DIR), it is an imported target and nothing extra gets built.
  • src/share/compose/cedr_caas.cpp: in GPU builds with HOMMEXX_MPI_ON_DEVICE=OFF, the CAAS unit test skips the variant without a user reducer, which hands device buffers directly to MPI_Allreduce (production code always uses a reducer that stages through host memory). This was the likely cause of the compose_ut_test segfault on cuda (to be confirmed in CI).

Status / notes

  • Seen in CI so far (before the split): intel (all test runs succeed, cprnc is built through the new dependency; only the tests that compare against baselines fail, since baselines do not exist yet), and cuda (builds and runs on H100; only the missing baselines fail, plus compose_ut_test, addressed by commit 5).
  • Not yet seen: gnu has not run yet (the runner is busy with other workflows), and the latest head has not completed in CI.
  • Baselines must be generated once per compiler (run the workflow manually with bless, normally on master) into /projects/e3sm/data/baselines/ghci/<compiler>/master/homme.
  • No nightly schedule or CDash submission was added.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SaJsK9j78W8TBXGQqGLfDs

@bartgol bartgol self-assigned this Oct 22, 2026
@bartgol bartgol added HOMME standalone issues with the standalone HOMME code that dont impact E3SM CI: workflow change approved Allow gh action PR testing on ghci-snl-* machines for PRs that alter a worfklow file workflows labels Oct 22, 2026
@bartgol
bartgol marked this pull request as ready for review October 22, 2026 16:58
@bartgol
bartgol requested review from jgfouca and tcclevenger and a balanced review from Copilot October 22, 2026 17:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

CUDA option handling, compiler environment propagation, MPI configuration, and test concurrency need correction before these jobs can run reliably.

4 open issues
What changed in this PR

Add standalone HOMME testing to the existing self-hosted ghci infrastructure
for pull requests affecting HOMME and selected dependencies.

Changes:

  • Add GNU/OpenMP, Intel/OpenMP, and GNU/CUDA workflow jobs, with manual
    baseline generation and CTest log uploads.
  • Add shared and compiler-specific ghci machine configurations.
  • Forward the requested compiler to CTest and prefer compiler-specific
    machine files, retaining the generic fallback.
File Description
components/​homme/​utils/​test_homme.py Forward the explicit compiler selection to CTest.
components/​homme/​cmake/​machineFiles/​ghci.cmake Define shared runner and testing settings.
components/​homme/​cmake/​machineFiles/​ghci-intel.cmake Configure Intel, OpenMP, and MKL.
components/​homme/​cmake/​machineFiles/​ghci-gnugpu.cmake Configure CUDA and MPI compiler backends.
components/​homme/​cmake/​machineFiles/​ghci-gnu.cmake Configure GNU, OpenMP, and OpenBLAS.
components/​homme/​cmake/​ctest_script.cmake Select compiler-specific machine files when available.
.github/​workflows/​homme-testing.yml Run the test matrix and support baseline generation.

Review effort: Balanced

Comment thread .github/workflows/homme-testing.yml Resolved
Comment thread .github/workflows/homme-testing.yml Resolved
Comment thread .github/workflows/homme-testing.yml Resolved
@bartgol
bartgol force-pushed the claude/tender-albattani-n2zxdo branch 4 times, most recently from 9423349 to 43238c6 Compare October 23, 2026 06:23
bartgol and others added 5 commits October 23, 2026 06:34
Add --machine-file, to use a different file from cmake/machineFiles than the one
named like the machine (e.g., if a machine has one file per compiler).

test_homme.py now passes the name of the machine file (including the -bfb suffix
when --bfb is used) to ctest_script.cmake via MACHINE_FILE, rather than passing
MACHINE and letting the cmake script figure out the file name.

Also quote EXTRA_CMAKE_OPTIONS: it is a ';'-separated cmake list, which the
shell would otherwise split.

Nothing changes for callers that do not use the new option.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SaJsK9j78W8TBXGQqGLfDs
The tests need cprnc, but only the 'check' target depended on it. So, if cprnc
is compiled from the CIME sources (i.e., it was not found in CPRNC_DIR) and one
only builds the 'test-execs' target (as ctest_script.cmake does), the tests fail
because cprnc is missing. Make 'test-execs' depend on cprnc too, as 'check' does.

If cprnc is a prebuilt binary (found via CPRNC_DIR), cprnc is an imported target,
so nothing else gets built.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SaJsK9j78W8TBXGQqGLfDs
Add ghci.cmake, with the settings common to all the ghci images, and one file
per image: ghci-gnu, ghci-intel, and ghci-cuda.

The files also keep the code deprecated in Kokkos 5 enabled: without it, Kokkos
aborts if the vector length of a TeamPolicy is not a power of 2, which Homme's
CPU code does not guarantee (BoundaryExchange.cpp uses the number of level
packs).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SaJsK9j78W8TBXGQqGLfDs
Run components/homme/utils/test_homme.py on the self-hosted ghci runners (gnu,
intel, cuda) whenever files in components/homme are touched. Baselines are
generated by running the workflow manually, with the 'bless' input.

Only the submodules that Homme needs are checked out. A setup step splits the
node (CIME's MAX_MPITASKS_PER_NODE) between ranks per test (4 on cpu, 2 on gpu),
threads per rank, and number of tests run at once, since Homme tests do not
reserve cpus/gpus. When a job fails, the failed tests and their error messages
are printed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SaJsK9j78W8TBXGQqGLfDs
Without a user reducer, CAAS::reduce_globally hands its (device) buffers
directly to MPI_Allreduce. If MPI is not device aware (COMPOSE_MPI_ON_HOST,
i.e., HOMMEXX_MPI_ON_DEVICE=OFF), that segfaults on GPU builds. Production code
always installs a reducer that stages through host memory, so only the unit
test hits this: skip the no-reducer variant in that configuration.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SaJsK9j78W8TBXGQqGLfDs

bartgol commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

CI status for head 998ffe7 (all jobs only fail on the missing baselines, as expected before bless):


Generated by Claude Code

@bartgol
bartgol added this pull request to stack #8961 October 23, 2026 16:30
@bartgol
bartgol removed this pull request from stack #8961 October 23, 2026 16:30
@bartgol
bartgol added this pull request to stack #8962 October 23, 2026 17:23
bartgol added a commit that referenced this pull request Oct 23, 2026
Add a GitHub workflow that runs the standalone homme tests (gnu, intel, and cuda)
on the self-hosted ghci runners whenever files in components/homme are touched.

[BFB]
@bartgol
bartgol merged commit 7261bd3 into master Oct 27, 2026
15 of 18 checks passed
@bartgol
bartgol deleted the claude/tender-albattani-n2zxdo branch October 27, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: workflow change approved Allow gh action PR testing on ghci-snl-* machines for PRs that alter a worfklow file HOMME standalone issues with the standalone HOMME code that dont impact E3SM workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants