Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
14af2aa
fieldadapter
krystophny Jul 6, 2025
86c957a
Implement Phase 3: Abstract field interface for canonical/Boozer coor…
krystophny Jul 6, 2025
7bd4c28
Complete Phase 4: GVEC Support Implementation for canonical coordinates
krystophny Jul 7, 2025
c6e9de8
Add comprehensive VMEC-GVEC adapter comparison test
krystophny Jul 7, 2025
204d3ad
Remove redundant test_field_abstraction.f90
krystophny Jul 7, 2025
564a028
Update test targets and make verbose output default
krystophny Jul 7, 2025
b734226
Refactor vmec_field_adapter module: streamline comments and improve c…
krystophny Jul 7, 2025
4ba18bc
Fix syntax errors in vmec_field_adapter.f90
krystophny Jul 7, 2025
aab1e6b
Lower order splines for testing
krystophny Jul 7, 2025
0e613b4
Update test properties and clean up test_simple_vmec_gvec.f90 configu…
krystophny Jul 7, 2025
9193dee
Update VMEC test configurations and remove field data exports and Pyt…
krystophny Jul 7, 2025
7acd6c7
Remove outdated plotting scripts and update Fortran test program
krystophny Jul 7, 2025
542b329
Refactor test commands in Makefile for clarity and consistency; updat…
krystophny Jul 7, 2025
da0d943
Add pre-commit hooks and comprehensive CI/CD testing
krystophny Jul 7, 2025
6369f48
Update pre-commit hooks with additional checks
krystophny Jul 7, 2025
b4d9a5b
format lines
krystophny Jul 7, 2025
203eff3
Remove unused comments
krystophny Jul 7, 2025
fa4e618
Format get_canonical_coordinates.f90
krystophny Jul 7, 2025
c4fd900
Add golden record test for comparison against main branch
krystophny Jul 7, 2025
7e0e7fe
Add golden record multi-comparison test script and update CMakeLists
krystophny Jul 7, 2025
0f52a7e
Add TODO.md with compiler warning checklist
krystophny Jul 7, 2025
fbdc0e8
Fix unused import warnings
krystophny Jul 7, 2025
889c868
Restore necessary imports in boozer_converter.f90
krystophny Jul 7, 2025
0ba2200
Fix compiler warnings in Fortran code
krystophny Jul 8, 2025
c3e0e76
Eliminate remaining compiler warnings
krystophny Jul 8, 2025
68d9062
backtrace
krystophny Jul 8, 2025
19f3049
Fix GVEC uninitialized state segfault with gcc 15
krystophny Jul 8, 2025
e66ce34
README for classification
krystophny Jul 8, 2025
c6c7e76
Add instructions for installing Python wrappers in README
krystophny Jul 8, 2025
1d0ee8a
Remove CMAKE_INTERPROCEDURAL_OPTIMIZATION setting from CMakeLists.txt
krystophny Jul 8, 2025
5200a8d
Add GVEC feature flag and fix gcc15 segfaults
krystophny Jul 8, 2025
23b2e79
PIP f90wrap
krystophny Jul 8, 2025
c56e6fe
Add OpenMPI dependencies to CI workflow
krystophny Jul 8, 2025
147db76
GSL libraries
krystophny Jul 8, 2025
16e4902
FFTW in github actions
krystophny Jul 8, 2025
416ee16
Remove TODO list for fixing compiler warnings
krystophny Jul 8, 2025
790b92d
Add python3-matplotlib to CI workflow dependencies
krystophny Jul 8, 2025
61bb7ec
Update CI workflow to use latest Texlive image and install LyX
krystophny Jul 8, 2025
787ff7a
Update branch triggers in tests workflow to only include 'main'
krystophny Jul 8, 2025
36fe327
Install package dependencies in the build step
krystophny Jul 8, 2025
c1ced2f
LyX without sudo
krystophny Jul 8, 2025
3d84de6
Add echo statement for LyX installation in CI workflow
krystophny Jul 8, 2025
6ea6ac0
Update push branch triggers in tests workflow to include 'develop'
krystophny Jul 8, 2025
6fecb17
Refactor CI workflow: remove unnecessary pip install command and stre…
krystophny Jul 8, 2025
7654e1d
Enhance CI workflow: streamline LyX installation and ensure dependenc…
krystophny Jul 8, 2025
5d79657
Add CI workflow for testing and documentation builds
krystophny Jul 8, 2025
e2cc9d5
Rename workflow from 'Tests' to 'CI' for clarity
krystophny Jul 8, 2025
0ea1f94
pip
krystophny Jul 8, 2025
155019c
CI
krystophny Jul 8, 2025
cf8998c
CI
krystophny Jul 8, 2025
93ce723
CI
krystophny Jul 8, 2025
f7e1f75
Enhance golden record system to support multi-file comparisons
krystophny Jul 8, 2025
651f05e
CI: Optimize GitHub Actions workflow for PR transitions
krystophny Jul 8, 2025
9397e36
CI: Simplify workflow to run all tests for every PR
krystophny Jul 8, 2025
091b14e
test: Remove fort.* files from golden record comparison
krystophny Jul 8, 2025
62c868a
CI: Split tests to run regression only on non-draft PRs
krystophny Jul 8, 2025
ef58b4e
CI: Optimize workflow to avoid duplicate builds
krystophny Jul 8, 2025
c5d4a79
build: Remove Intel compiler support and standardize on GNU Fortran
krystophny Jul 8, 2025
b0eb4b4
build: Only preprocess Fortran files with C preprocessor directives
krystophny Jul 8, 2025
a564027
refactor: Remove unused spline_3d_interpolation module
krystophny Jul 8, 2025
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
10 changes: 10 additions & 0 deletions .fprettify
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
indent = 4
line-length = 88
whitespace-comma = true
whitespace-assignment = true
whitespace-decl = true
whitespace-relational = true
whitespace-logical = true
whitespace-plusminus = true
whitespace-print = true
whitespace-intrinsics = true
88 changes: 75 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,92 @@ name: CI

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]

