Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run automatic stella tests on old stella releases #174

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 193 additions & 0 deletions .github/workflows/old_stella_releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
# Run these tests automatically on Github on every push and pull request.
# Use the macOS operating system, which has 4 cores.
name: Check old stella releases
on: [push]

# We always run in a bash shell
defaults:
run:
shell: bash

# First build stella, and then perform python tests
jobs:

#-----------------------------------------------------------------------
# Python tests
#-----------------------------------------------------------------------

# Perform python tests one by one
stella-v5:
runs-on: ubuntu-22.04
env:
OMPI_MCA_rmaps_base_oversubscribe: yes
MPIRUN: mpiexec -np
STELLA_SYSTEM: gnu_ubuntu

# Run the same set-up multiple times
strategy:
fail-fast: false
matrix:
config:
- name: "1 - Does stella run "
#- name: "2 - Geometry"
#- name: "3 - Gyrokinetic equation"
#- name: "4 - Flux tube"
#- name: "5 - Diagnostics"
#- name: "6 - Full Flux Surface"
#- name: "7 - Electromagnetic effects"

steps:

# Check-out repository under $GITHUB_WORKSPACE
- name: Check out repository
uses: actions/checkout@v4

# Install dependencies
- name: Install dependencies and python virtual environment
run: |
sudo apt update
sudo apt install -y gfortran make libfftw3-dev libnetcdf-dev libnetcdff-dev
sudo apt install -y netcdf-bin python3 python3-pip openmpi-bin libopenmpi-dev
pip3 install --user -r AUTOMATIC_TESTS/requirements.txt
sed -i 's/nproc = 16/nproc = 4/g' AUTOMATIC_TESTS/config.ini

# Check $GITHUB_WORKSPACE
- name: Check Github Workspace
run: |
echo " "; echo "Running directory:"; echo " $(pwd)"
echo " "; echo "Files in directory:"; echo "$(ls -la | sed 's/^/ /')"
echo " "; echo "Files in directory:"; echo "$(ls AUTOMATIC_TESTS/numerical_tests -la | sed 's/^/ /')"
echo " "; echo "Files in directory:"; echo "$(ls AUTOMATIC_TESTS/numerical_tests/stella_releases -la | sed 's/^/ /')"

# Coppy stella executable from AUTOMATIC_TESTS/numerical_tests/stella_releases
- name: Copy stella executable
run: |
cp AUTOMATIC_TESTS/numerical_tests/stella_releases/stella_v0.7 stella

# Perform python tests
- name: Numerical python tests
run: |
# Make stella executable
chmod +x stella

# Run one of the python tests
if ${{ contains(matrix.config.name, '1 -') }}; then make numerical-tests-1; fi
if ${{ contains(matrix.config.name, '2 -') }}; then make numerical-tests-2; fi
if ${{ contains(matrix.config.name, '3 -') }}; then make numerical-tests-3; fi
if ${{ contains(matrix.config.name, '4 -') }}; then make numerical-tests-4; fi
if ${{ contains(matrix.config.name, '5 -') }}; then make numerical-tests-5; fi
if ${{ contains(matrix.config.name, '6 -') }}; then make numerical-tests-6; fi
if ${{ contains(matrix.config.name, '7 -') }}; then make numerical-tests-7; fi

# Perform python tests one by one
stella-v6:
runs-on: ubuntu-22.04
env:
OMPI_MCA_rmaps_base_oversubscribe: yes
MPIRUN: mpiexec -np
STELLA_SYSTEM: gnu_ubuntu

# Run the same set-up multiple times
strategy:
fail-fast: false
matrix:
config:
- name: "1 - Does stella run "
#- name: "2 - Geometry"
#- name: "3 - Gyrokinetic equation"
#- name: "4 - Flux tube"
#- name: "5 - Diagnostics"
#- name: "6 - Full Flux Surface"
#- name: "7 - Electromagnetic effects"

steps:

