Skip to content

Commit e9e68b2

Browse files
glesurneutrinocerossvalat
authored
v2.3.0 (#376)
### Changed - fixed a bug that could lead to diverging results around the spherical axis in non-ideal MHD in 2.5D and 3D (#356) - refactor of the MPI exchange routines and boundary routines to avoid buildup of roundoff errors at domain faces/edges that could lead to the sudden burst of div(B) or incoherences between MPI sub-domains (#357) - fixed a bug that could lead to compilations error when targetting AMD APUs (#359) - fixed a bug that led to the generation of incorrect subviews in 2.5D with vector_potential enabled (#362) - fixed a bug that could lead to memory corruption when using the UCT_HLLD emf reconstruction scheme and DIMENSIONS < COMPONENTS (#363) - reorganise the test to separate specific IO tests from physics tests (#367) ### Added - magnetic vector potential is now accessible from pydefix when enabled (#361) - use ccache in the test suite to reduce the runtime of continuous integration (#364) - automatically detects pybind11 path with cmake when using pydefix (#367) - skeleton to run the test suite with pytest (#366) --------------------------------------------------------------------------- Co-authored-by: Clément Robert <cr52@protonmail.com> Co-authored-by: Sébastien Valat <sebastien.valat.dev@orange.fr>
1 parent 9e25551 commit e9e68b2

175 files changed

Lines changed: 4441 additions & 1906 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/idefix-ci-jobs.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/sod-iso -all $TESTME_OPTIONS
3939
- name: Mach reflection test
4040
run: scripts/ci/run-tests $IDEFIX_DIR/test/HD//MachReflection -all $TESTME_OPTIONS
41+
- name: Sedov blast wave
42+
run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/SedovBlastWave -all $TESTME_OPTIONS
4143

4244
ParabolicHydro:
4345
runs-on: self-hosted
@@ -68,8 +70,10 @@ jobs:
6870
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/sod-iso -all $TESTME_OPTIONS
6971
- name: Orszag Tang
7072
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/OrszagTang -all $TESTME_OPTIONS
71-
- name: Orszag Tang 3D+restart tests
73+
- name: Orszag Tang 3D
7274
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/OrszagTang3D -all $TESTME_OPTIONS
75+
- name: Linear wave test
76+
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/LinearWaveTest -all $TESTME_OPTIONS
7377
- name: Axis Flux tube
7478
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/AxisFluxTube -all $TESTME_OPTIONS
7579

@@ -221,3 +225,24 @@ jobs:
221225
run: scripts/ci/run-tests $IDEFIX_DIR/test/utils/dumpImage -all $TESTME_OPTIONS
222226
- name: Column density
223227
run: scripts/ci/run-tests $IDEFIX_DIR/test/utils/columnDensity -all $TESTME_OPTIONS
228+
229+
IOs:
230+
needs: [Fargo, Dust, Planet, ShearingBox, SelfGravity]
231+
runs-on: self-hosted
232+
steps:
233+
- name: Check out repo
234+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
235+
with:
236+
submodules: recursive
237+
persist-credentials: false
238+
- name: Restart dumps
239+
run: scripts/ci/run-tests $IDEFIX_DIR/test/IO/dump -all $TESTME_OPTIONS
240+
- name: Pydefix
241+
run: |
242+
python3 -m venv $IDEFIX_DIR/test/IO/pydefix/env
243+
source $IDEFIX_DIR/test/IO/pydefix/env/bin/activate
244+
python3 -m pip install -r $IDEFIX_DIR/test/IO/pydefix/python_requirements.txt
245+
scripts/ci/run-tests $IDEFIX_DIR/test/IO/pydefix -all $TESTME_OPTIONS
246+
247+
- name: xdmf
248+
run: scripts/ci/run-tests $IDEFIX_DIR/test/IO/xdmf -all $TESTME_OPTIONS

.github/workflows/idefix-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ jobs:
3232
name: CPU Jobs (intel OneApi)
3333
uses: ./.github/workflows/idefix-ci-jobs.yml
3434
with:
35-
TESTME_OPTIONS: -intel -Werror
35+
TESTME_OPTIONS: -intel -Werror -ccache
3636
IDEFIX_COMPILER: icc
3737

3838
gcc-jobs:
3939
needs: Linter
4040
name: CPU Jobs (gcc)
4141
uses: ./.github/workflows/idefix-ci-jobs.yml
4242
with:
43-
TESTME_OPTIONS: -Werror
43+
TESTME_OPTIONS: -Werror -ccache
4444
IDEFIX_COMPILER: gcc
4545

4646
cuda-jobs:

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ CMakeFiles
2222
CMakeCache.txt
2323
cmake_install.cmake
2424
Makefile.local
25+
git-state.txt
26+
Kokkos_Version_info.*
27+
2528

2629
# test artifacts
2730
test/**/*.o
@@ -36,6 +39,9 @@ test/**/KokkosCore*
3639
test/**/*.csv
3740
test/**/*.pyc
3841
test/**/*.dat
42+
test/**/cmake_packages*
43+
test/**/
44+
idefix-tests.junit.xml
3945

4046
# machine specific cache and hidden files
4147
.*

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ repos:
4545
- F403 # ignore import *
4646

4747
- repo: https://github.com/neutrinoceros/inifix
48-
rev: v5.0.2
48+
rev: v6.1.2
4949
hooks:
5050
- id: inifix-format
51+
files: ^(test/).*\.(ini)$ # want to skip pytest.ini
5152

5253
- repo: https://github.com/Lucas-C/pre-commit-hooks
5354
rev: v1.5.5

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.3.0] 2026-04-21
8+
### Changed
9+
10+
- fixed a bug that could lead to diverging results around the spherical axis in non-ideal MHD in 2.5D and 3D (#356)
11+
- refactor of the MPI exchange routines and boundary routines to avoid buildup of roundoff errors at domain faces/edges that could lead to the sudden burst of div(B) or incoherences between MPI sub-domains (#357)
12+
- fixed a bug that could lead to compilations error when targetting AMD APUs (#359)
13+
- fixed a bug that led to the generation of incorrect subviews in 2.5D with vector_potential enabled (#362)
14+
- fixed a bug that could lead to memory corruption when using the UCT_HLLD emf reconstruction scheme and DIMENSIONS < COMPONENTS (#363)
15+
- reorganise the test to separate specific IO tests from physics tests (#367)
16+
17+
### Added
18+
- magnetic vector potential is now accessible from pydefix when enabled (#361)
19+
- use ccache in the test suite to reduce the runtime of continuous integration (#364)
20+
- automatically detects pybind11 path with cmake when using pydefix (#367)
21+
- skeleton to run the test suite with pytest (#366)
22+
23+
724
## [2.2.02] 2025-10-18
825
### Changed
926

@@ -13,6 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1330
- fixed a bug that led to incorrect BX2 reconstruction when axis is not used on both sides of the domain (#345)
1431
- fixed a bug that led to incorrect reflective boundary conditions on B when DIMENSIONS < 3 (#345)
1532
- fixed a bug that led to incorrect dust stopping time when the adiabatic equation of state is used with "size" drag law (#353)
33+
- fixed div(B) normalisation to avoid "too large div(B)" errors when this is actually due to nulls in |B|
34+
- fixed insecure github actions settings (#373)
1635

1736
### Added
1837

CMakeLists.txt

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ endif()
55
set (CMAKE_CXX_STANDARD 17)
66

77
set(Idefix_VERSION_MAJOR 2)
8-
set(Idefix_VERSION_MINOR 2)
9-
set(Idefix_VERSION_PATCH 02)
8+
set(Idefix_VERSION_MINOR 3)
9+
set(Idefix_VERSION_PATCH 0)
1010

11-
project (idefix VERSION 2.2.02)
11+
project (idefix VERSION 2.3.0)
1212
option(Idefix_MHD "enable MHD" OFF)
1313
option(Idefix_MPI "enable Message Passing Interface parallelisation" OFF)
1414
option(Idefix_HIGH_ORDER_FARGO "Force Fargo to use a PPM reconstruction scheme" OFF)
1515
option(Idefix_DEBUG "Enable Idefix debug features (makes the code very slow)" OFF)
1616
option(Idefix_RUNTIME_CHECKS "Enable runtime sanity checks" OFF)
1717
option(Idefix_WERROR "Treat compiler warnings as errors" OFF)
1818
option(Idefix_PYTHON "Enable python bindings (requires pybind11)" OFF)
19+
set(Idefix_PROBLEM_DIR "${CMAKE_BINARY_DIR}" CACHE STRING "Problem directory to build for.")
1920
set(Idefix_CXX_FLAGS "" CACHE STRING "Additional compiler/linker flag")
2021
set(Idefix_DEFS "definitions.hpp" CACHE FILEPATH "Problem definition header file")
2122
option(Idefix_CUSTOM_EOS "Use custom equation of state" OFF)
@@ -34,7 +35,6 @@ set_property(CACHE Idefix_PRECISION PROPERTY STRINGS Double Single)
3435
set(Idefix_LOOP_PATTERN "Default" CACHE STRING "Loop pattern for idefix_for")
3536
set_property(CACHE Idefix_LOOP_PATTERN PROPERTY STRINGS Default SIMD Range MDRange TeamPolicy TeamPolicyInnerVector)
3637

37-
3838
# load git revision tools
3939
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
4040
include(GetGitRevisionDescription)
@@ -51,7 +51,7 @@ if(Kokkos_ENABLE_CUDA)
5151
endif()
5252

5353
# Add kokkos CMAKE files (required early since these set compiler options)
54-
add_subdirectory(src/kokkos build/kokkos)
54+
add_subdirectory(src/kokkos ${CMAKE_BINARY_DIR}/build/kokkos)
5555
include_directories(${Kokkos_INCLUDE_DIRS_RET})
5656

5757
# Add Idefix CXX Flags
@@ -75,20 +75,22 @@ endif()
7575
add_executable(idefix)
7676
add_subdirectory(src build)
7777

78-
if(EXISTS ${PROJECT_BINARY_DIR}/setup.cpp)
79-
target_sources(idefix PUBLIC ${PROJECT_BINARY_DIR}/setup.cpp)
78+
# make absolute
79+
get_filename_component(Idefix_PROBLEM_DIR_ABS ${Idefix_PROBLEM_DIR} ABSOLUTE BASE_DIR ${PROJECT_BINARY_DIR})
80+
81+
if(EXISTS ${Idefix_PROBLEM_DIR_ABS}/setup.cpp)
82+
target_sources(idefix PUBLIC ${Idefix_PROBLEM_DIR_ABS}/setup.cpp)
8083
else()
8184
message(WARNING "No specific setup.cpp found in the problem directory (this message can be ignored if using python to define your problem)")
8285
endif()
8386

8487
# If a CMakeLists.txt is in the problem dir (for problem-specific source files)
8588
# then read it
86-
if(EXISTS ${PROJECT_BINARY_DIR}/CMakeLists.txt)
87-
message(STATUS "Including problem-specific CMakeLists in '${PROJECT_BINARY_DIR}'")
88-
add_subdirectory(${PROJECT_BINARY_DIR} build/setup)
89+
if(EXISTS ${Idefix_PROBLEM_DIR_ABS}/CMakeLists.txt)
90+
message(STATUS "Including problem-specific CMakeLists in '${Idefix_PROBLEM_DIR_ABS}'")
91+
add_subdirectory(${Idefix_PROBLEM_DIR_ABS} build/setup)
8992
endif()
9093

91-
9294
if(Idefix_MHD)
9395
add_compile_definitions("MHD=YES")
9496
else()
@@ -99,10 +101,7 @@ if(Idefix_MPI)
99101
add_compile_definitions("WITH_MPI")
100102
find_package(MPI REQUIRED)
101103
target_link_libraries(idefix MPI::MPI_CXX)
102-
target_sources(idefix
103-
PUBLIC src/mpi.cpp
104-
PUBLIC src/mpi.hpp
105-
)
104+
add_subdirectory(src/mpi)
106105
endif()
107106

108107
if(Idefix_HDF5)
@@ -116,14 +115,30 @@ if(Idefix_HDF5)
116115
)
117116
find_package(HDF5 REQUIRED)
118117
target_link_libraries(idefix "${HDF5_LIBRARIES}")
119-
target_include_directories(idefix "${HDF5_INCLUDE_DIRS}")
118+
message(STATUS "Found HDF5 include directories: ${HDF5_INCLUDE_DIRS}")
119+
target_include_directories(idefix PUBLIC "${HDF5_INCLUDE_DIRS}")
120+
if(Idefix_MPI)
121+
if(NOT HDF5_IS_PARALLEL)
122+
message(FATAL_ERROR "Parallel HDF5 required for Idefix_MPI but the found HDF5 library does not support it")
123+
endif()
124+
endif()
120125
message(STATUS "XDMF (hdf5+xmf) dumps enabled")
121126
else()
122127
set(Idefix_HDF5 OFF)
123128
endif()
124129

125130
if(Idefix_PYTHON)
126131
add_compile_definitions("WITH_PYTHON")
132+
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
133+
134+
execute_process(
135+
COMMAND "${Python3_EXECUTABLE}" -m pybind11 --cmakedir
136+
OUTPUT_VARIABLE PYBIND11_CMAKE_DIR
137+
OUTPUT_STRIP_TRAILING_WHITESPACE
138+
COMMAND_ERROR_IS_FATAL ANY
139+
)
140+
141+
list(APPEND CMAKE_PREFIX_PATH "${PYBIND11_CMAKE_DIR}")
127142
if (NOT DEFINED Python_FIND_FRAMEWORK)
128143
set(Python_FIND_FRAMEWORK "LAST") # Use Apple's python only at last resort on Macos
129144
endif ()
@@ -213,7 +228,7 @@ if(${Idefix_PRECISION} STREQUAL "Single")
213228
endif()
214229

215230
target_include_directories(idefix PUBLIC
216-
"${PROJECT_BINARY_DIR}"
231+
"${Idefix_PROBLEM_DIR_ABS}"
217232
)
218233
target_include_directories(idefix PUBLIC
219234
src/kokkos/core/src
@@ -234,6 +249,7 @@ target_include_directories(idefix PUBLIC
234249
src/gravity
235250
src/utils
236251
src/utils/iterativesolver
252+
src/mpi
237253
src
238254
)
239255

@@ -251,6 +267,7 @@ message(STATUS " Python: ${Idefix_PYTHON}")
251267
message(STATUS " Reconstruction: ${Idefix_RECONSTRUCTION}")
252268
message(STATUS " Precision: ${Idefix_PRECISION}")
253269
message(STATUS " Version: ${Idefix_VERSION}")
270+
message(STATUS " Problem directory: '${Idefix_PROBLEM_DIR}'")
254271
message(STATUS " Problem definitions: '${Idefix_DEFS}'")
255272
if(Idefix_CUSTOM_EOS)
256273
message(STATUS " EOS: Custom file '${Idefix_CUSTOM_EOS_FILE}'")

doc/python_requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
# python -m pip install -r python_requirements.txt
77

88
wheel>=0.38.4 # help forward compatibility for pip with old sphinx plugins
9-
sphinx==5.3.0
10-
sphinx_rtd_theme==1.3.0
9+
sphinx==9.1.0
10+
sphinx_rtd_theme==3.1.0
1111
sphinx_git==11.0.0
12-
breathe==4.34.0
12+
breathe==4.36.0
1313
exhale==0.3.7
14-
m2r2==0.3.2
14+
m2r2==0.3.4
1515
sphinx-copybutton==0.5.2
1616
#sphinxcontrib-applehelp==1.0.7
1717
matplotlib==3.10.0

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
author = 'Geoffroy Lesur'
2424

2525
# The full version, including alpha/beta/rc tags
26-
release = '2.2.02'
26+
release = '2.3.0'
2727

2828

2929

doc/source/modules/pydefix.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Pydefix usage
2323
Idefix Configuration
2424
++++++++++++++++++++
2525

26-
In order to use Pydefix, you need to switch on ``Idefix_PYTHON`` in cmake. This will auto-detect Python and check that pybind11 can be used effectively.
26+
In order to use Pydefix, you need to switch on ``Idefix_PYTHON`` in cmake. This will auto-detect Python and check that pybind11 can be used effectively. If you are using a python environement manager such as venv or conda, make sure to activate the right environement *before* running cmake, as idefix
27+
now includes the full path to python and pybind11 in its executable file.
2728

2829

2930
Run Idefix with Pydefix

doc/source/reference/makefile.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ Several options can be enabled from the command line (or are accessible with ``c
5959
The number of ghost cells is automatically adjusted as a function of the order of the reconstruction scheme.
6060
*Idefix* uses 2 ghost cells when ``ORDER < 4`` and 3 ghost cells when ``ORDER = 4``
6161

62+
``-D Idefix_PROBLEM_DIR=.``
63+
Specify where to find the problem directory to build *Idefix* out of source.
64+
Place yourself in the ``build`` directory you want to build in and call the ``cmake`` by :
65+
+ pointing the *Idefix* source directory via ``IDEFIX_DIR`` as usual.
66+
+ using ``-D Idefix_PROBLEM_DIR`` to point the problem to build.
67+
6268
``-D Kokkos_ENABLE_OPENMP=ON``
6369
Enable OpenMP parallelisation on supported compilers. Note that this can be enabled simultaneously with MPI, resulting in a hybrid MPI+OpenMP compilation.
6470

0 commit comments

Comments
 (0)