Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
b2893ec
Fast default splines
krystophny Jul 16, 2025
de8f46b
Fix natural boundary conditions
krystophny Jul 16, 2025
d6513c1
Fix index of spline coefficient
krystophny Jul 16, 2025
13d1755
Add error handling for LAPACK call
krystophny Jul 16, 2025
7115ce9
Remove trailing whitespaces
krystophny Jul 16, 2025
276d766
Add spline module design analysis documentation
krystophny Jul 19, 2025
8ba7a92
Replace splinecof3_a with direct sparse matrix implementation
krystophny Jul 20, 2025
3b534aa
Replace dense matrix implementation with direct sparse implementation
krystophny Jul 20, 2025
e164751
Fix testing scope by removing enable_testing() from COMMON
krystophny Jul 20, 2025
d1ebc3d
Update make test to run only spline comparison test
krystophny Jul 20, 2025
ba1bd46
WIP: Add runtime performance test infrastructure
krystophny Jul 20, 2025
52d656d
Revert complex module restructuring, keep sparse implementation
krystophny Jul 20, 2025
9ea1ab9
Restore inter_interfaces.f90 to main branch state
krystophny Jul 20, 2025
a28d6bb
Add fast path detection to main spline_cof.f90 and update documentation
krystophny Jul 20, 2025
f04088f
Fix tests to properly validate correctness against original implement…
krystophny Jul 20, 2025
0c9594e
Improve test validation to only compare when dispatch conditions are met
krystophny Jul 20, 2025
3f2ddf3
Fix fast path bug by disabling incompatible optimization
krystophny Jul 20, 2025
c437997
Clean up PR and fix critical buffer overflow vulnerability
krystophny Aug 1, 2025
6f0e619
Fix GitHub Actions to avoid duplicate runs and respect draft status
krystophny Aug 1, 2025
5ef3f82
Update Splines.md documentation to reflect final implementation status
krystophny Aug 1, 2025
82c3fb4
Clean up Splines.md to focus on design rather than development process
krystophny Aug 1, 2025
2f721d7
Address QODO and GeorgGrassler PR review concerns
krystophny Aug 1, 2025
4063de1
Improve sparse matrix memory allocation with exact analytical calcula…
krystophny Aug 1, 2025
ea9f46b
Fix critical bugs identified by QODO code review
krystophny Aug 1, 2025
30feacc
Add unit tests to CI workflow
krystophny Aug 1, 2025
f51d463
Fix matrix construction bugs in sparse spline implementation
krystophny Aug 1, 2025
d9863a5
Address QODO review concerns and add fast path optimization
krystophny Aug 1, 2025
2bb9515
Fix fast spline implementation with correct boundary conditions
krystophny Aug 1, 2025
de30349
Fix mathematical errors in clamped boundary second derivatives
krystophny Aug 1, 2025
3bd5f4d
make clean
krystophny Aug 1, 2025
7e1b97c
case sensitive
krystophny Aug 1, 2025
b02c52e
Fix clamped boundary conditions in fast spline implementation
krystophny Aug 1, 2025
133f1e6
Add analytical tests proving original clamped boundary bug
krystophny Aug 1, 2025
691064e
Debug and enhance spline tests, prove original implementation bug
krystophny Aug 1, 2025
b811387
Update comparison tests to handle original implementation bug
krystophny Aug 1, 2025
1535172
Document and maintain boundary condition limitation in spline impleme…
krystophny Aug 1, 2025
b814861
Fix sparse spline implementation to produce identical results to dense
krystophny Aug 1, 2025
d51f494
Add comprehensive code coverage tracking with lcov and Codecov integr…
krystophny Aug 1, 2025
4fec172
Restructure CI: separate unit tests with coverage from integration tests
krystophny Aug 1, 2025
22621e5
Improve CI workflows: fix MPI caching issues and optimize triggers
krystophny Aug 1, 2025
02b035a
Add liblapack-dev to cached packages in both workflows
krystophny Aug 1, 2025
724a695
Align codecov.yml with fortfront patch coverage requirements
krystophny Aug 1, 2025
f8d4c4d
Cache safe MPI dependencies to speed up CI
krystophny Aug 1, 2025
38d3251
Fix CI build failures: ensure pkg-config files for BLAS and MPI
krystophny Aug 1, 2025
ae6de8a
Add use_fast_splines configuration option (default: false)
krystophny Aug 2, 2025
4e6c0f2
Consolidate spline documentation into DOC/DESIGN/Splines.md
krystophny Aug 2, 2025
7f0fac8
Update documentation with use_fast_splines configuration option
krystophny Aug 2, 2025
7db8507
Fix module naming and configuration structure
krystophny Aug 2, 2025
4dc49a1
Simplify spline configuration by removing obsolete disable_fast_path
krystophny Aug 2, 2025
93aa297
Simplify spline configuration by removing obsolete disable_fast_path
krystophny Aug 2, 2025
5c4fb7e
Add comprehensive coverage test for sparse spline implementation
krystophny Aug 2, 2025
d909be8
Add targeted test for uncovered error paths to improve code coverage
krystophny Aug 2, 2025
a081dbb
Add coverage and test output files to gitignore
krystophny Aug 2, 2025
2bbad17
Add patch coverage tests targeting 0% coverage files
krystophny Aug 2, 2025
9a6946b
Remove dead code that was never used and hurting patch coverage
krystophny Aug 2, 2025
2b307ae
cleanup
krystophny Aug 2, 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
51 changes: 40 additions & 11 deletions .github/workflows/test-on-pr.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
name: Run Test

