Skip to content

Commit

Permalink
Overhaul the project (#82)
Browse files Browse the repository at this point in the history
* Modernize the use of AllocationRecord
* Add basic support for block transfers via local_deep_copy
* Replace use of std::pair in favor of Kokkos::pair
* Changes project name from KokkosRemote to KokkosRemoteSpaces
* Improve error handling when allocating
* Make range API use open end index
* Several minor changes throughout the code
---------

Co-authored-by: Brian Kelley <bmkelle@sandia.gov>
  • Loading branch information
janciesko and brian-kelley authored Sep 11, 2023
1 parent 86505cb commit 3594488
Show file tree
Hide file tree
Showing 79 changed files with 4,756 additions and 1,702 deletions.
2 changes: 1 addition & 1 deletion .jenkins/continuous.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pipeline {
-DKRS_ENABLE_TESTS=ON \
-DCMAKE_CXX_FLAGS=-Werror \
.. && \
make -j8 && cd unit_tests && mpirun -np 2 ./KokkosRemote_TestAll'''
make -j8 && cd unit_tests && mpirun -np 2 ./KokkosRemoteSpaces_TestAll'''
}
}
}
Expand Down
48 changes: 24 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.12)

project(KokkosRemote
project(KokkosRemoteSpaces
LANGUAGES CXX
VERSION 0.1.0)

Expand Down Expand Up @@ -108,76 +108,76 @@ if (KRS_ENABLE_RACERLIB)
list(APPEND HEADERS ${DIR_HDRS})
endif()

add_library(kokkosremote ${SOURCES} ${HEADERS})
add_library(Kokkos::kokkosremote ALIAS kokkosremote)
target_link_libraries(kokkosremote PUBLIC Kokkos::kokkos)
add_library(kokkosremotespaces ${SOURCES} ${HEADERS})
add_library(Kokkos::kokkosremotespaces ALIAS kokkosremotespaces)
target_link_libraries(kokkosremotespaces PUBLIC Kokkos::kokkos)

foreach(DIR ${SOURCE_DIRS})
target_include_directories(kokkosremote PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${DIR}>)
target_include_directories(kokkosremotespaces PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${DIR}>)
foreach(BACKEND_NAME ${PUBLIC_DEPS})
target_compile_definitions(kokkosremote PUBLIC KRS_ENABLE_${BACKEND_NAME})
target_compile_definitions(kokkosremotespaces PUBLIC KRS_ENABLE_${BACKEND_NAME})
endforeach()
endforeach()

if (KRS_ENABLE_RACERLIB)
target_include_directories(kokkosremote PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/features/racerlib>)
target_compile_definitions(kokkosremote PUBLIC KRS_ENABLE_RACERLIB)
target_include_directories(kokkosremotespaces PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/features/racerlib>)
target_compile_definitions(kokkosremotespaces PUBLIC KRS_ENABLE_RACERLIB)
endif()

target_include_directories(kokkosremote PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/core>)
target_include_directories(kokkosremote PUBLIC $<INSTALL_INTERFACE:include>)
target_include_directories(kokkosremotespaces PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/core>)
target_include_directories(kokkosremotespaces PUBLIC $<INSTALL_INTERFACE:include>)

if(KRS_ENABLE_DEBUG OR CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(kokkosremote PUBLIC KOKKOS_REMOTE_SPACES_ENABLE_DEBUG)
target_compile_definitions(kokkosremotespaces PUBLIC KOKKOS_REMOTE_SPACES_ENABLE_DEBUG)
message(STATUS "Enabled build mode: debug")
endif()

if (PRIVATE_DEPS)
target_link_libraries(kokkosremote PRIVATE ${PRIVATE_DEPS})
target_link_libraries(kokkosremotespaces PRIVATE ${PRIVATE_DEPS})
endif()
if (PUBLIC_DEPS)
target_link_libraries(kokkosremote PUBLIC ${PUBLIC_DEPS})
target_link_libraries(kokkosremotespaces PUBLIC ${PUBLIC_DEPS})
endif()

if (KRS_ENABLE_NVSHMEMSPACE)
target_link_libraries(kokkosremote PRIVATE "-lnvidia-ml")
target_link_libraries(kokkosremotespaces PRIVATE "-lnvidia-ml")
endif()

include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
configure_package_config_file(
KokkosRemoteConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/KokkosRemoteConfig.cmake"
KokkosRemoteSpacesConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/KokkosRemoteSpacesConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/KokkosRemoteConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KokkosRemoteSpacesConfigVersion.cmake"
VERSION "${KokkosRemote_VERSION}"
COMPATIBILITY AnyNewerVersion
)

install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KokkosRemoteConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KokkosRemoteConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/KokkosRemote)
"${CMAKE_CURRENT_BINARY_DIR}/KokkosRemoteSpacesConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KokkosRemoteSpacesConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/KokkosRemoteSpaces)

install(FILES
${HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(
TARGETS kokkosremote ${PUBLIC_DEPS}
EXPORT KokkosRemoteTargets
TARGETS kokkosremotespaces ${PUBLIC_DEPS}
EXPORT KokkosRemoteSpacesTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

install(EXPORT
KokkosRemoteTargets
KokkosRemoteSpacesTargets
NAMESPACE Kokkos::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/KokkosRemote
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/KokkosRemoteSpaces
)

IF (KRS_ENABLE_EXAMPLES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ set(Kokkos_DIR "@Kokkos_DIR@")
find_dependency(Kokkos REQUIRED)

GET_FILENAME_COMPONENT(Kokkos_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
INCLUDE("${Kokkos_CMAKE_DIR}/KokkosRemoteTargets.cmake")
INCLUDE("${Kokkos_CMAKE_DIR}/KokkosRemoteSpacesTargets.cmake")
UNSET(Kokkos_CMAKE_DIR)
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ find_package(KokkosRemote REQUIRED)
add_executable(MatVec matvec.cpp)
target_link_libraries(MatVec PRIVATE \
Kokkos::kokkoskernels Kokkos::kokkosremote)
Kokkos::kokkoskernels Kokkos::kokkosremotespaces)
```

This cmake build fike can be used as
Expand All @@ -119,5 +119,4 @@ cmake .. -DKokkosKernels_ROOT=$KokkosKernels_INSTALL_PATH -DKokkosRemote_ROOT=$K
*Note: Kokkos Remote Spaces is in an experimental development stage.*

### Contact
Jan Ciesko, Engineering Lead,
jciesko@sandia.gov
Jan Ciesko, jciesko@sandia.gov
2 changes: 1 addition & 1 deletion examples/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_subdirectory(poissonaccess)
add_subdirectory(misslatency)
add_subdirectory(randomaccess)
add_subdirectory(stream)
add_subdirectory(access_overhead)
7 changes: 7 additions & 0 deletions examples/benchmarks/access_overhead/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FILE(GLOB SRCS *.cpp)

foreach(file ${SRCS})
get_filename_component(test_name ${file} NAME_WE)
add_executable(${test_name} ${file})
target_link_libraries(${test_name} PRIVATE Kokkos::kokkosremotespaces)
endforeach()
Loading

0 comments on commit 3594488

Please sign in to comment.