|
| 1 | +name: "pyFV3 translate tests (subset)" |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + inputs: |
| 5 | + component_trigger: |
| 6 | + type: boolean |
| 7 | + default: false |
| 8 | + required: false |
| 9 | + component_name: |
| 10 | + type: string |
| 11 | + default: '' |
| 12 | + required: false |
| 13 | + pull_request: |
| 14 | + |
| 15 | +# cancel running jobs if theres a newer push |
| 16 | +concurrency: |
| 17 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 18 | + cancel-in-progress: true |
| 19 | + |
| 20 | +jobs: |
| 21 | + pyFV3_translate_tests: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + container: |
| 24 | + image: ghcr.io/noaa-gfdl/miniforge:mpich |
| 25 | + steps: |
| 26 | + |
| 27 | + - name: External trigger Checkout pyFV3 |
| 28 | + if: ${{inputs.component_trigger}} |
| 29 | + uses: actions/checkout@v4 |
| 30 | + with: |
| 31 | + submodules: 'recursive' |
| 32 | + repository: noaa-gfdl/pyFV3 |
| 33 | + path: pyFV3 |
| 34 | + |
| 35 | + - name: Checkout hash that triggered CI |
| 36 | + uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + submodules: 'recursive' |
| 39 | + path: pyFV3/${{inputs.component_name}} |
| 40 | + |
| 41 | + - name: External trigger install NDSL packages |
| 42 | + if: ${{inputs.component_trigger}} |
| 43 | + run: | |
| 44 | + cd ${GITHUB_WORKSPACE}/pyFV3 |
| 45 | + cd NDSL && pip3 install .[test] && cd ../ |
| 46 | + pip3 install .[test] |
| 47 | +
|
| 48 | + - name: Install pyFV3 packages |
| 49 | + if: ${{ ! inputs.component_trigger }} |
| 50 | + run : | |
| 51 | + cd ${GITHUB_WORKSPACE}/pyFV3 |
| 52 | + pip install .[ndsl,test] |
| 53 | +
|
| 54 | + - name: Prepare test_data |
| 55 | + run: | |
| 56 | + cd ${GITHUB_WORKSPACE}/pyFV3 |
| 57 | + mkdir -p test_data && cd test_data |
| 58 | + wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.tar.gz |
| 59 | + tar -xzvf 8.1.3_c12_6ranks_standard.tar.gz --no-same-owner |
| 60 | + cd .. |
| 61 | +
|
| 62 | + - name: NumPy FvTp2d |
| 63 | + run: | |
| 64 | + cd ${GITHUB_WORKSPACE}/pyFV3 |
| 65 | + coverage run --rcfile=setup.cfg -m pytest \ |
| 66 | + -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ |
| 67 | + --backend=numpy \ |
| 68 | + --which_modules=FvTp2d \ |
| 69 | + --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ |
| 70 | + ./tests/savepoint |
| 71 | +
|
| 72 | + - name: Numpy D_SW |
| 73 | + run: | |
| 74 | + cd ${GITHUB_WORKSPACE}/pyFV3 |
| 75 | + coverage run --rcfile=setup.cfg -m pytest \ |
| 76 | + -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ |
| 77 | + --backend=numpy \ |
| 78 | + --which_modules=D_SW \ |
| 79 | + --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ |
| 80 | + ./tests/savepoint |
| 81 | +
|
| 82 | + - name: Numpy Remapping |
| 83 | + run: | |
| 84 | + cd ${GITHUB_WORKSPACE}/pyFV3 |
| 85 | + coverage run --rcfile=setup.cfg -m pytest \ |
| 86 | + -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ |
| 87 | + --backend=numpy \ |
| 88 | + --which_modules=Remapping \ |
| 89 | + --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ |
| 90 | + ./tests/savepoint |
| 91 | +
|
| 92 | + - name: Orchestrated dace-cpu Acoustics |
| 93 | + run: | |
| 94 | + cd ${GITHUB_WORKSPACE}/pyFV3 |
| 95 | + export FV3_DACEMODE=BuildAndRun |
| 96 | + export PACE_FLOAT_PRECISION=64 |
| 97 | + export PACE_TEST_N_THRESHOLD_SAMPLES=0 |
| 98 | + export OMP_NUM_THREADS=1 |
| 99 | + export PACE_LOGLEVEL=Debug |
| 100 | + mpiexec -mca orte_abort_on_non_zero_status 1 -np 6 --oversubscribe coverage run --rcfile=setup.cfg -m mpi4py -m pytest \ |
| 101 | + -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ |
| 102 | + --backend=dace:cpu \ |
| 103 | + -m parallel \ |
| 104 | + --which_rank=0 \ |
| 105 | + --which_modules=DynCore \ |
| 106 | + --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ |
| 107 | + ./tests/savepoint |
0 commit comments