on:
pull_request:
push:
branches:
- main
push:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- '**'
- main
- master
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have master branch now?


concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
run-golden-record:
runs-on: ubuntu-24.04
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false)

env:
CC: gcc
Expand All @@ -24,18 +32,38 @@ jobs:

- name: Set up Python 3
run: |
sudo apt-get update -y
sudo apt-get install -y -q --no-install-recommends python3-dev
python -m pip install --upgrade pip
pip install numpy

- name: Install required packages
- name: Cache apt packages
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: git cmake make ninja-build gcc g++ gfortran jq libopenblas-dev liblapack-dev libsuitesparse-dev libfftw3-dev libgsl-dev libhdf5-dev libnetcdf-dev libnetcdff-dev python3-dev libevent-dev libnuma-dev libhwloc-dev libnl-3-dev libnl-route-3-dev libltdl-dev openmpi-bin openmpi-common libopenmpi-dev
version: 1.0
execute_install_scripts: true

- name: Ensure BLAS and MPI are properly configured
run: |
sudo apt update
sudo apt install git cmake make ninja-build gcc g++ gfortran jq
sudo apt install openmpi-bin openmpi-common libopenmpi-dev
sudo apt install libopenblas-dev libsuitesparse-dev
sudo apt install libfftw3-dev libgsl-dev libhdf5-dev libnetcdf-dev libnetcdff-dev
# Fallback installation to ensure pkg-config files are present
sudo apt-get update
sudo apt-get install -y --reinstall libopenblas-dev pkg-config
sudo apt-get install -y --reinstall openmpi-bin openmpi-common libopenmpi-dev

# Verify BLAS can be found
pkg-config --exists openblas && echo "OpenBLAS pkg-config found" || echo "Warning: OpenBLAS pkg-config not found"

# Verify MPI can be found
pkg-config --exists ompi && echo "OpenMPI pkg-config found" || echo "Warning: OpenMPI pkg-config not found"
which mpifort && echo "mpifort found at: $(which mpifort)" || echo "Warning: mpifort not found"

# Set environment variables to help CMake
echo "BLA_VENDOR=OpenBLAS" >> $GITHUB_ENV
echo "MPI_HOME=/usr" >> $GITHUB_ENV

- name: Set up Python 3
run: |
python -m pip install --upgrade pip
pip install numpy

- name: Clone test data
id: data
Expand Down Expand Up @@ -63,6 +91,7 @@ jobs:
cd python
pip install -e .


- name: Build NEO-2 (current version)
id: build
run: |
Expand Down
123 changes: 123 additions & 0 deletions .github/workflows/unit-tests-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Unit Tests with Coverage

on:
push:
branches:
- main
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
- master

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
unit-tests-coverage:
runs-on: ubuntu-24.04
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false)

env:
CC: gcc
CXX: g++
FC: gfortran
MPI_HOME: /usr

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache apt packages
uses: awalsh128/cache-apt-pkgs-action@v1

Check warning on line 34 in .github/workflows/unit-tests-coverage.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/unit-tests-coverage.yml#L34

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
with:
packages: git cmake make ninja-build gcc g++ gfortran jq lcov libopenblas-dev liblapack-dev libsuitesparse-dev libfftw3-dev libgsl-dev libhdf5-dev libnetcdf-dev libnetcdff-dev python3-dev libevent-dev libnuma-dev libhwloc-dev libnl-3-dev libnl-route-3-dev libltdl-dev openmpi-bin openmpi-common libopenmpi-dev
version: 1.0
execute_install_scripts: true

- name: Ensure BLAS and MPI are properly configured
run: |
# Fallback installation to ensure pkg-config files are present
sudo apt-get update
sudo apt-get install -y --reinstall libopenblas-dev pkg-config
sudo apt-get install -y --reinstall openmpi-bin openmpi-common libopenmpi-dev

# Verify BLAS can be found
pkg-config --exists openblas && echo "OpenBLAS pkg-config found" || echo "Warning: OpenBLAS pkg-config not found"

# Verify MPI can be found
pkg-config --exists ompi && echo "OpenMPI pkg-config found" || echo "Warning: OpenMPI pkg-config not found"
which mpifort && echo "mpifort found at: $(which mpifort)" || echo "Warning: mpifort not found"

# Set environment variables to help CMake
echo "BLA_VENDOR=OpenBLAS" >> $GITHUB_ENV
echo "MPI_HOME=/usr" >> $GITHUB_ENV

- name: Set up Python 3
run: |
python -m pip install --upgrade pip
pip install numpy lcov-cobertura



