Use domain_decomp
to generate partition files (#913)
#1203
This file contains hidden or 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: compile code and tests | |
on: | |
# if you wish to skip running CI please don't change this section, instead | |
# prefix the following notation in the title of your commit message e.g., | |
# | |
# [skip ci] my commit message | |
# | |
# For more information, please read the GitHub | |
# [documentation](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/skipping-workflow-runs) | |
# | |
# Note: You will not be able to merge into develop or main without running CI. To run CI either: | |
# - edit the last commit message using `git commit --amend` and remove the tag "[skip ci]" or, | |
# - create a new commit without a "[skip ci]" tag | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
paths: | |
- '.github/workflows/test_suite.yml' | |
- 'core/*.sh' | |
- 'dynamics/*.sh' | |
- 'run/*.sh' | |
- 'test/*.sh' | |
- '**.cdl' | |
- '**.cfg' | |
- '**.cpp' | |
- '**.hpp' | |
- '**.py' | |
- '**.xml' | |
- '**CMakeLists.txt' | |
pull_request_review: | |
branches: [ main, develop ] | |
jobs: | |
test-ubuntu-serial: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
container: | |
image: ghcr.io/nextsimhub/nextsimdg-dev-env:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: build and compile without XIOS or MPI | |
run: | | |
. /opt/spack-environment/activate.sh | |
mkdir -p build && cd build | |
cmake -DCMAKE_BUILD_TYPE=Release .. | |
make -j 4 | |
- name: installs for python tests | |
run: | | |
apt -y update | |
apt install -y python3-venv | |
python3 -m venv ~/nextsim | |
. $HOME/nextsim/bin/activate | |
pip install numpy | |
pip install netCDF4 | |
- name: run serial tests | |
run: | | |
. /opt/spack-environment/activate.sh | |
. $HOME/nextsim/bin/activate | |
apt update | |
apt install -y wget | |
cd build | |
(cd core/test && wget "ftp://ftp.nersc.no/nextsim/netCDF/partition_metadata_1.nc") | |
ctest -V | |
mv ../test . | |
cd test | |
python3 ThermoIntegration_test.py | |
./run_test_jan2010_integration.sh python3 | |
./run_test_advection.sh python3 | |
./run_test_error_handling_test.sh python3 | |
cd - | |
test-ubuntu-mpi-noxios: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
container: | |
image: ghcr.io/nextsimhub/nextsimdg-dev-env:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: build domain_decomp | |
run: | | |
. /opt/spack-environment/activate.sh | |
git config --global --add safe.directory /__w/nextsimdg/nextsimdg | |
git submodule init | |
git submodule update | |
cd domain_decomp | |
cmake -G "Unix Makefiles" -Bbuild -S. | |
cmake --build build --config Release | |
- name: build and compile with MPI but not XIOS | |
run: | | |
# set environment variables for MPI tests to run in docker container | |
export OMPI_ALLOW_RUN_AS_ROOT=1 | |
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | |
export OMPI_MCA_rmaps_base_oversubscribe=1 | |
. /opt/spack-environment/activate.sh | |
# provide path to domain_decomp binary | |
export PATH="${PATH}:${PWD}/domain_decomp/build" | |
mkdir -p build && cd build | |
cmake -DENABLE_MPI=ON -DENABLE_XIOS=OFF -DCMAKE_CXX_COMPILER="$(which mpic++)" .. | |
make -j 4 | |
- name: run MPI tests | |
run: | | |
# set environment variables for MPI tests to run in docker container | |
export OMPI_ALLOW_RUN_AS_ROOT=1 | |
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | |
export OMPI_MCA_rmaps_base_oversubscribe=1 | |
. /opt/spack-environment/activate.sh | |
apt update | |
apt install -y wget | |
cd build | |
(cd core/test && wget "ftp://ftp.nersc.no/nextsim/netCDF/partition_metadata_1.nc") | |
ctest -V | |
test-ubuntu-mpi-xios: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
container: | |
image: ghcr.io/nextsimhub/nextsimdg-dev-env:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: build domain_decomp | |
run: | | |
. /opt/spack-environment/activate.sh | |
git config --global --add safe.directory /__w/nextsimdg/nextsimdg | |
git submodule init | |
git submodule update | |
cd domain_decomp | |
cmake -G "Unix Makefiles" -Bbuild -S. | |
cmake --build build --config Release | |
- name: build and compile with XIOS and MPI | |
run: | | |
# set environment variables for MPI tests to run in docker container | |
export OMPI_ALLOW_RUN_AS_ROOT=1 | |
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | |
export OMPI_MCA_rmaps_base_oversubscribe=1 | |
. /opt/spack-environment/activate.sh | |
# provide path to domain_decomp binary | |
export PATH="${PATH}:${PWD}/domain_decomp/build" | |
mkdir -p build && cd build | |
cmake -DENABLE_MPI=ON -Dxios_DIR="/xios" -DENABLE_XIOS=ON -DCMAKE_CXX_COMPILER="$(which mpic++)" .. | |
make -j 4 | |
- name: run MPI tests | |
run: | | |
# set environment variables for MPI tests to run in docker container | |
export OMPI_ALLOW_RUN_AS_ROOT=1 | |
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | |
export OMPI_MCA_rmaps_base_oversubscribe=1 | |
. /opt/spack-environment/activate.sh | |
apt update | |
apt install -y wget | |
cd build | |
(cd core/test && wget "ftp://ftp.nersc.no/nextsim/netCDF/partition_metadata_1.nc") | |
ctest -V | |
test-mac-serial: | |
runs-on: macos-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: installs | |
run: | | |
brew install boost | |
brew unlink pkg-config | |
brew install pkgconf | |
brew link --overwrite pkgconf | |
brew install eigen | |
brew install netcdf | |
brew install netcdf-cxx | |
pip install netCDF4 | |
pip install numpy | |
# tmate can be used to get an interactive ssh session to the github runner | |
# for debugging actions. See | |
# [here](https://github.com/mxschmitt/action-tmate) for more information. | |
# uncomment these lines to debug mac build | |
# - name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
- name: make | |
run: | | |
mkdir -p build | |
cd build | |
# added Python_ROOT_DIR to help cmake find correct Python in the mac VM | |
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_MPI=OFF -DENABLE_XIOS=OFF -DPython_ROOT_DIR=/Library/Frameworks/Python.framework/Versions/Current/bin .. | |
make -j 4 | |
- name: run serial tests | |
run: | | |
cd build | |
ctest -V | |
mv ../test . | |
cd test | |
python ThermoIntegration_test.py | |
./run_test_jan2010_integration.sh python | |
./run_test_advection.sh python | |
./run_test_error_handling_test.sh python | |
cd - |