diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c41e59c..a638648 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,10 +11,10 @@ jobs: uses: actions/checkout@v3.5.2 with: submodules: 'recursive' - - name: Step Python 3.8.12 + - name: Step Python 3.11.7 uses: actions/setup-python@v4.6.0 with: - python-version: '3.8.12' + python-version: '3.11.7' - name: Install OpenMPI for gt4py run: | sudo apt-get install libopenmpi-dev diff --git a/.github/workflows/pace_tests.yaml b/.github/workflows/pace_tests.yaml new file mode 100644 index 0000000..25d729e --- /dev/null +++ b/.github/workflows/pace_tests.yaml @@ -0,0 +1,10 @@ +name: "Pace unit tests" +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] + +jobs: + pace_unit_tests: + uses: NOAA-GFDL/pace/.github/workflows/main_unit_tests.yaml@develop + with: + fv3_trigger: true diff --git a/.github/workflows/pyshield_tests.yaml b/.github/workflows/pyshield_tests.yaml new file mode 100644 index 0000000..6aa574c --- /dev/null +++ b/.github/workflows/pyshield_tests.yaml @@ -0,0 +1,10 @@ +name: "pySHiELD Translate tests" +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] + +jobs: + pyshield_translate_tests: + uses: NOAA-GFDL/PySHiELD/.github/workflows/translate.yaml@develop + with: + fv3_trigger: true diff --git a/.github/workflows/translate.yaml b/.github/workflows/translate.yaml new file mode 100644 index 0000000..a856016 --- /dev/null +++ b/.github/workflows/translate.yaml @@ -0,0 +1,112 @@ +name: "Translate PyFV3 test (subset)" +on: + workflow_call: + inputs: + ndsl_trigger: + type: boolean + default: false + required: true + pull_request: + types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] + +# cancel running jobs if theres a newer push +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + github_repository: ${{github.event.repository.name}} + +jobs: + pyFV3_translate_tests: + runs-on: ubuntu-latest + container: + image: ghcr.io/noaa-gfdl/miniforge:mpich + steps: + + - name: Checkout PyFV3 for external trigger + if: ${{inputs.ndsl_trigger}} + uses: actions/checkout@v4 + with: + submodules: 'recursive' + repository: noaa-gfdl/PyFV3 + path: PyFV3 + + - name: Checkout repository that triggers workflow + uses: actions/checkout@v4 + with: + submodules: 'recursive' + path: ${{env.github_repository}} + + - name: mv NDSL to PyFV3 if NDSL triggers test + if: ${{inputs.ndsl_trigger}} + run: | + cd ${GITHUB_WORKSPACE} + mv ${{env.github_repository}} PyFV3/. + + - name: install packages to test NDSL in PyFV3 + if: ${{inputs.ndsl_trigger}} + run: | + cd ${GITHUB_WORKSPACE}/PyFV3 + cd NDSL && pip3 install .[test] + cd .. && pip3 install .[test] + + - name: Install pyFV3 packages ofr !ndsl_trigger + if: ${{ ! inputs.ndsl_trigger }} + run : | + cd ${GITHUB_WORKSPACE}/PyFV3 + pip install .[ndsl,test] + + - name: Prepare test_data + run: | + cd ${GITHUB_WORKSPACE}/PyFV3 + mkdir -p test_data && cd test_data + wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.tar.gz + tar -xzvf 8.1.3_c12_6ranks_standard.tar.gz --no-same-owner + cd .. + + - name: NumPy FvTp2d + run: | + cd ${GITHUB_WORKSPACE}/PyFV3 + pytest \ + -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ + --backend=numpy \ + --which_modules=FvTp2d \ + --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ + ./tests/savepoint + + - name: Numpy D_SW + run: | + cd ${GITHUB_WORKSPACE}/PyFV3 + pytest \ + -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ + --backend=numpy \ + --which_modules=D_SW \ + --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ + ./tests/savepoint + + - name: Numpy Remapping + run: | + cd ${GITHUB_WORKSPACE}/PyFV3 + pytest \ + -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ + --backend=numpy \ + --which_modules=Remapping \ + --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ + ./tests/savepoint + - name: Orchestrated dace-cpu Acoustics + run: | + cd ${GITHUB_WORKSPACE}/PyFV3 + export FV3_DACEMODE=BuildAndRun + export PACE_FLOAT_PRECISION=64 + export PACE_TEST_N_THRESHOLD_SAMPLES=0 + export OMP_NUM_THREADS=1 + export PACE_LOGLEVEL=Debug + mpiexec -mca orte_abort_on_non_zero_status 1 -np 6 --oversubscribe pytest \ + -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ + --backend=dace:cpu \ + -m parallel \ + --which_rank=0 \ + --which_modules=DynCore \ + --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ + ./tests/savepoint diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml deleted file mode 100644 index f6b2f2e..0000000 --- a/.github/workflows/translate.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: "Translate test (subset)" -on: - pull_request: - types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] - -jobs: - all: - runs-on: ubuntu-latest - strategy: - matrix: - python: [3.8.12, 3.11.7] - steps: - - name: Checkout repository - uses: actions/checkout@v3.5.2 - with: - submodules: 'recursive' - - name: Setup Python - uses: actions/setup-python@v4.6.0 - with: - python-version: ${{ matrix.python }} - - name: Install OpenMPI & Boost for gt4py - run: | - sudo apt-get install libopenmpi-dev libboost1.74-dev - - name: Install Python packages - run: | - python -m pip install --upgrade pip setuptools wheel - pip install .[ndsl,test] - - name: Prepare test_data - run: | - mkdir -p test_data - - name: Numpy FvTp2d - run: | - cd test_data - wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.FvTp2d.tar.gz - tar -xzvf 8.1.3_c12_6ranks_standard.FvTp2d.tar.gz - cd - - pytest \ - -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ - --backend=numpy \ - --which_modules=FvTp2d \ - --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ - ./tests/savepoint - - name: Numpy D_SW - run: | - cd test_data - wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.D_SW.tar.gz - tar -xzvf 8.1.3_c12_6ranks_standard.D_SW.tar.gz - cd - - pytest \ - -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ - --backend=numpy \ - --which_modules=D_SW \ - --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ - ./tests/savepoint - - name: Numpy Remapping - run: | - cd test_data - wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.Remapping.tar.gz - tar -xzvf 8.1.3_c12_6ranks_standard.Remapping.tar.gz - cd - - pytest \ - -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ - --backend=numpy \ - --which_modules=Remapping \ - --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ - ./tests/savepoint - - name: Orchestrated dace:cpu Acoustics - run: | - cd test_data - wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.DynCore.tar.gz - tar -xzvf 8.1.3_c12_6ranks_standard.DynCore.tar.gz - cd - - export FV3_DACEMODE=BuildAndRun - export PACE_FLOAT_PRECISION=64 - export PACE_TEST_N_THRESHOLD_SAMPLES=0 - export OMP_NUM_THREADS=1 - export PACE_LOGLEVEL=Debug - mpirun -mca orte_abort_on_non_zero_status 1 -np 6 --oversubscribe pytest \ - -v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ - --backend=dace:cpu \ - -m parallel \ - --which_rank=0 \ - --which_modules=DynCore \ - --threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ - ./tests/savepoint diff --git a/setup.py b/setup.py index ecced82..54fbb9e 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ requirements = [ "f90nml>=1.1.0", - "numpy", + "numpy==1.26.4", "xarray", ]