Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
seegyoung committed Sep 9, 2024
1 parent 906c8bc commit dcdfe09
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 57 deletions.
42 changes: 11 additions & 31 deletions cmake/FindADIOS2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ string(REGEX REPLACE
set(MIN_VALID_ADIOS2_VERSION 2.10.0)
set(MAX_VALID_ADIOS2_VERSION 2.10.10)
#if( ${SKIP_ADIOS2_VERSION_CHECK} )
message(STATUS "Skipping ADIOS2 version check."
" This may result in undefined behavior")
# message(STATUS "Skipping ADIOS2 version check."
# " This may result in undefined behavior")
#elseif( (ADIOS2_DOT_VERSION VERSION_LESS MIN_VALID_ADIOS2_VERSION) OR
# (ADIOS2_DOT_VERSION VERSION_GREATER MAX_VALID_ADIOS2_VERSION) )
# MESSAGE(FATAL_ERROR
Expand All @@ -82,34 +82,15 @@ message(STATUS "Building with ADIOS2 ${ADIOS2_DOT_VERSION}")
set(ADIOS2_LIBS "")

if (Omega_h_USE_MPI)
set(ADIOS2_LIB_NAMES
adios2_core_mpi
adios2_evpath
adios2_hello_inlineMixedLang
adios2_atl
adios2_cxx11
adios2_ffs
adios2_plugins_exampleReadPlugin
adios2_c
adios2_cxx11_mpi
adios2_plugins_exampleWritePlugin
adios2_c_mpi
adios2_dill
adios2_core
adios2_enet
adios2_h5vol
set(ADIOS2_LIB_NAMES
adios2_core_mpi
adios2_cxx11_mpi
)
else()
set(ADIOS2_LIB_NAMES
adios2_atl
adios2_core
adios2_c
adios2_cxx11
adios2_dill
adios2_enet
adios2_evpath
adios2_ffs
)
set(ADIOS2_LIB_NAMES
adios2_core
adios2_cxx11
)
endif()

adios2LibCheck("${ADIOS2_LIB_NAMES}" TRUE)
Expand All @@ -118,7 +99,6 @@ adios2LibCheck("${ADIOS2_LIB_NAMES}" TRUE)
# if all listed variables are TRUE
find_package_handle_standard_args(ADIOS2 DEFAULT_MSG
ADIOS2_LIBS ADIOS2_INCLUDE_DIR
)
)

mark_as_advanced(ADIOS2_INCLUDE_DIR ADIOS2_LIBS
)
mark_as_advanced(ADIOS2_INCLUDE_DIR ADIOS2_LIBS)
38 changes: 20 additions & 18 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ set(Omega_h_SOURCES
Omega_h_fail.cpp
Omega_h_fence.cpp
Omega_h_file.cpp
Omega_h_adios2.cpp
Omega_h_filesystem.cpp
Omega_h_finite_automaton.cpp
Omega_h_fix.cpp
Expand Down Expand Up @@ -171,8 +170,9 @@ 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)
message(STATUS "Omega_h_USE_ADIOS2: ${Omega_h_USE_ADIOS2}")
list(APPEND Omega_h_SOURCES Omega_h_adios2.cpp)
#Is there a better way? I assume CMAKE_MODULE_PATH was purposely not set in
# the top level CMakeLists.txt
set(OLD_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
Expand Down Expand Up @@ -234,15 +234,14 @@ if(Omega_h_USE_SimModSuite)
endif()

if(Omega_h_USE_ADIOS2)
set(ADIOS_REQUIRED_VERSION 2.10)
if (Omega_h_USE_MPI)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DADIOS2_USE_MPI")
# message("CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}")
target_include_directories(omega_h PUBLIC "${ADIOS2_INCLUDE_DIR}")
target_link_libraries(omega_h PUBLIC "${ADIOS2_LIBS}")
else()
message("set Omega_h_USE_MPI to use ADIOS2")
endif()
set(ADIOS_REQUIRED_VERSION 2.10)
if (Omega_h_USE_MPI)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DADIOS2_USE_MPI")
target_include_directories(omega_h PUBLIC "${ADIOS2_INCLUDE_DIR}")
target_link_libraries(omega_h PUBLIC "${ADIOS2_LIBS}")
else()
message("set Omega_h_USE_MPI to use ADIOS2")
endif()
endif()

bob_link_dependency(omega_h PUBLIC SEACASExodus)
Expand Down Expand Up @@ -633,12 +632,12 @@ if(BUILD_TESTING)
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
output.bp)
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
output.bp)
endif()
endif()

Expand Down Expand Up @@ -673,7 +672,6 @@ set(Omega_h_HEADERS
Omega_h_fence.hpp
Omega_h_few.hpp
Omega_h_file.hpp
Omega_h_adios2.hpp
Omega_h_filesystem.hpp
Omega_h_finite_automaton.hpp
Omega_h_for.hpp
Expand Down Expand Up @@ -756,6 +754,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
8 changes: 0 additions & 8 deletions src/adios2_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,6 @@ int main(int argc, char *argv[])
cout<<"\n\n--- Mesh loaded back from \""<<outpath<<"\" ---\n";
print_info(&lib, mesh2);

Omega_h::Mesh mesh3(&lib);
Omega_h::binary::read("omegah.osh", world, &mesh3);
Omega_h::vtk::write_parallel("omegah_bk.vtk", &mesh3);

write_adios2("out2.bp", &mesh2);
Omega_h::Mesh mesh4 = read_adios2("out2.bp", &lib);
Omega_h::vtk::write_parallel("adios2_bk.vtk", &mesh4);

double tol = 1e-6, floor = 0.0;
bool allow_superset = false;
auto opts = MeshCompareOpts::init(
Expand Down

0 comments on commit dcdfe09

Please sign in to comment.