Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test updates #279

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
36 changes: 27 additions & 9 deletions .github/workflows/Spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,47 @@ on:
branches:
- develop

# Cancel in-progress workflows when pushing to a branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
# This job builds with Spack using every combination of variants and runs the CTest suite each time
Spack:
permissions:
packages: read
strategy:
matrix:
os: ["ubuntu-latest"]
variants: ["+openmp +shared +pic precision=d", "+openmp ~shared ~pic precision=4", "~openmp ~shared +pic precision=8"]
runs-on: ${{ matrix.os }}
config:
- {
os: "ubuntu-24.04",
variants: "precision=d +openmp +shared +pic",
cache-key: "A",
extrapkgs: "grib-util@develop +tests ^g2c@develop +utils +build_v2_api ^[email protected]:",
}
- {
os: "ubuntu-24.04",
variants: "precision=4 +openmp ~shared ~pic",
cache-key: "B",
}
- {
os: "ubuntu-24.04",
variants: "precision=8 ~openmp ~shared +pic",
cache-key: "C",
}
runs-on: ${{ matrix.config.os }}

steps:

- name: "Install OpenBLAS"
run: sudo apt install libopenblas-serial-dev

- name: "Build Spack package"
uses: NOAA-EMC/ci-test-spack-package@develop
with:
package-name: ip
package-variants: ${{ matrix.variants }} ${{ matrix.variants == '+openmp +shared +pic precision=d' && 'grib-util@develop +tests ^g2c@develop +utils +build_v2_api ^[email protected]:' || '' }}
package-variants: ${{ matrix.config.variants }} ${{ matrix.config.extrapkgs }}
custom-recipe: spack/package.py
spack-compiler: gcc
spack-externals: gmake cmake openblas
repo-cache-key-suffix: ${{ matrix.os }}-${{ matrix.variants }}-1
repo-cache-key-suffix: ${{ matrix.config.cache-key }}

# This job validates the Spack recipe by making sure each cmake build option is represented
recipe-check:
Expand Down
5 changes: 5 additions & 0 deletions docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ therefore requires an external BLAS/LAPACK provider. In practice, this should
generally be OpenBLAS, which is the [spack-stack](https://github.com/JCSDA/spack-stack)
BLAS/LAPACK provider.

\note When running unit tests, excluding the CTest label SLOW_TEST may be used
to avoid slow-running tests (15 seconds to 1 or 2 minutes depending on
optimization settings). The NO_INPUT_DATA label may be used to run only tests
which do not require files obtained remotely when FTP_TEST_FILES=ON.

## Interpolation

### Interpolation Methods
Expand Down
18 changes: 18 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,22 @@ foreach(kind ${kinds})
create_sp_test(test_fft ${kind} 0.3)
create_sp_test(test_sptrung ${kind} 0.3)
create_sp_test(test_sptrungv ${kind} 2)

# label tests without input data to allow trimmed down unit test runs
set(noinputdatatests
"test_earth_radius"
"test_fft"
"test_ipxwafs"
"test_ncpus"
"test_splaplac"
"test_splat"
"test_sppad"
"test_sptezv"
"tst_gdswzd_c_grib1"
"tst_gdswzd_c_grib2"
)
foreach(noinputdatatest IN LISTS noinputdatatests)
set_tests_properties("${noinputdatatest}_${kind}" PROPERTIES LABELS "NO_INPUT_DATA")
endforeach()

endforeach()
4 changes: 2 additions & 2 deletions tests/interp_mod_grib1.F90
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ subroutine interp_vector(grid, interp_opt)
12191, 12191, 0, 64, 25000, 25000, 0, 0, 0, 0, 0, 0, 255, 180*0/

#if (LSIZE==4)
abstol=0.05
ntol = 10
abstol=0.1
ntol = 15
#else
abstol=0.0001
ntol = 0
Expand Down
2 changes: 1 addition & 1 deletion tests/interp_mod_grib2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ subroutine interp_vector(grid, interp_opt)

#if (LSIZE==4)
abstol=0.05
ntol = 10
ntol = 15
#else
abstol=0.0001
ntol = 0
Expand Down
Loading