Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding Adios2 io support #113

Merged
merged 20 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ bob_input(Kokkos_PREFIX "" PATH "Path to Kokkos install")
bob_option(Omega_h_USE_CUDA_AWARE_MPI "Assume MPI is CUDA-aware, make use of that" OFF)
bob_option(Omega_h_USE_SimModSuite "Enable reading Simmetrix MeshSim meshes" OFF)
bob_option(Omega_h_USE_SimDiscrete "Enable reading and creating Simmetrix Discrete models" OFF)
bob_option(Omega_h_USE_ADIOS2 "Enable ADIOS2" OFF)
bob_input(Omega_h_VALGRIND "" STRING "Valgrind plus arguments for testing")
bob_option(Omega_h_EXAMPLES "Compile examples" OFF)

Expand Down Expand Up @@ -163,6 +164,7 @@ set(Omega_h_KEY_BOOLS
Omega_h_USE_SEACASExodus
Omega_h_USE_SimModSuite
Omega_h_USE_SimDiscrete
Omega_h_USE_ADIOS2
Omega_h_USE_DOLFIN
Omega_h_USE_dwarf
Omega_h_CHECK_BOUNDS
Expand Down
29 changes: 29 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ if(Omega_h_USE_SimModSuite)
"${CMAKE_CURRENT_BINARY_DIR}/Omega_h_simConfig.h")
endif()

message(STATUS "Omega_h_USE_ADIOS2: ${Omega_h_USE_ADIOS2}")
if(Omega_h_USE_ADIOS2)
list(APPEND Omega_h_SOURCES Omega_h_adios2.cpp)
find_package(ADIOS2 REQUIRED)
endif()

if(Omega_h_USE_SEACASExodus)
set(Omega_h_SOURCES ${Omega_h_SOURCES} Omega_h_exodus.cpp)
endif()
Expand Down Expand Up @@ -226,6 +232,15 @@ if(Omega_h_USE_SimModSuite)
target_link_libraries(omega_h PUBLIC "${SIMMODSUITE_LIBS}")
endif()

if(Omega_h_USE_ADIOS2)
if (Omega_h_USE_MPI)
target_include_directories(omega_h PRIVATE "${ADIOS2_INCLUDE_DIRS}")
target_link_libraries(omega_h PUBLIC "${ADIOS2_LIBRARIES}")
Comment on lines +237 to +238
Copy link
Collaborator

Choose a reason for hiding this comment

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

@cwsmith @seegyoung should we be using the adios2 target here? Or, do we need to handle this with the library variables because of bob.cmake?

Copy link
Author

Choose a reason for hiding this comment

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

I think Cameron can answer this

target_link_libraries(omega_h PUBLIC MPI::MPI_CXX)
else()
message(FATAL_ERROR, "set Omega_h_USE_MPI to use ADIOS2")
endif()
endif()

bob_link_dependency(omega_h PUBLIC SEACASExodus)

Expand Down Expand Up @@ -629,6 +644,16 @@ if(BUILD_TESTING)
else()
test_func(describe_serial 1 ./describe ${CMAKE_SOURCE_DIR}/meshes/box_3d.osh)
endif()

if (Omega_h_USE_ADIOS2)
osh_add_util(bp2osh)
osh_add_util(osh2bp)
osh_add_exe(adios2_io)
test_basefunc(adios2_io 1 ./adios2_io
${CMAKE_SOURCE_DIR}/meshes/unitbox_cutTriCube_1k.osh
${CMAKE_SOURCE_DIR}/meshes/plate_6elem.osh
output.bp)
endif()
endif()

bob_config_header("${CMAKE_CURRENT_BINARY_DIR}/Omega_h_config.h")
Expand Down Expand Up @@ -744,6 +769,10 @@ else()
list(APPEND Omega_h_HEADERS Omega_h_array_default.hpp)
endif()

if(Omega_h_USE_ADIOS2)
list(APPEND Omega_h_HEADERS Omega_h_adios2.hpp)
endif()

install(FILES ${Omega_h_HEADERS} DESTINATION include)

if (Omega_h_USE_pybind11)
Expand Down
Loading