diff --git a/CODEOWNERS b/CODEOWNERS index ef9d75102a..2d2c4cd680 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,17 +1,25 @@ # KW's stuff -**/CMakeLists.txt @vicentebolea @caitlinross -*.cmake @vicentebolea @caitlinross +CMakeLists.txt @vicentebolea @caitlinross + +# Caitlin's stuff +plugins/ @caitlinross # Vicente's stuff -*.sh @vicentebolea *.bash @vicentebolea -*.in @vicentebolea -*.yml @vicentebolea -*.yaml @vicentebolea +*.cmake @vicentebolea *.in @vicentebolea *.json @vicentebolea +*.sh @vicentebolea *.txt @vicentebolea +*.yaml @vicentebolea +*.yml @vicentebolea +cmake/ @vicentebolea scripts/ @vicentebolea .github/ @vicentebolea .circleci/ @vicentebolea source/adios2/toolkit/sst/dp/mpi_dp.c @vicentebolea + +# GPU-aware specific files +source/adios2/helper/kokkos/ @anagainaru +source/adios2/helper/adiosCUDA.* @anagainaru +source/adios2/helper/adiosGPUFunctions.h @anagainaru diff --git a/cmake/DetectOptions.cmake b/cmake/DetectOptions.cmake index 9876538043..871ad0c42f 100644 --- a/cmake/DetectOptions.cmake +++ b/cmake/DetectOptions.cmake @@ -177,9 +177,9 @@ endif() # Kokkos if(ADIOS2_USE_Kokkos) if(ADIOS2_USE_Kokkos STREQUAL AUTO) - find_package(Kokkos 3.7...<4.0 QUIET) + find_package(Kokkos 3.7 QUIET) else() - find_package(Kokkos 3.7...<4.0 REQUIRED) + find_package(Kokkos 3.7 REQUIRED) endif() if(Kokkos_FOUND) set(ADIOS2_HAVE_Kokkos TRUE) diff --git a/source/adios2/CMakeLists.txt b/source/adios2/CMakeLists.txt index 77899e8ecc..f7f6643bf7 100644 --- a/source/adios2/CMakeLists.txt +++ b/source/adios2/CMakeLists.txt @@ -126,28 +126,14 @@ endif() set(maybe_adios2_core_kokkos) if(ADIOS2_HAVE_Kokkos) - add_library(adios2_core_kokkos helper/adiosKokkos.h helper/adiosKokkos.cpp) - - set_target_properties(adios2_core_kokkos PROPERTIES - VISIBILITY_INLINES_HIDDEN ON - INCLUDE_DIRECTORIES "$;$" - EXPORT_NAME core_kokkos - OUTPUT_NAME adios2${ADIOS2_LIBRARY_SUFFIX}_core_kokkos - ) - - kokkos_compilation(SOURCE helper/adiosKokkos.cpp) - if(Kokkos_ENABLE_CUDA) - set_property(SOURCE helper/adiosKokkos.cpp PROPERTY LANGUAGE CUDA) - set_property(SOURCE helper/adiosKokkos.cpp APPEND PROPERTY COMPILE_FLAGS "--extended-lambda") - set_target_properties(adios2_core_kokkos PROPERTIES - CUDA_VISIBILITY_PRESET hidden - ) - target_compile_features(adios2_core_kokkos PRIVATE cuda_std_17) - endif() - - target_link_libraries(adios2_core_kokkos PRIVATE Kokkos::kokkos) + # Kokkos imposes us to set our CMAKE_CXX_COMPILER to Kokkos_CXX_COMPILER. + # The problem is that we do not want this for the whole project and with + # CMake we cannot set the CXX_COMPILER for a single target. The solution is + # to move the adios2 module that uses Kokkos to its independent subdir and + # set there CMAKE_CXX_COMPILER, which is possible (and scoped to that subdir) + # in cmake. + add_subdirectory(helper/kokkos) target_link_libraries(adios2_core PRIVATE adios2_core_kokkos) - set(maybe_adios2_core_kokkos adios2_core_kokkos) endif() diff --git a/source/adios2/helper/adiosGPUFunctions.h b/source/adios2/helper/adiosGPUFunctions.h index 8069a41b1e..78a2f323a8 100644 --- a/source/adios2/helper/adiosGPUFunctions.h +++ b/source/adios2/helper/adiosGPUFunctions.h @@ -6,7 +6,7 @@ #endif #ifdef ADIOS2_HAVE_KOKKOS -#include "adios2/helper/adiosKokkos.h" +#include "adios2/helper/kokkos/adiosKokkos.h" #endif #endif /* ADIOS2_HELPER_ADIOSGPUFUNCTIONS_H_ */ diff --git a/source/adios2/helper/kokkos/CMakeLists.txt b/source/adios2/helper/kokkos/CMakeLists.txt new file mode 100644 index 0000000000..c37a3c9417 --- /dev/null +++ b/source/adios2/helper/kokkos/CMakeLists.txt @@ -0,0 +1,25 @@ +#------------------------------------------------------------------------------# +# Distributed under the OSI-approved Apache License, Version 2.0. See +# accompanying file Copyright.txt for details. +#------------------------------------------------------------------------------# + +if (NOT DEFINED Kokkos_CXX_COMPILER) + message(FATAL_ERROR "ADIOS: Kokkos module requires the Kokkos_CXX_COMPILER variable") +endif() + +# CXX Compiler settings only in for this subdir +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_COMPILER "${Kokkos_CXX_COMPILER}") + +add_library(adios2_core_kokkos adiosKokkos.h adiosKokkos.cpp) + +set_target_properties(adios2_core_kokkos PROPERTIES + VISIBILITY_INLINES_HIDDEN ON + INCLUDE_DIRECTORIES "$;$" + EXPORT_NAME core_kokkos + OUTPUT_NAME adios2${ADIOS2_LIBRARY_SUFFIX}_core_kokkos + ) + +kokkos_compilation(SOURCE adiosKokkos.cpp) +target_link_libraries(adios2_core_kokkos PRIVATE Kokkos::kokkos) diff --git a/source/adios2/helper/adiosKokkos.cpp b/source/adios2/helper/kokkos/adiosKokkos.cpp similarity index 100% rename from source/adios2/helper/adiosKokkos.cpp rename to source/adios2/helper/kokkos/adiosKokkos.cpp diff --git a/source/adios2/helper/adiosKokkos.h b/source/adios2/helper/kokkos/adiosKokkos.h similarity index 100% rename from source/adios2/helper/adiosKokkos.h rename to source/adios2/helper/kokkos/adiosKokkos.h