types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:

jobs:
build:
test:
name: Run Tests
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
gfortran \
cmake \
ninja-build \
libnetcdf-dev \
libnetcdff-dev \
liblapack-dev \
libblas-dev \
python3-pip \
python3-numpy \
python3-scipy \
python3-matplotlib \
python3-netcdf4 \
openmpi-bin \
libopenmpi-dev \
libgsl-dev \
libfftw3-dev
pip3 install --user scikit-build-core git+https://github.com/jameskermode/f90wrap simsopt

- name: Build SIMPLE
run: |
make clean
make
pip3 install -e . --no-build-isolation

- name: Run Fast Tests
run: make test-fast

- name: Run Slow Tests
run: make test

- name: Run Regression Tests
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false)
run: make test-regression

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
build/Testing/

build-docs:
name: Build Documentation
runs-on: ubuntu-latest

container:
image: texlive/texlive:latest

steps:
- uses: actions/checkout@v2
- name: Build
- uses: actions/checkout@v4

- name: Install LyX
run: |
echo "LyX installation"
apt-get update
apt-get install -y lyx

- name: Build LaTeX documents
run: |
cd DOC
latexmk -pdf canonical_and_boozer_flux_coords_via_VMEC.tex
lyx --export pdf2 neo-orb.lyx
- name: Upload doc artifacts
uses: actions/upload-artifact@v2
cd DOC
latexmk -pdf canonical_and_boozer_flux_coords_via_VMEC.tex
lyx --export pdf2 neo-orb.lyx

- name: Upload documentation artifacts
uses: actions/upload-artifact@v4
with:
name: doc
name: documentation
path: |
DOC/canonical_and_boozer_flux_coords_via_VMEC.pdf
DOC/neo-orb.pdf
DOC/neo-orb.pdf
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-merge-conflict
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: detect-private-key
- id: mixed-line-ending

- repo: local
hooks:
- id: run-fast-tests
name: Run Fast Tests
entry: make test-fast
language: system
pass_filenames: false
always_run: true
verbose: true
stages: [pre-commit]
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"fortran.formatting.formatter": "fprettify",
"fortran.formatting.fprettifyArgs": [
"-i 4",
"--enable-decl",
"--whitespace-comma",
"--whitespace-assignment",
"--whitespace-decl",
"--whitespace-relational",
"--whitespace-logical",
"--whitespace-print",
"--whitespace-intrinsics",
"--case",
"1",
"1",
"1",
"1"
],
}
8 changes: 6 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
- **Reconfigure**: `make reconfigure` - Forces CMake reconfiguration

### Testing
- **Run tests**: `make test` - Executes ctest in build directory
- **Run tests**: `make test` - Runs all tests including slow ones (excludes regression tests)
- **Fast tests only**: `make test-fast` - Excludes slow and regression tests
- **All tests**: `make test-regression` - Includes all tests including regression tests
- **Python tests**: Located in `test/python/` directory
- **Golden record testing**: Use `examples/golden_record.py` to compare against reference behavior
- **Verbose output**: Now default for all test targets. Use `VERBOSE=0` to disable
- **Single test**: `make test TEST=test_name` - Run specific test by name
- Note: Test system is currently under development

