Skip to content

Commit

Permalink
Embedded profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
tpadioleau committed Feb 29, 2024
1 parent 35e6e3c commit 1b11d00
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
[submodule "vendor/eigen"]
path = vendor/eigen
url = https://gitlab.com/libeigen/eigen.git
[submodule "vendor/kokkos-tools"]
path = vendor/kokkos-tools
url = https://github.com/kokkos/kokkos-tools.git
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ add_subdirectory("vendor/ddc/" "ddc")
## Use selalib's splines from `vendor/`
add_subdirectory("vendor/sll/" "sll")

## Use the kokkos-tools for profiling purpose from `vendor/`
include(vendor/kokkos-tools/cmake/utils.cmake)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/vendor/kokkos-tools/common ${CMAKE_CURRENT_SOURCE_DIR}/vendor/kokkos-tools/profiling/all)
configure_file(vendor/kokkos-tools/common/kp_config.hpp.in kokkos-tools/profiling/simple-kernel-timer/kp_config.hpp)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/kokkos-tools/profiling/simple-kernel-timer) # Weird trick to get access to kp_config.hpp
set(BUILD_SHARED_LIBS_DUMP "${BUILD_SHARED_LIBS}")
set(BUILD_SHARED_LIBS ON) #Needed to get libkp_kernel_timer.so
add_subdirectory("vendor/kokkos-tools/profiling/simple-kernel-timer/" "kokkos-tools/profiling/simple-kernel-timer")
set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_DUMP}")
add_compile_definitions(KP_KERNEL_TIMER_PATH="${CMAKE_CURRENT_BINARY_DIR}/kokkos-tools/profiling/simple-kernel-timer/libkp_kernel_timer.so")

# Our project code

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ namespace fs = std::filesystem;

int main(int argc, char** argv)
{
// Environments variables for profiling
setenv("KOKKOS_TOOLS_LIBS", KP_KERNEL_TIMER_PATH, false);
setenv("KOKKOS_TOOLS_TIMER_JSON", "true", false);

ddc::ScopeGuard scope(argc, argv);

long int iter_start(0);
Expand Down
4 changes: 4 additions & 0 deletions simulations/geometryXVx/bump_on_tail/bumpontail_fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ namespace fs = std::filesystem;

int main(int argc, char** argv)
{
// Environments variables for profiling
setenv("KOKKOS_TOOLS_LIBS", KP_KERNEL_TIMER_PATH, false);
setenv("KOKKOS_TOOLS_TIMER_JSON", "true", false);

ddc::ScopeGuard scope(argc, argv);

long int iter_start(0);
Expand Down
4 changes: 4 additions & 0 deletions simulations/geometryXVx/landau/landau_fem_uniform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ namespace fs = std::filesystem;

int main(int argc, char** argv)
{
// Environments variables for profiling
setenv("KOKKOS_TOOLS_LIBS", KP_KERNEL_TIMER_PATH, false);
setenv("KOKKOS_TOOLS_TIMER_JSON", "true", false);

ddc::ScopeGuard scope(argc, argv);

long int iter_start(0);
Expand Down
4 changes: 4 additions & 0 deletions simulations/geometryXVx/landau/landau_fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ namespace fs = std::filesystem;

int main(int argc, char** argv)
{
// Environments variables for profiling
setenv("KOKKOS_TOOLS_LIBS", KP_KERNEL_TIMER_PATH, false);
setenv("KOKKOS_TOOLS_TIMER_JSON", "true", false);

ddc::ScopeGuard scope(argc, argv);

long int iter_start(0);
Expand Down
4 changes: 4 additions & 0 deletions simulations/geometryXVx/sheath/sheath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ namespace fs = std::filesystem;

int main(int argc, char** argv)
{
// Environments variables for profiling
setenv("KOKKOS_TOOLS_LIBS", KP_KERNEL_TIMER_PATH, false);
setenv("KOKKOS_TOOLS_TIMER_JSON", "true", false);

ddc::ScopeGuard scope(argc, argv);

long int iter_start(0);
Expand Down
4 changes: 4 additions & 0 deletions simulations/geometryXYVxVy/landau/landau4d_fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ using BslAdvectionVy = BslAdvectionVelocity<GeometryXYVxVy, IDimVy>;

int main(int argc, char** argv)
{
// Environments variables for profiling
setenv("KOKKOS_TOOLS_LIBS", KP_KERNEL_TIMER_PATH, false);
setenv("KOKKOS_TOOLS_TIMER_JSON", "true", false);

ddc::ScopeGuard scope(argc, argv);

PC_tree_t conf_voicexx;
Expand Down
1 change: 1 addition & 0 deletions vendor/kokkos-tools
Submodule kokkos-tools added at f67e81

0 comments on commit 1b11d00

Please sign in to comment.