- name: Build NEO-2 with coverage flags
run: |
cmake --preset default -DCMAKE_BUILD_TYPE=Coverage
cmake --build --preset default

- name: Run unit tests with coverage
run: |
make test

- name: Generate coverage report
run: |
# Capture coverage data
cd build && lcov --capture --directory . --output-file coverage.info \
--rc branch_coverage=1 \
--rc geninfo_unexecuted_blocks=1 \
--ignore-errors inconsistent,mismatch,empty,unused

# Filter coverage data to include only source code
lcov --remove coverage.info \
'*/build/*' \
'*/TEST/*' \
'*/libneo/*' \
'*/thirdparty/*' \
'*/DOC/*' \
'*/MULTI-SPEC-TOOLS/*' \
'*/tools/*' \
'/usr/*' \
'/tmp/*' \
--output-file coverage_filtered.info \
--rc branch_coverage=1 \
--ignore-errors unused,empty

# Generate XML for Codecov
lcov_cobertura coverage_filtered.info -o coverage.xml

# Show coverage summary
echo "=== Coverage Summary ===" >> $GITHUB_STEP_SUMMARY
lcov --summary coverage_filtered.info >> $GITHUB_STEP_SUMMARY || echo "No coverage data found" >> $GITHUB_STEP_SUMMARY

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4

Check warning on line 105 in .github/workflows/unit-tests-coverage.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/unit-tests-coverage.yml#L105

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./build/coverage.xml
flags: unittests
name: unit-tests-coverage
fail_ci_if_error: false
verbose: true

- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: |
build/coverage.info
build/coverage_filtered.info
build/coverage.xml
retention-days: 7
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,16 @@ DOC/latex/*
build/cmake_install.cmake

.DS_Store

# Ignore coverage files and reports
*.gcov
*.gcda
*.gcno
coverage.info
coverage_filtered.info
coverage.xml

# Ignore test output directories
TEST/Testing/
*/TEST/Testing/
*/*/TEST/Testing/
5 changes: 4 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,7 @@ Install with: `cd python && pip install -e .`
- Maintain separation between QL and PAR implementations
- Output data in HDF5 format for efficiency
- Keep MPI code isolated to PAR variant
- Test changes with golden record tests before submitting PRs
- Test changes with golden record tests before submitting PRs

## Build Tips
- You don't have to run make clean usually. Only as a last resort when build fails repeatedly.
17 changes: 15 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
project(NEO-2)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
enable_language(C Fortran)
enable_testing()

if(EXISTS ${CMAKE_BINARY_DIR}/BuildConfig.cmake.in)
include (${CMAKE_BINARY_DIR}/BuildConfig.cmake.in)
Expand Down Expand Up @@ -46,12 +47,23 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
)
string(REPLACE ";" "" MY_DEBUG_FLAG ${MY_DEBUG_FLAG_LIST})
set(CMAKE_Fortran_FLAGS_DEBUG "${MY_DEBUG_FLAG}")

# Coverage build type - optimized with coverage instrumentation
set(CMAKE_Fortran_FLAGS_COVERAGE "-O1 -g --coverage -fbacktrace -fopenmp")
set(CMAKE_C_FLAGS_COVERAGE "-O1 -g --coverage -fopenmp")
set(CMAKE_CXX_FLAGS_COVERAGE "-O1 -g --coverage -fopenmp")
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage -fopenmp")
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage -fopenmp")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
set(CMAKE_Fortran_FLAGS_DEBUG "-cpp -mkl -g -warn all -stand f08 ")
# Intel coverage flags (if needed)
set(CMAKE_Fortran_FLAGS_COVERAGE "-O1 -g -prof-gen=srcpos")
set(CMAKE_C_FLAGS_COVERAGE "-O1 -g -prof-gen=srcpos")
set(CMAKE_CXX_FLAGS_COVERAGE "-O1 -g -prof-gen=srcpos")
endif()

set (CMAKE_Fortran_FLAGS_COVERAGE "--coverage")
set (CMAKE_Fortran_FLAGS_TEST "-O2 --coverage")
# Mark Coverage as a valid build type
set(CMAKE_CONFIGURATION_TYPES "Debug;Release;Coverage" CACHE STRING "" FORCE)

### Upstream dependencies
find_package(MPI REQUIRED)
Expand Down Expand Up @@ -104,6 +116,7 @@ add_subdirectory(NEO-2-PAR)
add_subdirectory(NEO-2-QL)
add_subdirectory(MULTI-SPEC-TOOLS)
add_subdirectory(tools/create_surfaces)
add_subdirectory(TEST)

### Optional target for docs
find_package(LATEX)
Expand Down
2 changes: 1 addition & 1 deletion COMMON/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
project(NEO-2-COMMON)
enable_testing()

### FGSL user-defined interface
set(FGSL_USERINTERFACE_SOURCE_FILES
Expand Down Expand Up @@ -68,6 +67,7 @@ set(COMMON_FILES
sparse_mod.f90
sparsevec_mod.f90
spline_cof.f90
splinecof3_direct_sparse.f90
spline_int.f90
spline_mod.f90
test_function.f90
Expand Down
Loading
Loading