Skip to content

AllanZyne CI for sharpy #107

AllanZyne CI for sharpy

AllanZyne CI for sharpy #107

Workflow file for this run

name: Sharpy CI
run-name: ${{ github.actor }} CI for sharpy
permissions: read-all
on:
push:
branches:
- main
pull_request:
defaults:
run:
shell: bash -l {0}
env:
IMEX_CACHE_NUMBER: 4 # Increase to reset cache
jobs:
build_and_test:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
steps:
- name: Check repo
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup env
run: |
INSTALLED_DIR="$(realpath $GITHUB_WORKSPACE)/third_party/install"
echo "INSTALLED_DIR=$INSTALLED_DIR" >> "$GITHUB_ENV"
echo 'IMEX_SHA<<EOF' >> $GITHUB_ENV
cat imex_version.txt >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Restore IMEX cache
id: cache-imex
uses: actions/cache/restore@v3
with:
path: third_party/install/**
key: ${{ runner.os }}-build-imex-${{ env.IMEX_CACHE_NUMBER }}-${{ env.IMEX_SHA }}
- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
# environment-file: etc/example-environment.yml
- name: Build SHARPY
run: |
env
conda install -y conda-build
cd conda-recipe
conda build --numpy 1.26 --no-anaconda-upload --no-test .
- name: Save IMEX cache
uses: actions/cache/save@v3
if: steps.cache-imex.outputs.cache-hit != 'true'
with:
path: third_party/install/**
key: ${{ runner.os }}-build-imex-${{ env.IMEX_CACHE_NUMBER }}-${{ env.IMEX_SHA }}
- name: Install SHARPY
run: |
conda create --use-local -c file://${CONDA_PREFIX}/conda-bld/ -n sharpy -v sharpy pytest pytest-timeout
conda activate sharpy
- name: Test SHARPY (pytest)
run: |
conda activate sharpy
cd test
pytest . -v -s --timeout=30
SHARPY_FORCE_DIST=1 pytest . -v -s --timeout=30
mpirun -n 2 pytest . -v -s --timeout=30
mpirun -n 3 pytest . -v -s --timeout=30
mpirun -n 4 pytest . -v -s --timeout=30
cd -
- name: Run examples
run: |
conda activate sharpy
cd examples
SHARPY_FALLBACK=numpy python -u ./stencil-2d.py 5 1024 star 4
SHARPY_FALLBACK=numpy SHARPY_FORCE_DIST=1 python -u ./stencil-2d.py 5 1024 star 4
mpirun -n 2 -genv SHARPY_FALLBACK=numpy python -u ./stencil-2d.py 5 2048 star 2
mpirun -n 3 -genv SHARPY_FALLBACK=numpy python -u ./stencil-2d.py 5 2048 star 2
mpirun -n 4 -genv SHARPY_FALLBACK=numpy python -u ./stencil-2d.py 5 2048 star 2
python -u ./wave_equation.py -b numpy
python -u ./wave_equation.py -d f32
python -u ./wave_equation.py -d f64
SHARPY_FORCE_DIST=1 python -u ./wave_equation.py
mpirun -n 2 python -u ./wave_equation.py
mpirun -n 3 python -u ./wave_equation.py
mpirun -n 4 python -u ./wave_equation.py
python -u ./shallow_water.py -b numpy
python -u ./shallow_water.py -d f32
python -u ./shallow_water.py -d f64
mpirun -n 2 python -u ./shallow_water.py
mpirun -n 3 python -u ./shallow_water.py
mpirun -n 4 python -u ./shallow_water.py
python -u ./black_scholes.py -b numpy
python -u ./black_scholes.py -d f32
python -u ./black_scholes.py -d f64
SHARPY_FORCE_DIST=1 python -u ./black_scholes.py
mpirun -n 2 python -u ./black_scholes.py
mpirun -n 3 python -u ./black_scholes.py
mpirun -n 4 python -u ./black_scholes.py
cd -