### Build Configuration
Expand All @@ -32,7 +36,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

### Dependencies
- Required: NetCDF, LAPACK/BLAS, libneo, GVEC (minimal)
- Compilers: GNU Fortran or Intel Fortran
- Compiler: GNU Fortran (gfortran)
- Optional: OpenMP (enabled by default)

### GVEC Integration
Expand Down
103 changes: 46 additions & 57 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
project (SIMPLE)
enable_language(C Fortran)

# Fetch GVEC as a minimal library (before setting SIMPLE-specific flags)
include(FetchContent)

FetchContent_Declare(
gvec
GIT_REPOSITORY https://gitlab.mpcdf.mpg.de/calbert/gvec.git
GIT_TAG develop
)

set(GVEC_FOR_SIMPLE TRUE CACHE BOOL "Build minimal GVEC for SIMPLE")
FetchContent_MakeAvailable(gvec)
add_compile_options(-g -fbacktrace)

include(Util)

Expand All @@ -38,6 +28,22 @@ endif()
option(ENABLE_PYTHON_INTERFACE "Enables the Python-Wrapper." ON)
option(SIMPLE_TESTING "Enable testing." ON)
option(ENABLE_OPENMP "Enable OpenMP compiler flags." ON)
option(ENABLE_GVEC "Enable GVEC field support (experimental)" OFF)

# Conditionally fetch GVEC if enabled
if(ENABLE_GVEC)
message(STATUS "GVEC support enabled - fetching GVEC library")
include(FetchContent)
FetchContent_Declare(
gvec
GIT_REPOSITORY https://gitlab.mpcdf.mpg.de/calbert/gvec.git
GIT_TAG develop
)
set(GVEC_FOR_SIMPLE TRUE CACHE BOOL "Build minimal GVEC for SIMPLE")
FetchContent_MakeAvailable(gvec)
else()
message(STATUS "GVEC support disabled")
endif()

set(CMAKE_MACOSX_RPATH 1)

Expand Down Expand Up @@ -78,54 +84,37 @@ endif()
message(STATUS "CMake build type: " ${CMAKE_BUILD_TYPE})

include_directories ($ENV{NETCDFF_INCLUDE} ${NFINC})
link_directories ($ENV{NETCDF_LIB} $ENV{NETCDFF_LIB} ${NFLIBS} $ENV{HOME}/.local/lib)

set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
link_directories ($ENV{NETCDF_LIB} $ENV{NETCDFF_LIB} ${NFLIBS})

