Skip to content

Commit

Permalink
Merge pull request ornladios#4366 from anagainaru/kokkos-testing-fix
Browse files Browse the repository at this point in the history
Fix the Kokkos testing compilation error on Frontier
  • Loading branch information
anagainaru authored Oct 16, 2024
2 parents 90f96e3 + b17c40c commit a6e8314
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .gitlab/gitlab-ci-frontier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ stages:
PrgEnv-gnu
gcc-native/12
craype-accel-amd-gfx90a
rocm/5.4.3
rocm/5.7.1
cmake
git
ninja
Expand All @@ -111,10 +111,10 @@ stages:
setup:frontier-kokkos-hip:
variables:
KOKKOS_VER: 3.7.01
KOKKOS_VER: 4.4.01
KOKKOS_OPTS: >-
-DCMAKE_INSTALL_PREFIX:PATH=$Kokkos_DIR
-DCMAKE_CXX_COMPILER:FILEPATH=/opt/rocm-5.4.3/hip/bin/hipcc
-DCMAKE_CXX_COMPILER:FILEPATH=/opt/rocm-5.7.1/hip/bin/hipcc
-DKokkos_ARCH_VEGA90A:BOOL=ON
-DKokkos_ENABLE_HIP:BOOL=ON
-DKokkos_ENABLE_HIP_RELOCATABLE_DEVICE_CODE:BOOL=OFF
Expand Down
4 changes: 4 additions & 0 deletions testing/adios2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ endif()
if (ADIOS2_HAVE_Python)
add_subdirectory(python)
endif()

if(ADIOS2_HAVE_Kokkos)
add_subdirectory(gpu-backend)
endif()
10 changes: 0 additions & 10 deletions testing/adios2/engine/bp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,3 @@ gtest_add_tests_helper(StepsInSituGlobalArray MPI_ALLOW BP Engine.BP. .FileStrea
gtest_add_tests_helper(StepsInSituLocalArray MPI_ALLOW BP Engine.BP. .FileStream
WORKING_DIRECTORY ${FS_DIR} EXTRA_ARGS "FileStream"
)

if(ADIOS2_HAVE_Kokkos)
gtest_add_tests_helper(WriteReadKokkos MPI_ALLOW BP Engine.BP. .BP5
WORKING_DIRECTORY ${BP5_DIR} EXTRA_ARGS "BP5"
)

foreach(tgt ${Test.Engine.BP.WriteReadKokkos-TARGETS})
target_link_libraries(${tgt} Kokkos::kokkos)
endforeach()
endif()
17 changes: 17 additions & 0 deletions testing/adios2/gpu-backend/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ------------------------------------------------------------------------------#
# Distributed under the OSI-approved Apache License, Version 2.0. See
# accompanying file Copyright.txt for details.
# ------------------------------------------------------------------------------#
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(DEFINED Kokkos_CXX_COMPILER)
set(CMAKE_CXX_COMPILER "${Kokkos_CXX_COMPILER}")
endif()

gtest_add_tests_helper(WriteReadKokkos MPI_ALLOW BP Engine.BP. .BP5
WORKING_DIRECTORY ${BP5_DIR} EXTRA_ARGS "BP5"
)

foreach(tgt ${Test.Engine.BP.WriteReadKokkos-TARGETS})
target_link_libraries(${tgt} Kokkos::kokkos)
endforeach()
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,6 @@ bool compareSelection2D(
if (b(x, y) != a(start_0 + x, start_1 + y))
{
lmatch++;
Kokkos::printf(" Non-match at pos = (%d %d) : input = %f : output = %f\n", x, y,
a(start_0 + x, start_1 + y), b(x, y));
}
},
match);
Expand Down Expand Up @@ -520,6 +518,7 @@ int main(int argc, char **argv)
// MPI_THREAD_MULTIPLE is only required if you enable the SST MPI_DP
MPI_Init_thread(nullptr, nullptr, MPI_THREAD_MULTIPLE, &provided);
#endif
Kokkos::initialize(argc, argv);

int result;
::testing::InitGoogleTest(&argc, argv);
Expand All @@ -529,6 +528,7 @@ int main(int argc, char **argv)
}
result = RUN_ALL_TESTS();

Kokkos::finalize();
#if ADIOS2_USE_MPI
MPI_Finalize();
#endif
Expand Down

0 comments on commit a6e8314

Please sign in to comment.