# Check-out repository under $GITHUB_WORKSPACE
- name: Check out repository
uses: actions/checkout@v4

# Install dependencies
- name: Install dependencies and python virtual environment
run: |
sudo apt update
sudo apt install -y gfortran make libfftw3-dev libnetcdf-dev libnetcdff-dev
sudo apt install -y netcdf-bin python3 python3-pip openmpi-bin libopenmpi-dev
pip3 install --user -r AUTOMATIC_TESTS/requirements.txt
sed -i 's/nproc = 16/nproc = 4/g' AUTOMATIC_TESTS/config.ini

# Coppy stella executable from AUTOMATIC_TESTS/numerical_tests/stella_releases
- name: Download stella
run: |
cp AUTOMATIC_TESTS/numerical_tests/stella_releases/stella_v0.6 stella

# Perform python tests
- name: Numerical python tests
run: |
# Make stella executable
chmod +x stella

# Run one of the python tests
if ${{ contains(matrix.config.name, '1 -') }}; then make numerical-tests-1; fi
if ${{ contains(matrix.config.name, '2 -') }}; then make numerical-tests-2; fi
if ${{ contains(matrix.config.name, '3 -') }}; then make numerical-tests-3; fi
if ${{ contains(matrix.config.name, '4 -') }}; then make numerical-tests-4; fi
if ${{ contains(matrix.config.name, '5 -') }}; then make numerical-tests-5; fi
if ${{ contains(matrix.config.name, '6 -') }}; then make numerical-tests-6; fi
if ${{ contains(matrix.config.name, '7 -') }}; then make numerical-tests-7; fi


# Perform python tests one by one
stella-v7:
runs-on: ubuntu-22.04
env:
OMPI_MCA_rmaps_base_oversubscribe: yes
MPIRUN: mpiexec -np
STELLA_SYSTEM: gnu_ubuntu

# Run the same set-up multiple times
strategy:
fail-fast: false
matrix:
config:
- name: "1 - Does stella run "
#- name: "2 - Geometry"
#- name: "3 - Gyrokinetic equation"
#- name: "4 - Flux tube"
#- name: "5 - Diagnostics"
#- name: "6 - Full Flux Surface"
#- name: "7 - Electromagnetic effects"

steps:

# Check-out repository under $GITHUB_WORKSPACE
- name: Check out repository
uses: actions/checkout@v4

# Install dependencies
- name: Install dependencies and python virtual environment
run: |
sudo apt update
sudo apt install -y gfortran make libfftw3-dev libnetcdf-dev libnetcdff-dev
sudo apt install -y netcdf-bin python3 python3-pip openmpi-bin libopenmpi-dev
pip3 install --user -r AUTOMATIC_TESTS/requirements.txt
sed -i 's/nproc = 16/nproc = 4/g' AUTOMATIC_TESTS/config.ini

# Coppy stella executable from AUTOMATIC_TESTS/numerical_tests/stella_releases
- name: Download stella
run: |
cp AUTOMATIC_TESTS/numerical_tests/stella_releases/stella_v0.7 stella

# Perform python tests
- name: Numerical python tests
run: |
# Make stella executable
chmod +x stella

# Run one of the python tests
if ${{ contains(matrix.config.name, '1 -') }}; then make numerical-tests-1; fi
if ${{ contains(matrix.config.name, '2 -') }}; then make numerical-tests-2; fi
if ${{ contains(matrix.config.name, '3 -') }}; then make numerical-tests-3; fi
if ${{ contains(matrix.config.name, '4 -') }}; then make numerical-tests-4; fi
if ${{ contains(matrix.config.name, '5 -') }}; then make numerical-tests-5; fi
if ${{ contains(matrix.config.name, '6 -') }}; then make numerical-tests-6; fi
if ${{ contains(matrix.config.name, '7 -') }}; then make numerical-tests-7; fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.swp
*.so
stella
update-input-file
.DS_Store
geo/vmec_interface/test_vmec_to_geometry_interface
post_processing/clean_hist
Expand Down
5 changes: 5 additions & 0 deletions AUTOMATIC_TESTS/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ numerical-tests-7: check-tests-dependencies $(PROJECT_DIR)/stella
numerical-tests-system:
@python3 $(TEST_DIR)/system_information.py