# Set SIMPLE-specific compiler flags after GVEC to avoid affecting it
if (CMAKE_Fortran_COMPILER_ID MATCHES Intel)
add_compile_options(-mkl -qopenmp -warn all,nounused)
link_libraries("-mkl -qopenmp")
if (CMAKE_BUILD_TYPE MATCHES Debug)
add_compile_options(-O0 -g -traceback)
elseif (CMAKE_BUILD_TYPE MATCHES Profile)
add_compile_options(-O2 -g -shared-intel -debug inline-debug-info
-D TBB_USE_THREADING_TOOLS -qopenmp-link dynamic -parallel-source-info=2)
elseif (CMAKE_BUILD_TYPE MATCHES Release)
add_compile_options(-O3 -g -traceback)
elseif (CMAKE_BUILD_TYPE MATCHES Fast)
add_compile_options(-O3 -march=native -mtune=native)
endif()
else()
add_compile_options(-Wall -Wextra -Wimplicit-interface -Wno-external-argument-mismatch -fPIC -fmax-errors=5)
add_compile_options(-Wno-unused-dummy-argument)
add_compile_options(-ffree-line-length-132)
# If not apple
if (NOT APPLE)
add_link_options(-Wl,-z,noexecstack)
endif()
if (ENABLE_OPENMP)
add_compile_options(-fopenmp)
add_link_options(-fopenmp)
endif()
if (CMAKE_BUILD_TYPE MATCHES Debug)
add_compile_options(-C)
add_compile_options(-O0 -g -ggdb
-ffpe-trap=invalid,zero,overflow -fbounds-check -fcheck=all,no-array-temps
-finit-real=nan -fno-omit-frame-pointer -fno-inline)
add_compile_options(-fbacktrace)
elseif (CMAKE_BUILD_TYPE MATCHES Profile)
add_compile_options(-O2 -p -g -shared-libgcc)
elseif (CMAKE_BUILD_TYPE MATCHES Release)
add_compile_options(-O3 -g)
add_compile_options(-fbacktrace)
elseif (CMAKE_BUILD_TYPE MATCHES Fast)
add_compile_options(-O3 -ffast-math -ffp-contract=fast -funroll-loops -mtune=native)
if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "arm64")
add_compile_options(-march=native)
else()
add_compile_options(-march=haswell)
endif()
# GNU Fortran compiler flags
add_compile_options(-Wall -Wextra -Wimplicit-interface -Wno-external-argument-mismatch -fPIC -fmax-errors=5)
add_compile_options(-Wno-unused-dummy-argument)
add_compile_options(-ffree-line-length-132)
add_compile_options(-g -fbacktrace)
# If not apple
if (NOT APPLE)
add_link_options(-Wl,-z,noexecstack)
endif()
if (ENABLE_OPENMP)
add_compile_options(-fopenmp)
add_link_options(-fopenmp)
endif()
if (CMAKE_BUILD_TYPE MATCHES Debug)
add_compile_options(-C)
add_compile_options(-O0 -ggdb
-ffpe-trap=invalid,zero,overflow -fbounds-check -fcheck=all,no-array-temps
-finit-real=nan -fno-omit-frame-pointer -fno-inline)
elseif (CMAKE_BUILD_TYPE MATCHES Profile)
add_compile_options(-O2 -p -shared-libgcc)
elseif (CMAKE_BUILD_TYPE MATCHES Release)
add_compile_options(-O3)
elseif (CMAKE_BUILD_TYPE MATCHES Fast)
add_compile_options(-O3 -ffast-math -ffp-contract=fast -funroll-loops -mtune=native)
if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "arm64")
add_compile_options(-march=native)
else()
add_compile_options(-march=haswell)
endif()
endif()

Expand Down
32 changes: 24 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ CONFIG ?= Release
BUILD_DIR := build
BUILD_NINJA := $(BUILD_DIR)/build.ninja

.PHONY: all configure reconfigure build test install clean
# Common ctest command with optional verbose and test name filtering
CTEST_CMD = cd $(BUILD_DIR) && ctest --test-dir test --output-on-failure $(if $(filter 1,$(VERBOSE)),-V) $(if $(TEST),-R $(TEST))

.PHONY: all configure reconfigure build test test-fast test-slow test-regression test-all install clean
all: build

$(BUILD_NINJA):
Expand All @@ -16,16 +19,29 @@ reconfigure:
build: configure
cmake --build $(BUILD_DIR) --config $(CONFIG)

# Run tests with optional verbose output and single test selection
# Usage: make test [VERBOSE=1] [TEST=test_name] [INCLUDE_SLOW=1]
# Example: make test VERBOSE=1 TEST=test_gvec
# By default, tests labeled "slow" are excluded. To include them: make test INCLUDE_SLOW=1
# Test targets
# Usage: make [test-target] [TEST=test_name] [VERBOSE=1]
# Example: make test TEST=test_gvec VERBOSE=1

# Run all tests except regression tests (default)
test: build
cd $(BUILD_DIR) && ctest --test-dir test --output-on-failure $(if $(VERBOSE),-V) $(if $(TEST),-R $(TEST)) $(if $(INCLUDE_SLOW),,-LE "slow")
$(CTEST_CMD) -LE "regression"

# Run only fast tests (exclude slow and regression tests)
test-fast: build
$(CTEST_CMD) -LE "slow|regression"

# Run only slow tests
test-slow: build
$(CTEST_CMD) -L "slow" -LE "regression"

# Run only regression tests
test-regression: build
$(CTEST_CMD) -L "regression"

# Run all tests including slow ones
# Run all tests including regression tests
test-all: build
cd $(BUILD_DIR) && ctest --test-dir test --output-on-failure $(if $(VERBOSE),-V) $(if $(TEST),-R $(TEST))
$(CTEST_CMD)

doc: configure
cmake --build --preset default --target doc
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ Required libraries:
* NetCDF
* LAPACK/BLAS

Supported compilers:
* GNU Fortan
* Intel Fortran
Required compiler:
* GNU Fortran (gfortran)

For Python wrappers, do
```bash
pip install git+https://github.com/jameskermode/f90wrap
pip install -e . --no-build-isolation
```

## Usage

Expand Down
Loading
Loading