Skip to content

Make SatAdj unit tests hardware portable#3184

Open
pressel wants to merge 5 commits into
erf-model:developmentfrom
pressel:kylepres/sa_test_portable
Open

Make SatAdj unit tests hardware portable#3184
pressel wants to merge 5 commits into
erf-model:developmentfrom
pressel:kylepres/sa_test_portable

Conversation

@pressel
Copy link
Copy Markdown
Collaborator

@pressel pressel commented May 18, 2026

Summary

This PR makes the Saturation Adjustment (SatAdj) unit tests hardware portable through AMReX and improves the inline documentation around the SatAdj test suite.

This is a testing and documentation-only update. It does not change the SatAdj physical formulation or production SatAdj physics behavior.

Changes

  • Refactors the SatAdj MultiFab unit tests so they run through an AMReX-portable path rather than being skipped in GPU builds.
  • Adds a portable kernel-path test that calls SatAdj::AdjustSatAdjCell from inside amrex::ParallelFor.
  • Compares the kernel-path result against the existing host scalar reference.
  • Keeps GTest assertions on the host and uses AMReX setup/checking paths for CPU and GPU portability.
  • Adds targeted inline comments documenting:
    • the SatAdj test contract,
    • key physical invariants,
    • pressure-unit expectations,
    • the subtle evaporation-then-recondensation branch,
    • the SHOC no-op motivation,
    • why the kernel-path test exists,
    • the CUDA/GTest device-lambda placement constraint.
  • Keeps the existing scalar thermodynamics and cell-property tests intact.

Motivation

The previous SatAdj unit tests covered the scalar physics well, but the MultiFab public-flow tests skipped GPU builds. Production SatAdj executes AdjustSatAdjCell inside an AMReX ParallelFor, so the tests should exercise that hardware-portable path as well.

This PR closes that gap without adding a separate GPU-only implementation of the tests. The same AMReX-portable test logic is used across backends.

What this does not change

  • No change to the SatAdj physical formulation.
  • No change to production SatAdj algorithm behavior.
  • No new regression tests.
  • No new gold files.
  • No new runtime dependencies.

@pressel pressel requested review from AMLattanzi and asalmgren May 18, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants