Skip to content

Commit

Permalink
Broken CI by XDMF (#186)
Browse files Browse the repository at this point in the history
* force HDF5 in tests that requires XDMF outputs

* correctly add HDF5 files when HDF5 is enabled through a setup CMakeLists
Incidentally allow the user to enable MPI in a setup CMakeLists.txt

* restore back the vtk frequency for CIs

* remove xdmf from KHI test (not needed)
  • Loading branch information
glesur authored Aug 22, 2023
1 parent 98556ae commit 5c6348f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 18 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ option(Idefix_WERROR "Treat compiler warnings as errors" OFF)
set(Idefix_CXX_FLAGS "" CACHE STRING "Additional compiler/linker flag")
set(Idefix_DEFS "definitions.hpp" CACHE FILEPATH "Problem definition header file")
set(Idefix_RECONSTRUCTION "Linear" CACHE STRING "Type of cell reconstruction scheme")
option(Idefix_HDF5 "Enable HDF5 I/O (requires HDF5 library)" OFF)
if(Idefix_MHD)
option(Idefix_EVOLVE_VECTOR_POTENTIAL "Evolve the vector potential instead of the field (helps reducing div(B) in long runs)" OFF)
endif()
Expand Down Expand Up @@ -80,13 +81,21 @@ if(Idefix_MPI)
add_compile_definitions("WITH_MPI")
find_package(MPI REQUIRED)
target_link_libraries(idefix MPI::MPI_CXX)
target_sources(idefix
PUBLIC src/mpi.cpp
PUBLIC src/mpi.hpp
)
endif()

if(Idefix_HDF5)
add_compile_definitions("WITH_HDF5")
if(Idefix_MPI)
set(HDF5_PREFER_PARALLEL TRUE)
endif()
target_sources(idefix
PUBLIC src/output/xdmf.cpp
PUBLIC src/output/xdmf.hpp
)
find_package(HDF5 REQUIRED)
target_link_libraries(idefix "${HDF5_LIBRARIES}")
target_include_directories(idefix PUBLIC "${HDF5_INCLUDE_DIRS}")
Expand Down
7 changes: 1 addition & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ target_sources(idefix
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/timeIntegrator.hpp
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/timeIntegrator.cpp
)
# NOTE: mpi file are added by the root CMakeLists along with dependencies to the MPI library

if(Idefix_MPI)
target_sources(idefix
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/mpi.cpp
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/mpi.hpp
)
endif()

#add_subdirectory("${PROJECT_BINARY_DIR}" "${PROJECT_BINARY_DIR}/local")
6 changes: 0 additions & 6 deletions src/output/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,3 @@ target_sources(idefix
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/vtk.cpp
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/vtk.hpp
)
if(Idefix_HDF5)
target_sources(idefix
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/xdmf.cpp
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/xdmf.hpp
)
endif()
3 changes: 1 addition & 2 deletions test/HD/KHI/idefix.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ X3-beg outflow
X3-end outflow

[Output]
vtk 0.01
xdmf 0.01
vtk 0.01
1 change: 1 addition & 0 deletions test/HD/SedovBlastWave/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable_idefix_property(Idefix_HDF5)
4 changes: 2 additions & 2 deletions test/HD/SedovBlastWave/idefix-unequal.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ X3-beg periodic
X3-end periodic

[Output]
vtk 0.05
xdmf 0.05
vtk 0.1
xdmf 0.1
4 changes: 2 additions & 2 deletions test/HD/SedovBlastWave/idefix.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ X3-beg periodic
X3-end periodic

[Output]
vtk 0.05
xdmf 0.05
vtk 0.1
xdmf 0.1

0 comments on commit 5c6348f

Please sign in to comment.