update to new pygetm APIs #140
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
jobs: | |
install_and_run: | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
runs-on: ${{ matrix.os }} | |
env: | |
RDMAV_FORK_SAFE: 1 | |
CMAKE_BUILD_PARALLEL_LEVEL: 2 | |
defaults: | |
run: | |
shell: bash -el {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest", "macos-13", "macos-latest", "windows-latest"] | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Clone fabmos | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
environment-file: environment.yml | |
activate-environment: fabmos | |
- name: List installed conda packages | |
run: conda export | |
- name: Customize Windows build | |
if: matrix.os == 'windows-latest' | |
run: | | |
echo '[build_ext]' > setup.cfg | |
echo 'cmake_opts=-G "MSYS Makefiles"' >> setup.cfg | |
mv extern/fabm/extern/ersem extern/fabm/extern/ersem_bck | |
mv extern/fabm/extern/ogs extern/fabm/extern/ogs_bck | |
- name: Compile and install fabmos | |
run: pip install -v . | |
- name: Download TMM setup | |
run: curl -s http://kelvin.earth.ox.ac.uk/spk/Research/TMM/TransportMatrixConfigs/MITgcm_2.8deg.tar -o MITgcm_2.8deg.tar | |
- name: Extract TMM setup | |
run: tar -xvf MITgcm_2.8deg.tar --exclude "MITgcm_2.8deg/GCM/basepath.mat" --exclude "MITgcm_2.8deg/BiogeochemData/basepath.mat" | |
- name: Run TMM setup in serial | |
run: | | |
cd MITgcm_2.8deg | |
python ../examples/tmm/tracer.py --stop_time="2000-02-01 00:00:00" | |
env: | |
I_MPI_FABRICS: shm #:ofi | |
FI_PROVIDER: sockets #tcp | |
- name: Run TMM setup in parallel | |
run: | | |
cd MITgcm_2.8deg | |
mpiexec -n 2 python ../examples/tmm/tracer.py --stop_time="2000-02-01 00:00:00" | |
env: | |
I_MPI_FABRICS: shm #:ofi | |
FI_PROVIDER: sockets #tcp | |
- name: Test reproducibility for different subdomain decompositions | |
run: | | |
cd MITgcm_2.8deg | |
pygetm-test-scaling --nmax 2 --compare output.nc ../examples/tmm/tracer.py --stop_time="2000-02-01 00:00:00" | |
env: | |
I_MPI_FABRICS: shm #:ofi | |
FI_PROVIDER: sockets #tcp |