# Test tools
test-tools: check-tests-dependencies $(PROJECT_DIR)/stella
@echo "Running: test stella tools"
@python3 -m pytest -v -rF -W ignore::DeprecationWarning $(TEST_DIR)/test_tools/

# Run the automated stella tests (the -r flag shows the full stella output)
# -rA shows all outputs, -rf shows only failed outputs
numerical-tests-verbose: check-tests-dependencies $(PROJECT_DIR)/stella
Expand Down
28 changes: 0 additions & 28 deletions AUTOMATIC_TESTS/numerical_tests/Makefile

This file was deleted.

24 changes: 24 additions & 0 deletions AUTOMATIC_TESTS/numerical_tests/common_input_files/geometry_CBC.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

! Miller geometry corresponding to the Cyclone Base Case (CBC)
! See [2000 - Dimits - Comparisons and physics basis of tokamak transport models and turbulence simulations]

&geo_knobs
geo_option = 'miller'
/
&millergeo_parameters
nzed_local = 128
rhoc = 0.5
shat = 0.796
qinp = 1.4
rmaj = 2.77778
rgeo = 2.77778
shift = 0.0
kappa = 1.0
kapprim = 0.0
tri = 0.0
triprim = 0.0
betaprim = 0.0
d2qdr2 = 0.0
d2psidr2 = 0.0
betadbprim = 0.0
/
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

&init_g_knobs
ginit_option = 'noise'
phiinit = 0.01
/

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

&species_knobs
nspec = 2
species_option = 'stella'
/
&species_parameters_1
dens = 1.0
fprim = 1.0
mass = 1.0
temp = 1.0
tprim = 3.0
type = 'ion'
z = 1.0
/
&species_parameters_2
dens = 1.0
fprim = 1.0
mass = 0.0005446
temp = 1.0
tprim = 3.0
type = 'electron'
z = -1.0
/
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@


&kt_grids_knobs
grid_option = 'box'
/
&kt_grids_box_parameters
jtwist = 5
nx = 6
ny = 9
y0 = 15
/
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

&zgrid_parameters
boundary_option = 'linked'
nperiod = 1
nzed = 12
/
&vpamu_grids_parameters
nmu = 2
nvgrid = 3
/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

&dissipation
hyper_dissipation = .true.
/
&layouts_knobs
vms_layout = 'vms'
xyzs_layout = 'yxzs'
/
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

&time_advance_knobs
explicit_option = 'rk2'
/
&knobs
delt = 0.01
nstep = 10
fapar = 0.0
fbpar = 0.0
fphi = 1.0
/
&parameters_numerical
delt = 0.01
nstep = 10
print_extra_info_to_terminal = .false.
explicit_option = 'rk2'
/
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

&time_advance_knobs
explicit_option = 'rk2'
/
&knobs
delt = 0.01
nstep = 100
fapar = 0.0
fbpar = 0.0
fphi = 1.0
rng_seed = 1
/
&parameters_numerical
delt = 0.01
nstep = 100
print_extra_info_to_terminal = .false.
explicit_option = 'rk2'
rng_seed = 1
/
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

! Write all diagnostics

&stella_diagnostics_knobs
nsave = 10
nwrite = 1
save_for_restart = .false.
write_phi_vs_time = .true.
write_gvmus = .true.
write_gzvs = .true.
write_omega = .true.
write_kspectra = .true.
write_moments = .true.
write_radial_fluxes = .true.
write_radial_moments = .true.
write_fluxes_kxkyz = .true.
flux_norm = .true.
/
&diagnostics
nsave = 10
nwrite = 1
save_for_restart = .false.
flux_norm = .true.
write_all = .true.
/
Loading
Loading