Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#373: Update kokkos and kokkos-kernels to version 4.4.01 #374

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ci/docker/ubuntu-18.04-clang-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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="" \
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/ubuntu-18.04-gnu-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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="" \
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/ubuntu-18.04-intel-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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="" \
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/ubuntu-20.04-gnu-docs.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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="" \
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/ubuntu-20.04-nvidia-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/ubuntu-22.04-clang-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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="" \
Expand Down
24 changes: 7 additions & 17 deletions src/checkpoint/container/view_serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,43 +45,33 @@
#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

#include <Kokkos_Core.hpp>
#include <Kokkos_DynamicView.hpp>
#include <Kokkos_DynRankView.hpp>

#if KOKKOS_VERSION > 30699L
#define CHECKPOINT_KOKKOS_WITHOUTINIT Kokkos::WithoutInitializing,
#else
#define CHECKPOINT_KOKKOS_WITHOUTINIT
#endif

#if MAGISTRATE_KOKKOS_KERNELS_ENABLED
#include <Kokkos_StaticCrsGraph.hpp>
#include <KokkosSparse_CrsMatrix.hpp>
#endif

#include <array>
#include <cassert>
#include <tuple>
#include <type_traits>
#include <utility>
#include <cstdio>
#include <tuple>
#include <type_traits>

#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 { \
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -282,7 +272,7 @@ inline void serialize_impl(SerializerT& s, Kokkos::DynRankView<T,Args...>& 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()) {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_kokkos_serialize_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
//@HEADER
*/

#include <Kokkos_Array.hpp>
#if MAGISTRATE_KOKKOS_ENABLED
#include <Kokkos_Array.hpp>

#include "test_commons.h"

Expand Down
29 changes: 18 additions & 11 deletions tests/unit/test_kokkos_serialize_integration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@
//@HEADER
*/
#if MAGISTRATE_KOKKOS_ENABLED

#include "test_harness.h"
#include "test_commons.h"
#include <Kokkos_Core.hpp>

#include "test_kokkos_integration_commons.h"

Expand Down Expand Up @@ -89,16 +87,25 @@ struct KokkosViewOfVIewTest : KokkosBaseTest { };

TEST_F(KokkosViewOfVIewTest, test_view_of_view_init_1) {
using namespace checkpoint;
using ViewType = Kokkos::View<Kokkos::View<double*>[3]>;
using Kokkos::view_alloc;
using InnerViewType = Kokkos::View<double*>;
using OuterViewType = Kokkos::View<InnerViewType*>;
constexpr int size_outer = 3;

// Default construct
ViewType test_data = Kokkos::View<Kokkos::View<double*>[3]>("test");
test_data(0) = Kokkos::View<double*>();
test_data(1) = Kokkos::View<double*>();
test_data(2) = Kokkos::View<double*>();

auto ret = serialize<ViewType>(test_data);
deserialize<ViewType>(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<OuterViewType>(test_data);
deserialize<OuterViewType>(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) {
Expand Down
Loading