Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .github/workflows/build_and_run_cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Build and run CAM-SIMA on CIRRUS

permissions:
contents: read

on:
push:
branches:
- development
pull_request:
branches:
- development
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-and-run-on-CIRRUS:
name: Run ${{ matrix.image }} on ${{ matrix.runner }}
env:
TMP_DIR: tmp
TMP_OUTPUT: case_output.log
strategy:
fail-fast: false
matrix:
test_type: [ SMS_Ln2 ]
compset: [ FPHYStest ]
res: [ ne3pg3_ne3pg3_mg37 ]
test_config: [ outfrq_rrtmgp_cirrus_gpu ]
image: [ ubuntu24.04_nvhpc25.7_openmpi5.0.8_cuda12.9:e9f55f1 ]
include:
- image: ubuntu24.04_nvhpc25.7_openmpi5.0.8_cuda12.9:e9f55f1
runner: gha-runner-gpu-camsima
compiler: nvhpc
runs-on: ${{ matrix.runner }}
environment: CI-tests-on-CIRRUS
container:
image: hub.k8s.ucar.edu/cam-sima/${{ matrix.image }}
options: ${{ matrix.runner == 'gha-runner-gpu-camsima' && '--gpus all' }}
env:
NVIDIA_DRIVER_CAPABILITIES: compute,utility
credentials:
username: ${{ secrets.hub_user || 'dummy-user' }}
password: ${{ secrets.hub_password || 'dummy-password' }}
defaults:
run:
shell: bash
steps:
- name: Checkout push code
uses: actions/checkout@v6

- name: Set up some git configurations
run: |
git config --global user.email "[email protected]"
git config --global user.name "example_user"

- name: Checkout individual components
run: |
./bin/git-fleximod -C "${GITHUB_WORKSPACE}" update

- name: Build and run ${{ matrix.test_type }} test of ${{ matrix.compset }} at ${{ matrix.res }} resolution
run: |
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PIO/lib:$NETCDF_FORTRAN_PATH/lib:$NETCDF_C_PATH/lib:$LAPACK/lib:$LAPACK/lib64:$PNETCDF/lib"
if [ "${{ matrix.runner }}" = "gha-runner-gpu-camsima" ]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CUDA_ROOT/lib64:$CUDA_ROOT/lib64/stubs"
fi
cd cime/scripts
./create_test "${{ matrix.test_type }}.${{ matrix.res }}.${{ matrix.compset }}.cirrus_${{ matrix.compiler }}.cam-${{ matrix.test_config }}" --output-root "/$TMP_DIR/ci_test" --no-batch 2>&1 | tee "$TMP_OUTPUT"

- name: Check the test PASS/FAIL status
if: always()
run: |
cd /$TMP_DIR/ci_test
STATUS_OUTPUT=$(./cs.status.*)
echo "$STATUS_OUTPUT"
OVERALL_STATUS=$(echo "$STATUS_OUTPUT" | grep -oP 'Overall:\s*\K\w+')
if [ "$OVERALL_STATUS" = "PASS" ]; then
echo "Test passed"
else
echo "Test FAILED (Overall status: ${OVERALL_STATUS:-not found})"
exit 123
fi

- name: Upload logs to GitHub artifacts when the CI test fails
if: failure()
uses: actions/upload-artifact@v7
with:
name: logs.${{ matrix.test_type }}.${{ matrix.compset }}.${{ matrix.compiler }}.${{ matrix.runner }}
path: |
/"$TMP_DIR"/ci_test/"${{ matrix.test_type }}.${{ matrix.res }}.${{ matrix.compset }}.cirrus_${{ matrix.compiler }}.cam-${{ matrix.test_config }}.*"/bld/atm.bldlog*
/"$TMP_DIR"/ci_test/"${{ matrix.test_type }}.${{ matrix.res }}.${{ matrix.compset }}.cirrus_${{ matrix.compiler }}.cam-${{ matrix.test_config }}.*"/bld/cesm.bldlog*
/"$TMP_DIR"/ci_test/"${{ matrix.test_type }}.${{ matrix.res }}.${{ matrix.compset }}.cirrus_${{ matrix.compiler }}.cam-${{ matrix.test_config }}.*"/run/cesm.log*
/"$TMP_DIR"/ci_test/"${{ matrix.test_type }}.${{ matrix.res }}.${{ matrix.compset }}.cirrus_${{ matrix.compiler }}.cam-${{ matrix.test_config }}.*"/run/atm.log*
retention-days: 7
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
[submodule "ccs_config"]
path = ccs_config
url = https://github.com/ESMCI/ccs_config_cesm.git
fxtag = ccs_config_cesm1.0.72
fxtag = ccs_config_cesm1.0.76
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git
[submodule "cdeps"]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
./xmlchange NTASKS=4
./xmlchange NTHRDS=1
./xmlchange ROOTPE='0'
./xmlchange ROF_NCPL=$(./xmlquery --value ATM_NCPL)
./xmlchange GLC_NCPL=$(./xmlquery --value ATM_NCPL)
./xmlchange TIMER_DETAIL='6'
./xmlchange TIMER_LEVEL='999'
./xmlchange GPU_TYPE=a10
./xmlchange OPENACC_GPU_OFFLOAD=TRUE
./xmlchange OVERSUBSCRIBE_GPU=TRUE
./xmlchange NGPUS_PER_NODE=1
./xmlchange CAM_CONFIG_OPTS="--dyn none --physics-suites rrtmgp"
./xmlchange RUN_STARTDATE=1979-01-01
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
! these are CPU FHISTC_LTso snapshots
ncdata = '/glade/sima_baselines/cam_sima_test_snapshots/cam_ne3pg3_fhistc_ltso_rrtmgp_derecho_gnu_before_c20251013.nc'
ncdata_check = '/glade/sima_baselines/cam_sima_test_snapshots/cam_ne3pg3_fhistc_ltso_rrtmgp_derecho_gnu_after_c20251013.nc'

! tolerances for testing (currently have high tolerance due to CPU snapshots)
ncdata_check_err = .true.
min_difference = 1e-08

! vertical levels in snapshot
pver = 58

! Do radiation on every timestep we're testing
irad_always=3

! diagnostic output
hist_output_frequency;h1: 1*nsteps
hist_precision;h1: REAL64
hist_add_inst_fields;h1: HR
! Cloud output
hist_add_inst_fields;h1: TOT_CLD_VISTAU,TOT_ICLD_VISTAU,ICE_ICLD_VISTAU,LIQ_ICLD_VISTAU
! Longwave diagnostic output
hist_add_inst_fields;h1: QRL,QRLC,FLNT,FLNTC,FLUT,FLUTC,LWCF,FLN200,FLN200C,FLNR,FLNS,FLNSC,FLDS,FLDSC,FUL,FDL,FULC,FDLC
! Shortwave diagnostic fields
hist_add_inst_fields;h1: SOLIN,QRS,QRSC,FSNT,FSNTC,FSNTOA,FSNTOAC,SWCF,FSUTOA,FSN200,FSN200C,FSNR,SOLL,SOLS,SOLLD,SOLSD
hist_add_inst_fields;h1: FSNS,FSNSC,FSDS,FSDSC,FUS,FDS,FUSC,FDSC
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
! Set fixed orbital parameters
orb_mode='fixed_parameters'
orb_eccen = 0.
orb_obliq = 0.
orb_mvelp = 0.
Loading