From 5cb41185f8170e51dd935e753556e68c113c4828 Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Thu, 26 Sep 2024 19:17:46 +0200 Subject: [PATCH 1/2] #373: Update kokkos and kokkos-kernels to version 4.4.01 --- ci/docker/ubuntu-18.04-clang-cpp.dockerfile | 4 ++-- ci/docker/ubuntu-18.04-gnu-cpp.dockerfile | 4 ++-- ci/docker/ubuntu-18.04-intel-cpp.dockerfile | 4 ++-- ci/docker/ubuntu-20.04-gnu-docs.dockerfile | 4 ++-- ci/docker/ubuntu-20.04-nvidia-cpp.dockerfile | 4 ++-- ci/docker/ubuntu-22.04-clang-cpp.dockerfile | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ci/docker/ubuntu-18.04-clang-cpp.dockerfile b/ci/docker/ubuntu-18.04-clang-cpp.dockerfile index c60293df..4c2847b3 100644 --- a/ci/docker/ubuntu-18.04-clang-cpp.dockerfile +++ b/ci/docker/ubuntu-18.04-clang-cpp.dockerfile @@ -52,11 +52,11 @@ RUN ./gtest.sh 1.8.1 /pkgs ENV GTEST_ROOT=/pkgs/gtest/install COPY ./ci/deps/kokkos.sh kokkos.sh -RUN ./kokkos.sh 4.1.00 /pkgs 0 +RUN ./kokkos.sh 4.4.01 /pkgs 0 ENV KOKKOS_ROOT=/pkgs/kokkos/install COPY ./ci/deps/kokkos-kernels.sh kokkos-kernels.sh -RUN ./kokkos-kernels.sh 4.1.00 /pkgs +RUN ./kokkos-kernels.sh 4.4.01 /pkgs ENV KOKKOS_KERNELS_ROOT=/pkgs/kokkos-kernels/install ENV MPI_EXTRA_FLAGS="" \ diff --git a/ci/docker/ubuntu-18.04-gnu-cpp.dockerfile b/ci/docker/ubuntu-18.04-gnu-cpp.dockerfile index 88df3ec3..5cef9244 100644 --- a/ci/docker/ubuntu-18.04-gnu-cpp.dockerfile +++ b/ci/docker/ubuntu-18.04-gnu-cpp.dockerfile @@ -56,11 +56,11 @@ RUN ./gtest.sh 1.8.1 /pkgs ENV GTEST_ROOT=/pkgs/gtest/install COPY ./ci/deps/kokkos.sh kokkos.sh -RUN ./kokkos.sh 4.1.00 /pkgs 1 +RUN ./kokkos.sh 4.4.01 /pkgs 1 ENV KOKKOS_ROOT=/pkgs/kokkos/install COPY ./ci/deps/kokkos-kernels.sh kokkos-kernels.sh -RUN ./kokkos-kernels.sh 4.1.00 /pkgs +RUN ./kokkos-kernels.sh 4.4.01 /pkgs ENV KOKKOS_KERNELS_ROOT=/pkgs/kokkos-kernels/install ENV MPI_EXTRA_FLAGS="" \ diff --git a/ci/docker/ubuntu-18.04-intel-cpp.dockerfile b/ci/docker/ubuntu-18.04-intel-cpp.dockerfile index 3a700350..43ca01b1 100644 --- a/ci/docker/ubuntu-18.04-intel-cpp.dockerfile +++ b/ci/docker/ubuntu-18.04-intel-cpp.dockerfile @@ -54,11 +54,11 @@ ENV CC=/opt/intel/install/bin/icc \ CXX=/opt/intel/install/bin/icpc COPY ./ci/deps/kokkos.sh kokkos.sh -RUN ./kokkos.sh 4.1.00 /pkgs 1 +RUN ./kokkos.sh 4.4.01 /pkgs 1 ENV KOKKOS_ROOT=/pkgs/kokkos/install COPY ./ci/deps/kokkos-kernels.sh kokkos-kernels.sh -RUN ./kokkos-kernels.sh 4.1.00 /pkgs +RUN ./kokkos-kernels.sh 4.4.01 /pkgs ENV KOKKOS_KERNELS_ROOT=/pkgs/kokkos-kernels/install ENV MPI_EXTRA_FLAGS="" \ diff --git a/ci/docker/ubuntu-20.04-gnu-docs.dockerfile b/ci/docker/ubuntu-20.04-gnu-docs.dockerfile index 76dc885d..66ea750d 100644 --- a/ci/docker/ubuntu-20.04-gnu-docs.dockerfile +++ b/ci/docker/ubuntu-20.04-gnu-docs.dockerfile @@ -46,11 +46,11 @@ RUN ./gtest.sh 1.8.1 /pkgs ENV GTEST_ROOT=/pkgs/gtest/install COPY ./ci/deps/kokkos.sh kokkos.sh -RUN ./kokkos.sh 4.1.00 /pkgs 1 +RUN ./kokkos.sh 4.4.01 /pkgs 1 ENV KOKKOS_ROOT=/pkgs/kokkos/install COPY ./ci/deps/kokkos-kernels.sh kokkos-kernels.sh -RUN ./kokkos-kernels.sh 4.1.00 /pkgs +RUN ./kokkos-kernels.sh 4.4.01 /pkgs ENV KOKKOS_KERNELS_ROOT=/pkgs/kokkos-kernels/install ENV MPI_EXTRA_FLAGS="" \ diff --git a/ci/docker/ubuntu-20.04-nvidia-cpp.dockerfile b/ci/docker/ubuntu-20.04-nvidia-cpp.dockerfile index fb99355c..a859ff48 100644 --- a/ci/docker/ubuntu-20.04-nvidia-cpp.dockerfile +++ b/ci/docker/ubuntu-20.04-nvidia-cpp.dockerfile @@ -47,7 +47,7 @@ RUN ./gtest.sh 1.12.1 /pkgs ENV GTEST_ROOT=/pkgs/gtest/install COPY ./ci/deps/kokkos.sh kokkos.sh -RUN ./kokkos.sh 4.1.00 /pkgs 0 +RUN ./kokkos.sh 4.4.01 /pkgs 0 ENV KOKKOS_ROOT=/pkgs/kokkos/install RUN mkdir -p /nvcc_wrapper/build && \ @@ -59,7 +59,7 @@ ENV MPI_EXTRA_FLAGS="" \ CXX=nvcc_wrapper COPY ./ci/deps/kokkos-kernels.sh kokkos-kernels.sh -RUN ./kokkos-kernels.sh 4.1.00 /pkgs +RUN ./kokkos-kernels.sh 4.4.01 /pkgs ENV KOKKOS_KERNELS_ROOT=/pkgs/kokkos-kernels/install FROM base as build diff --git a/ci/docker/ubuntu-22.04-clang-cpp.dockerfile b/ci/docker/ubuntu-22.04-clang-cpp.dockerfile index 0bbeb1b1..84846d2f 100644 --- a/ci/docker/ubuntu-22.04-clang-cpp.dockerfile +++ b/ci/docker/ubuntu-22.04-clang-cpp.dockerfile @@ -54,11 +54,11 @@ RUN ./gtest.sh 1.8.1 /pkgs ENV GTEST_ROOT=/pkgs/gtest/install COPY ./ci/deps/kokkos.sh kokkos.sh -RUN ./kokkos.sh 4.1.00 /pkgs 0 +RUN ./kokkos.sh 4.4.01 /pkgs 0 ENV KOKKOS_ROOT=/pkgs/kokkos/install COPY ./ci/deps/kokkos-kernels.sh kokkos-kernels.sh -RUN ./kokkos-kernels.sh 4.1.00 /pkgs +RUN ./kokkos-kernels.sh 4.4.01 /pkgs ENV KOKKOS_KERNELS_ROOT=/pkgs/kokkos-kernels/install ENV MPI_EXTRA_FLAGS="" \ From e0e8328dfcbc0fc2a0f6792db9ce50c7af407f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Thu, 24 Oct 2024 18:30:53 +0200 Subject: [PATCH 2/2] #373: update View of Views usage --- src/checkpoint/container/view_serialize.h | 24 +++++---------- tests/unit/test_kokkos_serialize_array.cc | 2 +- .../unit/test_kokkos_serialize_integration.cc | 29 ++++++++++++------- 3 files changed, 26 insertions(+), 29 deletions(-) diff --git a/src/checkpoint/container/view_serialize.h b/src/checkpoint/container/view_serialize.h index e4dfe742..0f62171b 100644 --- a/src/checkpoint/container/view_serialize.h +++ b/src/checkpoint/container/view_serialize.h @@ -45,10 +45,8 @@ #define INCLUDED_SRC_CHECKPOINT_CONTAINER_VIEW_SERIALIZE_H #include "checkpoint/common.h" -#include "checkpoint/serializers/serializers_headers.h" #include "checkpoint/container/view_traits_extract.h" #include "checkpoint/container/view_traverse_manual.h" -#include "checkpoint/container/view_traverse_ndim.h" #if MAGISTRATE_KOKKOS_ENABLED @@ -56,32 +54,24 @@ #include #include -#if KOKKOS_VERSION > 30699L -#define CHECKPOINT_KOKKOS_WITHOUTINIT Kokkos::WithoutInitializing, -#else -#define CHECKPOINT_KOKKOS_WITHOUTINIT -#endif - #if MAGISTRATE_KOKKOS_KERNELS_ENABLED #include #include #endif -#include #include -#include -#include -#include #include -#include #include -#define CHECKPOINT_DEBUG_ENABLED 0 - // I am shutting the n-dim traversal off by default for now, due to the extra // template complexity that needs to be tested more extensively on different // compiler versions #define CHECKPOINT_KOKKOS_NDIM_TRAVERSE 0 +#if CHECKPOINT_KOKKOS_NDIM_TRAVERSE +#include "checkpoint/container/view_traverse_ndim.h" +#endif + +#define CHECKPOINT_DEBUG_ENABLED 0 #if CHECKPOINT_DEBUG_ENABLED #define DEBUG_PRINT_CHECKPOINT(ser, str, ...) do { \ @@ -192,7 +182,7 @@ inline void serialize( // Kokkos::deep_copy between DynamicView instances is not yet implemented #if 0 - auto host_view = Kokkos::create_mirror_view(CHECKPOINT_KOKKOS_WITHOUTINIT view); + auto host_view = Kokkos::create_mirror_view(Kokkos::WithoutInitializing, view); if (s.isPacking()) { deepCopyWithLocalFence(host_view, view); } @@ -282,7 +272,7 @@ inline void serialize_impl(SerializerT& s, Kokkos::DynRankView& view) s | init; if (init) { - auto host_view = Kokkos::create_mirror_view(CHECKPOINT_KOKKOS_WITHOUTINIT view); + auto host_view = Kokkos::create_mirror_view(Kokkos::WithoutInitializing, view); using HostViewType = decltype(host_view); if (s.isPacking()) { diff --git a/tests/unit/test_kokkos_serialize_array.cc b/tests/unit/test_kokkos_serialize_array.cc index 78ebc01b..ba691858 100644 --- a/tests/unit/test_kokkos_serialize_array.cc +++ b/tests/unit/test_kokkos_serialize_array.cc @@ -41,8 +41,8 @@ //@HEADER */ -#include #if MAGISTRATE_KOKKOS_ENABLED +#include #include "test_commons.h" diff --git a/tests/unit/test_kokkos_serialize_integration.cc b/tests/unit/test_kokkos_serialize_integration.cc index 69dd3a4f..17810e5f 100644 --- a/tests/unit/test_kokkos_serialize_integration.cc +++ b/tests/unit/test_kokkos_serialize_integration.cc @@ -41,9 +41,7 @@ //@HEADER */ #if MAGISTRATE_KOKKOS_ENABLED - -#include "test_harness.h" -#include "test_commons.h" +#include #include "test_kokkos_integration_commons.h" @@ -89,16 +87,25 @@ struct KokkosViewOfVIewTest : KokkosBaseTest { }; TEST_F(KokkosViewOfVIewTest, test_view_of_view_init_1) { using namespace checkpoint; - using ViewType = Kokkos::View[3]>; + using Kokkos::view_alloc; + using InnerViewType = Kokkos::View; + using OuterViewType = Kokkos::View; + constexpr int size_outer = 3; // Default construct - ViewType test_data = Kokkos::View[3]>("test"); - test_data(0) = Kokkos::View(); - test_data(1) = Kokkos::View(); - test_data(2) = Kokkos::View(); - - auto ret = serialize(test_data); - deserialize(std::move(ret)); + OuterViewType test_data = OuterViewType( view_alloc("outer", Kokkos::WithoutInitializing), size_outer); + new (&test_data(0)) InnerViewType(view_alloc("inner-0", Kokkos::WithoutInitializing), 4); + new (&test_data(1)) InnerViewType(view_alloc("inner-1", Kokkos::WithoutInitializing), 4); + new (&test_data(2)) InnerViewType(view_alloc("inner-2", Kokkos::WithoutInitializing), 4); + + auto ret = serialize(test_data); + deserialize(std::move(ret)); + + Kokkos::fence(); + for (int i = 0; i < size_outer; i++) { + test_data(i).~InnerViewType(); + } + test_data = OuterViewType(); } TEST_F(KokkosViewOfVIewTest, test_view_of_view_init_2) {