Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 1abe268
Merge: 6990c76 977ae30
Author: HanneThienpondt <[email protected]>
Date:   Thu Feb 27 10:44:53 2025 +0100

    Merge branch 'master' of ssh://github.com/stellaGK/stella

commit 6990c76
Author: HanneThienpondt <[email protected]>
Date:   Thu Feb 27 10:44:40 2025 +0100

    Ignore pyrokinetics version file.

commit 977ae30
Author: HanneThienpondt <[email protected]>
Date:   Thu Feb 27 10:42:32 2025 +0100

    Auto-check whether pyrokinetics can load a stella output. (#197)

    * Automatically tests if stella is compatible with the pyrokinetics module.

commit 69f5343
Author: HanneThienpondt <[email protected]>
Date:   Wed Feb 26 17:58:17 2025 +0100

    Move utils folder into STELLA_CODE folder. (#193)

commit ea4e3e5
Author: HanneThienpondt <[email protected]>
Date:   Tue Feb 25 15:46:14 2025 +0100

    Add plotting scripts for potential(x,y) and B(X,Y,Z) to stellapy. (#192)

    * Add plotting scripts for potential(x,y) and B(X,Y,Z)

commit b78d868
Author: valentin-seitz <[email protected]>
Date:   Tue Feb 25 10:47:59 2025 +0100

    Adding include guards for response matrix  (#190)

    Prevent definition of the subroutine, which uses an undefined symbol from the mp module in case ISO_C_BINDING is not available.

commit 7f9b2a5
Author: HanneThienpondt <[email protected]>
Date:   Tue Feb 25 10:47:06 2025 +0100

    Write apar(kx,ky,z) and bpar(kx,ky,z)  (#191)

    * Write apar(kx,ky,z,t) and bpar(kx,ky,z,t) to the netcdf file.
    * Include write_apar2_vs_kxky and write_bpar2_vs_kxky
    * Print bpar to the output files.

commit 7131981
Author: HanneThienpondt <[email protected]>
Date:   Wed Feb 19 14:58:46 2025 +0100

    Add compilation files for Xula and Marenostrum (#188)

    * Add compilation files for Xula
    * Add compilation files for Marenostrum
    * Add load modules file for Marconi
    * Add load modules files for Dirac and Stellar
    * Add a ReadMe to help compile stella on an HPC system.
    * Clean-up indents and add LAPACK_LIB and LAPACK_INC
    * And a makefile for the GCC (GNU gfortran) compile

commit 159d687
Author: HanneThienpondt <[email protected]>
Date:   Thu Feb 13 13:17:44 2025 +0100

    Change the -J flag to $(MODULE_FLAG)

commit 19fb404
Author: HanneThienpondt <[email protected]>
Date:   Thu Feb 13 11:31:55 2025 +0100

    183 Ensure that <nzed> is always an even integer. (#187)

    * Clean up zgrid module.
    * Make sure <nzed> is an even integer.

commit 6fbdda4
Author: HanneThienpondt <[email protected]>
Date:   Thu Feb 13 10:52:25 2025 +0100

    Clean up compilation, and add makefile for Stellar (#186)

    * Clean up compilation of stella.
         - Split the Makefile into smaller parts
         - Added a flag "MODULE_FLAG" which can be set from the system dependent makefile, since some systems need "MODULE_FLAG = -J" while other systems need "MODULE_FLAG = -module"

    * Add makefile for stellar.

commit 3942f40
Author: HanneThienpondt <[email protected]>
Date:   Thu Feb 13 10:18:58 2025 +0100

    Since january 2025 the macos system on GitHub can not find the hdf5 libraries anymore during the compilation of stella. (#185)

    * Fix stella compilation on MacOs on GitHub.
  • Loading branch information
HanneThienpondt committed Feb 27, 2025
1 parent ba6299e commit 7803eee
Show file tree
Hide file tree
Showing 66 changed files with 5,023 additions and 153 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/check_pyrokinetics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Run these tests automatically on Github on every push and pull request.
name: Check Pyrokinetics
on: [push, pull_request]

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

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

#-----------------------------------------------------------------------
# Quick build
#-----------------------------------------------------------------------

# Build stella to perform pyrokinetics tests
pyrokinetics-tests:
name: Check Pyrokinetics
runs-on: ubuntu-22.04
env:
OMPI_MCA_rmaps_base_oversubscribe: yes
MPIRUN: mpiexec -np
STELLA_SYSTEM: gnu_ubuntu

steps:

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

# Install dependencies
- name: Install dependencies
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
# Build stella executable
- name: Build stella
run: |
git submodule update --init --recursive
make -j 12
chmod +x stella
# 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 --upgrade pip
pip3 install --user -r AUTOMATIC_TESTS/requirements.txt
pip3 install EXTERNALS/pyrokinetics/.
sed -i 's/nproc = 16/nproc = 1/g' AUTOMATIC_TESTS/config.ini
# Perform pyrokinetics tests
- name: Pyrokinetics tests
run: make pyrokinetics-tests



69 changes: 42 additions & 27 deletions .github/workflows/check_stella.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ jobs:
MPIRUN: mpiexec -np

# Run the same set-up multiple times
# Note that macos-12 has been deprecated on GitHub in 2025
strategy:
fail-fast: false
matrix:
os: [macos-12, macos-13, macos-14, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
os: [macos-13, macos-14, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
compiler: [Make, CMake]

# Operating system
Expand All @@ -45,21 +46,21 @@ jobs:
echo "FFTW_LIB_DIR=/usr/local/Cellar/fftw/3.3.10_1/lib/" >> $GITHUB_ENV
echo "Set FFTW_INC_DIR = /usr/local/include/"
echo "FFTW_INC_DIR=/usr/local/include/" >> $GITHUB_ENV
echo "Set NETCDF_LIB_DIR = /usr/local/lib -L/usr/local/Cellar/netcdf-fortran/4.6.1/lib/"
echo "NETCDF_LIB_DIR=/usr/local/lib -L/usr/local/Cellar/netcdf-fortran/4.6.1/lib/" >> $GITHUB_ENV
echo "Set NETCDF_INC_DIR = /usr/local/Cellar/netcdf-fortran/4.6.1/include/"
echo "NETCDF_INC_DIR=/usr/local/Cellar/netcdf-fortran/4.6.1/include/" >> $GITHUB_ENV
echo "Set NETCDF_LIB_DIR = /usr/local/lib -L/usr/local/Cellar/netcdf-fortran/4.6.1_1/lib/"
echo "NETCDF_LIB_DIR=/usr/local/lib -L/usr/local/Cellar/netcdf-fortran/4.6.1_1/lib/" >> $GITHUB_ENV
echo "Set NETCDF_INC_DIR = /usr/local/Cellar/netcdf-fortran/4.6.1_1/include/"
echo "NETCDF_INC_DIR=/usr/local/Cellar/netcdf-fortran/4.6.1_1/include/" >> $GITHUB_ENV
elif [ ${{ matrix.os }} == 'macos-14' ]; then
echo "Set STELLA_SYSTEM = macos"
echo "STELLA_SYSTEM=macos" >> $GITHUB_ENV
echo "Set FFTW_LIB_DIR = /opt/homebrew/Cellar/fftw/3.3.10_1/lib/"
echo "FFTW_LIB_DIR=/opt/homebrew/Cellar/fftw/3.3.10_1/lib/" >> $GITHUB_ENV
echo "Set FFTW_INC_DIR = /opt/homebrew/include/"
echo "FFTW_INC_DIR=/opt/homebrew/include/" >> $GITHUB_ENV
echo "Set NETCDF_LIB_DIR = /opt/homebrew/lib -L/opt/homebrew/Cellar/netcdf-fortran/4.6.1/lib/"
echo "NETCDF_LIB_DIR=/opt/homebrew/lib -L/opt/homebrew/Cellar/netcdf-fortran/4.6.1/lib/" >> $GITHUB_ENV
echo "Set NETCDF_INC_DIR = /opt/homebrew/Cellar/netcdf-fortran/4.6.1/include/"
echo "NETCDF_INC_DIR=/opt/homebrew/Cellar/netcdf-fortran/4.6.1/include/" >> $GITHUB_ENV
echo "Set NETCDF_LIB_DIR = /opt/homebrew/lib -L/opt/homebrew/Cellar/netcdf-fortran/4.6.1_1/lib/"
echo "NETCDF_LIB_DIR=/opt/homebrew/lib -L/opt/homebrew/Cellar/netcdf-fortran/4.6.1_1/lib/" >> $GITHUB_ENV
echo "Set NETCDF_INC_DIR = /opt/homebrew/Cellar/netcdf-fortran/4.6.1_1/include/"
echo "NETCDF_INC_DIR=/opt/homebrew/Cellar/netcdf-fortran/4.6.1_1/include/" >> $GITHUB_ENV
elif ${{ contains(matrix.os, 'ubuntu') }}; then
echo "Set STELLA_SYSTEM = gnu_ubuntu"
echo "STELLA_SYSTEM=gnu_ubuntu" >> $GITHUB_ENV
Expand Down Expand Up @@ -87,6 +88,22 @@ jobs:
# Check-out repository under $GITHUB_WORKSPACE
- name: Check-out repository
uses: actions/checkout@v4

# Print system information
- name: System information
run: |
if ${{ contains(matrix.os, 'macos') }}; then
echo " "; echo "System information:"; echo "$(system_profiler SPHardwareDataType | sed 's/^/ /')"
echo " "; echo "Gfortran version:"; echo "$(gfortran --version | sed 's/^/ /')"
echo " "; echo "Clang version:"; echo "$(clang --version | sed 's/^/ /')"
make numerical-tests-system
elif ${{ contains(matrix.os, 'ubuntu') }}; then
echo " "; echo "System information:"; echo "$(cat /etc/*release | sed 's/^/ /')"
echo " "; echo "Number of cores:"; echo "$(lscpu | egrep 'Model name|Socket|Thread|NUMA|CPU\(s\)' | sed 's/^/ /')"
echo " "; echo "Gfortran version:"; echo "$(gfortran --version | sed 's/^/ /')"
echo " "; echo "Netcdf version:"; echo "$(nf-config --all | sed 's/^/ /')"
make numerical-tests-system
fi
# Build stella executable
- name: Build stella
Expand Down Expand Up @@ -114,31 +131,29 @@ jobs:
cmake . -B COMPILATION/build_cmake
cmake --build COMPILATION/build_cmake -j 4
fi
# Print system information
- name: System information
run: |
if ${{ contains(matrix.os, 'macos') }}; then
echo " "; echo "System information:"; echo "$(system_profiler SPHardwareDataType | sed 's/^/ /')"
echo " "; echo "Gfortran version:"; echo "$(gfortran --version | sed 's/^/ /')"
echo " "; echo "Clang version:"; echo "$(clang --version | sed 's/^/ /')"
make numerical-tests-system
elif ${{ contains(matrix.os, 'ubuntu') }}; then
echo " "; echo "System information:"; echo "$(cat /etc/*release | sed 's/^/ /')"
echo " "; echo "Number of cores:"; echo "$(lscpu | egrep 'Model name|Socket|Thread|NUMA|CPU\(s\)' | sed 's/^/ /')"
echo " "; echo "Gfortran version:"; echo "$(gfortran --version | sed 's/^/ /')"
echo " "; echo "Netcdf version:"; echo "$(nf-config --all | sed 's/^/ /')"
make numerical-tests-system
fi
# Check $GITHUB_WORKSPACE
- name: Check Github Workspace
if: success() || failure()
run: |
echo " "; echo "Running directory:"; echo " $(pwd)"
echo " "; echo "Files in directory:"; echo "$(ls -la | sed 's/^/ /')"
# Location of packages
- name: Location of packages
if: success() || failure()
run: |
if [ ${{ matrix.compiler }} == 'CMake' ]; then
echo " "; echo "--------- DIRECTORIES OF PACKAGES ----------"
cat COMPILATION/build_cmake/CMakeCache.txt
fi
if [ ${{ matrix.compiler }} == 'Make' ]; then
echo " "; echo "Check the CMake compilation for the location of the packages."
fi
# Install python environment
- name: Install python virtual environment
if: success() || failure()
run: |
if [ ${{ matrix.os }} == 'ubuntu-24.04' ] || [ ${{ matrix.os }} == 'macos-14' ]; then
python3 -m venv AUTOMATIC_TESTS/venv
Expand Down Expand Up @@ -187,7 +202,7 @@ jobs:
if [ ${{ matrix.os }} == 'ubuntu-24.04' ] || [ ${{ matrix.os }} == 'macos-14' ]; then source AUTOMATIC_TESTS/venv/bin/activate; fi
make numerical-tests-6
- name: Python tests 7 - Electromagnetic effects"
- name: Python tests 7 - Electromagnetic effects
if: success() || failure()
run: |
if [ ${{ matrix.os }} == 'ubuntu-24.04' ] || [ ${{ matrix.os }} == 'macos-14' ]; then source AUTOMATIC_TESTS/venv/bin/activate; fi
Expand Down Expand Up @@ -225,7 +240,7 @@ jobs:
git submodule update --init --recursive
make -j 12
# Stella is bugged when compiling without the falg debug = on
# Stella is bugged when compiling without the flag debug = on
# So the python tests will break when compiling with CMake
#cmake . -B COMPILATION/build_cmake
#cmake --build COMPILATION/build_cmake -j 4
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ system_fortran.f90

# Stellapy
!stellapy/data/stella
*.pickle
stellapy_figures/

# Fortran tests
automated-fortran-tests
Expand Down Expand Up @@ -76,6 +78,9 @@ share/python-wheels/
*.egg
MANIFEST

# External modules
EXTERNALS/pyrokinetics/src/pyrokinetics/_version.py

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "externals/neasyf"]
path = EXTERNALS/neasyf
url = https://github.com/PlasmaFAIR/neasy-f.git
[submodule "EXTERNALS/pyrokinetics"]
path = EXTERNALS/pyrokinetics
url = https://github.com/pyro-kinetics/pyrokinetics
5 changes: 5 additions & 0 deletions AUTOMATIC_TESTS/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ numerical-tests-system:
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 and -rf shows extra info about the failed outputs)
pyrokinetics-tests: check-tests-dependencies $(PROJECT_DIR)/stella
@echo "Running: automated stella tests for pyrokinetics"
@python3 -m pytest -v -rF -W ignore::DeprecationWarning $(TEST_DIR)/pyrokinetics_tests/

# Run the automated stella tests (the -r flag shows the full stella output)
# -rA shows all outputs, -rf shows only failed outputs
Expand Down
4 changes: 4 additions & 0 deletions AUTOMATIC_TESTS/check_automated_stella_tests_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
for line in contents:
if line.startswith("#"):
continue
if line.replace(' ','').replace('\n','').replace('\t','')=='':
continue
module = line.split("=")[0]
if 'pyrokinetics' in line: module = 'pyrokinetics'
requirements.append(module.replace(">", "").replace("~", "").replace("\n", ""))

failed_modules = []
Expand All @@ -33,6 +36,7 @@
Run:
make create-test-virtualenv
source AUTOMATIC_TESTS/venv/bin/activate
pip install EXTERNALS/pyrokinetics/.
to install and activate test dependencies
"""
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

! Smallest possible input file that runs without errors
! and that runs fast, hence we set (nkx,nky,nzed,nmu,nvpa)

&parameters_numerical
nstep=10
/
&stella_diagnostics_knobs
nwrite = 1
/
&species_parameters_1
/
&kt_grids_knobs
grid_option='range'
/
&kt_grids_range_parameters
naky = 10
aky_min = 0.1
aky_max = 1.0
nakx = 1
akx_min = 0.0
akx_max = 0.0
/
&zgrid_parameters
nzed = 8
/
&vpamu_grids_parameters
nmu = 4
nvgrid = 6
/
&millergeo_parameters
rhoc = 0.5
shat = 0.796
qinp = 1.4
rmaj = 2.77778
rgeo = 2.77778
kappa = 1.0
/
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@

! Simple linear example using CBC

&parameters_physics
adiabatic_option = 'iphi00=2'
full_flux_surface = .false.
include_apar = .false.
nonlinear = .false.
vnew_ref = 0.01
/
&parameters_numerical
delt = 0.05
nstep = 10
print_extra_info_to_terminal = .false.
/
&stella_diagnostics_knobs
nsave = 10
nwrite = 1
save_for_restart = .false.
write_all = .true.
/
&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
/
&kt_grids_knobs
grid_option='range'
/
&kt_grids_range_parameters
naky = 10
aky_min = 0.1
aky_max = 1.0
nakx = 1
akx_min = 0.0
akx_max = 0.0
/
&zgrid_parameters
boundary_option = 'zero'
nperiod = 1
nzed = 8
/
&vpamu_grids_parameters
nmu = 4
nvgrid = 6
/
&init_g_knobs
ginit_option = 'noise'
phiinit = 0.01
/
&dissipation
hyper_dissipation = .true.
/
&geo_knobs
geo_option = 'miller'
/
&time_advance_knobs
explicit_option = 'rk2'
/
&layouts_knobs
vms_layout = 'vms'
xyzs_layout = 'yxzs'
/
&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
/
Loading

0 comments on commit 7803eee

Please sign in to comment.