Skip to content

The pFUnit submodule has been updated to be compatible with python 3.… #1440

The pFUnit submodule has been updated to be compatible with python 3.…

The pFUnit submodule has been updated to be compatible with python 3.… #1440

Workflow file for this run

# Run these tests automatically on Github
# on every push.
name: StellaTests
on: [push]
# We run the in a bash shell
defaults:
run:
shell: bash
# Define the tests, for now we only have <standard_tests>
# where we define 3 seperate workflows in matrix/config/name
# For each of these workflows we need to perform the same
# initial steps: <Install dependencies>, <System information>
# Next, only the step corresponding to the test will be executed.
jobs:
# Build stella with Make in debug mode, here the python tests do not work!
# Specifically, the flush statement in mini_libstell's
# read_wout_mod.F module in the readw_and_open() routine breaks
# when reading a VMEC equilibirium during the python tests.
test1:
runs-on: ubuntu-latest
env:
OMPI_MCA_rmaps_base_oversubscribe: yes
MPIRUN: mpiexec -np
strategy:
fail-fast: false
matrix:
config:
- name: "Make stella in debug mode"
steps:
- name: Install dependencies
run: sudo apt update &&
sudo apt install -y
gfortran
make
libfftw3-dev
libnetcdf-dev
libnetcdff-dev
netcdf-bin
python3
python3-pip
openmpi-bin
libopenmpi-dev
- name: System information
run: |
cat /etc/*release
gfortran --version
nf-config --all
- uses: actions/checkout@v2
- name: Build stella in debug mode
run: |
set -ex
export GK_SYSTEM=gnu_ubuntu_debug
make -I Makefiles -j4
# Build stella with Make and run automatic fortran tests
test2:
runs-on: ubuntu-latest
env:
OMPI_MCA_rmaps_base_oversubscribe: yes
MPIRUN: mpiexec -np
strategy:
fail-fast: false
matrix:
config:
- name: "Perform fortran tests of the stella code"
steps:
- name: Install dependencies
run: sudo apt update &&
sudo apt install -y
gfortran
make
libfftw3-dev
libnetcdf-dev
libnetcdff-dev
netcdf-bin
python3
python3-pip
openmpi-bin
libopenmpi-dev
- name: System information
run: |
cat /etc/*release
gfortran --version
nf-config --all
- uses: actions/checkout@v2
- name: Build stella
run: |
set -ex
export GK_SYSTEM=gnu_ubuntu
make -I Makefiles -j4
- name: Perform automated Fortran tests
run: |
set -ex
export GK_SYSTEM=gnu_ubuntu
make -I Makefiles -j4 build-pfunit-library
make -I Makefiles -j4 run-automated-fortran-tests
# Build stella with CMake and run automatic Fortran tests
# Cmake has to run on 1 node or it will run into parallelisation errors
test3:
runs-on: ubuntu-latest
env:
OMPI_MCA_rmaps_base_oversubscribe: yes
MPIRUN: mpiexec -np
strategy:
fail-fast: false
matrix:
config:
- name: "CMake stella"
steps:
- name: Install dependencies
run: sudo apt update &&
sudo apt install -y
gfortran
make
libfftw3-dev
libnetcdf-dev
libnetcdff-dev
netcdf-bin
python3
python3-pip
openmpi-bin
libopenmpi-dev
- name: System information
run: |
cat /etc/*release
gfortran --version
nf-config --all
- uses: actions/checkout@v2
- name: Build stella (CMake)
run: |
set -ex
cmake . -B build -DSTELLA_ENABLE_TESTS=on
cmake --build build -j1 --target check
# Build stella with Make and run automatic python tests
test4:
runs-on: ubuntu-latest
env:
OMPI_MCA_rmaps_base_oversubscribe: yes
MPIRUN: mpiexec -np
strategy:
fail-fast: false
matrix:
config:
- name: "Run stella and check the outputs numerically"
steps:
- name: Install dependencies
run: sudo apt update &&
sudo apt install -y
gfortran
make
libfftw3-dev
libnetcdf-dev
libnetcdff-dev
netcdf-bin
python3
python3-pip
openmpi-bin
libopenmpi-dev
- name: System information
run: |
cat /etc/*release
gfortran --version
nf-config --all
- uses: actions/checkout@v2
- name: Install automated stella test dependencies
run: pip3 install --user -r tests/requirements.txt
- name: Build stella
run: |
set -ex
export GK_SYSTEM=gnu_ubuntu
make -I Makefiles -j4
- name: Perform numerical tests for stella with Python
run: |
set -ex
export GK_SYSTEM=gnu_ubuntu
make -I Makefiles run-automated-numerical-tests-for-stella
# Build stella with Make and run automatic python tests
test5:
runs-on: macos-latest
env:
OMPI_MCA_rmaps_base_oversubscribe: yes
MPIRUN: mpiexec -np
GK_SYSTEM: macosx
FFTW_LIB_DIR: /opt/homebrew/lib/
FFTW_INC_DIR: /opt/homebrew/include/
NETCDF_LIB_DIR: /opt/homebrew/lib/
NETCDF_INC_DIR: /opt/homebrew/include/
strategy:
fail-fast: false
matrix:
config:
- name: "Run stella and check the outputs numerically"
steps:
- name: Install Homebrew
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: Install dependencies
run: |
brew update
brew install gcc fftw netcdf netcdf-fortran open-mpi python
ln -sn /opt/homebrew/bin/gfortran-12 /opt/homebrew/bin/gfortran
- uses: actions/checkout@v2
- name: Build stella
run: |
set -ex
make -I Makefiles -j4
- name: Perform numerical tests for stella with Python
run: |
set -ex
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install netCDF4 numpy pytest importlib_metadata xarray setuptools
make -I Makefiles run-automated-numerical-tests-for-stella