From 45aba1b65db12df0b7cf0989ad30006542501d87 Mon Sep 17 00:00:00 2001 From: Pierre Kestener Date: Wed, 27 May 2020 19:54:36 +0200 Subject: [PATCH] fix/update for building with kokkos 3.1, remove deprecated use of old Kokkos API --- src/mood/MoodBaseFunctor.h | 12 ++--- src/mood/MoodDtFunctor.h | 4 +- src/mood/MoodFluxesFunctors.h | 8 ++-- src/mood/MoodInitFunctors.h | 24 +++++----- .../MoodPolynomialReconstructionFunctors.h | 12 ++--- src/mood/MoodTestReconstruction.h | 4 +- src/mood/MoodUpdateFunctors.h | 16 +++---- src/shared/SolverBase.cpp | 40 ++++++++-------- src/shared/mpiBorderUtils.h | 48 +++++++++---------- src/utils/io/IO_HDF5.h | 12 ++--- src/utils/io/IO_PNETCDF.h | 4 +- src/utils/io/IO_VTK_SDM.h | 16 +++---- src/utils/io/IO_VTK_SDM_shared.cpp | 2 +- src/utils/io/IO_VTK_SDM_shared.h | 10 ++++ test/io/test_io_hdf5.cpp | 4 +- test/io/test_io_pnetcdf.cpp | 4 +- test/mood/test_mood_functor.cpp | 4 +- test/mood/test_mood_functor_flux.cpp | 12 ++--- test/mood/test_polynomial.cpp | 8 ++-- test/mood/test_print_monomial_map.cpp | 2 +- test/mood/test_reconstruct_2d.cpp | 4 +- test/mood/test_reconstruct_3d.cpp | 4 +- 22 files changed, 132 insertions(+), 122 deletions(-) diff --git a/src/mood/MoodBaseFunctor.h b/src/mood/MoodBaseFunctor.h index fe8f708..088031a 100644 --- a/src/mood/MoodBaseFunctor.h +++ b/src/mood/MoodBaseFunctor.h @@ -80,9 +80,9 @@ class MoodBaseFunctor : public PolynomialEvaluator */ template KOKKOS_INLINE_FUNCTION - void computePrimitives(const typename Kokkos::Impl::enable_if::type& u, + void computePrimitives(const typename std::enable_if::type& u, real_t* c, - typename Kokkos::Impl::enable_if::type& q) const + typename std::enable_if::type& q) const { real_t gamma0 = params.settings.gamma0; real_t smallr = params.settings.smallr; @@ -117,9 +117,9 @@ class MoodBaseFunctor : public PolynomialEvaluator */ template KOKKOS_INLINE_FUNCTION - void computePrimitives(const typename Kokkos::Impl::enable_if::type& u, + void computePrimitives(const typename std::enable_if::type& u, real_t* c, - typename Kokkos::Impl::enable_if::type& q) const + typename std::enable_if::type& q) const { real_t gamma0 = params.settings.gamma0; real_t smallr = params.settings.smallr; @@ -157,7 +157,7 @@ class MoodBaseFunctor : public PolynomialEvaluator */ template KOKKOS_INLINE_FUNCTION - int isValid(const typename Kokkos::Impl::enable_if::type& u) const + int isValid(const typename std::enable_if::type& u) const { int isValid_ = 1; @@ -189,7 +189,7 @@ class MoodBaseFunctor : public PolynomialEvaluator */ template KOKKOS_INLINE_FUNCTION - int isValid(const typename Kokkos::Impl::enable_if::type& u) const + int isValid(const typename std::enable_if::type& u) const { int isValid_ = 1; diff --git a/src/mood/MoodDtFunctor.h b/src/mood/MoodDtFunctor.h index 4690923..ec7737d 100644 --- a/src/mood/MoodDtFunctor.h +++ b/src/mood/MoodDtFunctor.h @@ -55,7 +55,7 @@ namespace mood { // template // KOKKOS_INLINE_FUNCTION // void operator()(const typename -// Kokkos::Impl::enable_if::type& index, +// std::enable_if::type& index, // real_t &invDt) const // { // const int isize = this->params.isize; @@ -97,7 +97,7 @@ namespace mood { // template // KOKKOS_INLINE_FUNCTION // void operator()(const typename -// Kokkos::Impl::enable_if::type& index, +// std::enable_if::type& index, // real_t &invDt) const // { // const int isize = this->params.isize; diff --git a/src/mood/MoodFluxesFunctors.h b/src/mood/MoodFluxesFunctors.h index 031fef0..0feb857 100644 --- a/src/mood/MoodFluxesFunctors.h +++ b/src/mood/MoodFluxesFunctors.h @@ -76,7 +76,7 @@ class ComputeFluxesFunctor : public MoodBaseFunctor //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -343,7 +343,7 @@ class ComputeFluxesFunctor : public MoodBaseFunctor /************* UNFINISHED - TODO ***************/ template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; const int jsize = this->params.jsize; @@ -789,7 +789,7 @@ class RecomputeFluxesFunctor : public MoodBaseFunctor //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -914,7 +914,7 @@ class RecomputeFluxesFunctor : public MoodBaseFunctor //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; diff --git a/src/mood/MoodInitFunctors.h b/src/mood/MoodInitFunctors.h index f2dc4b7..f6c4bab 100644 --- a/src/mood/MoodInitFunctors.h +++ b/src/mood/MoodInitFunctors.h @@ -50,7 +50,7 @@ class InitImplodeFunctor : public MoodBaseFunctor //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -92,7 +92,7 @@ class InitImplodeFunctor : public MoodBaseFunctor //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -167,7 +167,7 @@ class InitBlastFunctor : public MoodBaseFunctor //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -221,7 +221,7 @@ class InitBlastFunctor : public MoodBaseFunctor //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -320,7 +320,7 @@ class InitFourQuadrantFunctor : public MoodBaseFunctor //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -376,7 +376,7 @@ class InitFourQuadrantFunctor : public MoodBaseFunctor //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -476,7 +476,7 @@ class InitKelvinHelmholtzFunctor : public MoodBaseFunctor //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { // get random number state @@ -572,7 +572,7 @@ class InitKelvinHelmholtzFunctor : public MoodBaseFunctor //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { // get random number generator state @@ -720,7 +720,7 @@ class InitWedgeFunctor : public MoodBaseFunctor //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -767,7 +767,7 @@ class InitWedgeFunctor : public MoodBaseFunctor //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -1057,7 +1057,7 @@ class InitIsentropicVortexFunctor : public MoodBaseFunctor //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -1094,7 +1094,7 @@ class InitIsentropicVortexFunctor : public MoodBaseFunctor //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; diff --git a/src/mood/MoodPolynomialReconstructionFunctors.h b/src/mood/MoodPolynomialReconstructionFunctors.h index 55e5fd7..1a598ec 100644 --- a/src/mood/MoodPolynomialReconstructionFunctors.h +++ b/src/mood/MoodPolynomialReconstructionFunctors.h @@ -81,7 +81,7 @@ class ComputeReconstructionPolynomialFunctor : public MoodBaseFunctor KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -118,9 +118,9 @@ class ComputeReconstructionPolynomialFunctor : public MoodBaseFunctor KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; const int jsize = this->params.jsize; @@ -179,9 +179,9 @@ class ComputeReconstructionPolynomialFunctor : public MoodBaseFunctor //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -209,7 +209,7 @@ class TestReconstructionFunctor : public MoodBaseFunctor /************* UNFINISHED - TODO ***************/ template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { } // end functor 3d diff --git a/src/mood/MoodUpdateFunctors.h b/src/mood/MoodUpdateFunctors.h index 88c0e00..cb085b1 100644 --- a/src/mood/MoodUpdateFunctors.h +++ b/src/mood/MoodUpdateFunctors.h @@ -45,7 +45,7 @@ class UpdateFunctor //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = params.isize; const int jsize = params.jsize; @@ -96,7 +96,7 @@ class UpdateFunctor //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = params.isize; const int jsize = params.jsize; @@ -211,7 +211,7 @@ class UpdateFunctor_ssprk2 //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = params.isize; const int jsize = params.jsize; @@ -262,7 +262,7 @@ class UpdateFunctor_ssprk2 //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = params.isize; const int jsize = params.jsize; @@ -384,7 +384,7 @@ class UpdateFunctor_weight //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = params.isize; const int jsize = params.jsize; @@ -436,7 +436,7 @@ class UpdateFunctor_weight //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = params.isize; const int jsize = params.jsize; @@ -555,7 +555,7 @@ class ComputeMoodFlagsUpdateFunctor : public MoodBaseFunctor //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; const int jsize = this->params.jsize; @@ -626,7 +626,7 @@ class ComputeMoodFlagsUpdateFunctor : public MoodBaseFunctor //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; diff --git a/src/shared/SolverBase.cpp b/src/shared/SolverBase.cpp index 3387f67..39bda12 100644 --- a/src/shared/SolverBase.cpp +++ b/src/shared/SolverBase.cpp @@ -760,33 +760,33 @@ SolverBase::transfert_boundaries_2d(Direction dir) if (dir == XDIR) { - params.communicator->sendrecv(borderBufSend_xmin_2d.ptr_on_device(), + params.communicator->sendrecv(borderBufSend_xmin_2d.data(), borderBufSend_xmin_2d.size(), data_type, params.neighborsRank[X_MIN], 111, - borderBufRecv_xmax_2d.ptr_on_device(), + borderBufRecv_xmax_2d.data(), borderBufRecv_xmax_2d.size(), data_type, params.neighborsRank[X_MAX], 111); - params.communicator->sendrecv(borderBufSend_xmax_2d.ptr_on_device(), + params.communicator->sendrecv(borderBufSend_xmax_2d.data(), borderBufSend_xmax_2d.size(), data_type, params.neighborsRank[X_MAX], 111, - borderBufRecv_xmin_2d.ptr_on_device(), + borderBufRecv_xmin_2d.data(), borderBufRecv_xmin_2d.size(), data_type, params.neighborsRank[X_MIN], 111); } else if (dir == YDIR) { - params.communicator->sendrecv(borderBufSend_ymin_2d.ptr_on_device(), + params.communicator->sendrecv(borderBufSend_ymin_2d.data(), borderBufSend_ymin_2d.size(), data_type, params.neighborsRank[Y_MIN], 211, - borderBufRecv_ymax_2d.ptr_on_device(), + borderBufRecv_ymax_2d.data(), borderBufRecv_ymax_2d.size(), data_type, params.neighborsRank[Y_MAX], 211); - params.communicator->sendrecv(borderBufSend_ymax_2d.ptr_on_device(), + params.communicator->sendrecv(borderBufSend_ymax_2d.data(), borderBufSend_ymax_2d.size(), data_type, params.neighborsRank[Y_MAX], 211, - borderBufRecv_ymin_2d.ptr_on_device(), + borderBufRecv_ymin_2d.data(), borderBufRecv_ymin_2d.size(), data_type, params.neighborsRank[Y_MIN], 211); } @@ -805,49 +805,49 @@ SolverBase::transfert_boundaries_3d(Direction dir) if (dir == XDIR) { - params.communicator->sendrecv(borderBufSend_xmin_3d.ptr_on_device(), + params.communicator->sendrecv(borderBufSend_xmin_3d.data(), borderBufSend_xmin_3d.size(), data_type, params.neighborsRank[X_MIN], 111, - borderBufRecv_xmax_3d.ptr_on_device(), + borderBufRecv_xmax_3d.data(), borderBufRecv_xmax_3d.size(), data_type, params.neighborsRank[X_MAX], 111); - params.communicator->sendrecv(borderBufSend_xmax_3d.ptr_on_device(), + params.communicator->sendrecv(borderBufSend_xmax_3d.data(), borderBufSend_xmax_3d.size(), data_type, params.neighborsRank[X_MAX], 111, - borderBufRecv_xmin_3d.ptr_on_device(), + borderBufRecv_xmin_3d.data(), borderBufRecv_xmin_3d.size(), data_type, params.neighborsRank[X_MIN], 111); } else if (dir == YDIR) { - params.communicator->sendrecv(borderBufSend_ymin_3d.ptr_on_device(), + params.communicator->sendrecv(borderBufSend_ymin_3d.data(), borderBufSend_ymin_3d.size(), data_type, params.neighborsRank[Y_MIN], 211, - borderBufRecv_ymax_3d.ptr_on_device(), + borderBufRecv_ymax_3d.data(), borderBufRecv_ymax_3d.size(), data_type, params.neighborsRank[Y_MAX], 211); - params.communicator->sendrecv(borderBufSend_ymax_3d.ptr_on_device(), + params.communicator->sendrecv(borderBufSend_ymax_3d.data(), borderBufSend_ymax_3d.size(), data_type, params.neighborsRank[Y_MAX], 211, - borderBufRecv_ymin_3d.ptr_on_device(), + borderBufRecv_ymin_3d.data(), borderBufRecv_ymin_3d.size(), data_type, params.neighborsRank[Y_MIN], 211); } else if (dir == ZDIR) { - params.communicator->sendrecv(borderBufSend_zmin_3d.ptr_on_device(), + params.communicator->sendrecv(borderBufSend_zmin_3d.data(), borderBufSend_zmin_3d.size(), data_type, params.neighborsRank[Z_MIN], 311, - borderBufRecv_zmax_3d.ptr_on_device(), + borderBufRecv_zmax_3d.data(), borderBufRecv_zmax_3d.size(), data_type, params.neighborsRank[Z_MAX], 311); - params.communicator->sendrecv(borderBufSend_zmax_3d.ptr_on_device(), + params.communicator->sendrecv(borderBufSend_zmax_3d.data(), borderBufSend_zmax_3d.size(), data_type, params.neighborsRank[Z_MAX], 311, - borderBufRecv_zmin_3d.ptr_on_device(), + borderBufRecv_zmin_3d.data(), borderBufRecv_zmin_3d.size(), data_type, params.neighborsRank[Z_MIN], 311); diff --git a/src/shared/mpiBorderUtils.h b/src/shared/mpiBorderUtils.h index 6b1be9b..cde122e 100644 --- a/src/shared/mpiBorderUtils.h +++ b/src/shared/mpiBorderUtils.h @@ -63,9 +63,9 @@ class CopyBorderBuf_To_DataArray { void operator()(const typename std::enable_if::type& index) const { - const int isize = U.dimension_0(); - const int jsize = U.dimension_1(); - const int nbvar = U.dimension_2(); + const int isize = U.extent(0); + const int jsize = U.extent(1); + const int nbvar = U.extent(2); int i,j; /* @@ -73,9 +73,9 @@ class CopyBorderBuf_To_DataArray { */ int offset = 0; if (boundaryLoc == XMAX) - offset = U.dimension_0()-ghostWidth; + offset = U.extent(0)-ghostWidth; if (boundaryLoc == YMAX) - offset = U.dimension_1()-ghostWidth; + offset = U.extent(1)-ghostWidth; if (boundaryLoc == XMIN or boundaryLoc == XMAX) { @@ -104,10 +104,10 @@ class CopyBorderBuf_To_DataArray { void operator()(const typename std::enable_if::type& index) const { - const int isize = U.dimension_0(); - const int jsize = U.dimension_1(); - const int ksize = U.dimension_2(); - const int nbvar = U.dimension_3(); + const int isize = U.extent(0); + const int jsize = U.extent(1); + const int ksize = U.extent(2); + const int nbvar = U.extent(3); int i,j,k; /* @@ -115,11 +115,11 @@ class CopyBorderBuf_To_DataArray { */ int offset = 0; if (boundaryLoc == XMAX) - offset = U.dimension_0()-ghostWidth; + offset = U.extent(0)-ghostWidth; if (boundaryLoc == YMAX) - offset = U.dimension_1()-ghostWidth; + offset = U.extent(1)-ghostWidth; if (boundaryLoc == ZMAX) - offset = U.dimension_2()-ghostWidth; + offset = U.extent(2)-ghostWidth; if (boundaryLoc == XMIN or boundaryLoc == XMAX) { @@ -204,9 +204,9 @@ class CopyDataArray_To_BorderBuf { void operator()(const typename std::enable_if::type& index) const { - const int isize = U.dimension_0(); - const int jsize = U.dimension_1(); - const int nbvar = U.dimension_2(); + const int isize = U.extent(0); + const int jsize = U.extent(1); + const int nbvar = U.extent(2); int i,j; /* @@ -214,9 +214,9 @@ class CopyDataArray_To_BorderBuf { */ int offset = ghostWidth; if (boundaryLoc == XMAX) - offset = U.dimension_0()-2*ghostWidth; + offset = U.extent(0)-2*ghostWidth; if (boundaryLoc == YMAX) - offset = U.dimension_1()-2*ghostWidth; + offset = U.extent(1)-2*ghostWidth; /* * simple copy when PERIODIC or COPY @@ -250,10 +250,10 @@ class CopyDataArray_To_BorderBuf { void operator()(const typename std::enable_if::type& index) const { - const int isize = U.dimension_0(); - const int jsize = U.dimension_1(); - const int ksize = U.dimension_2(); - const int nbvar = U.dimension_3(); + const int isize = U.extent(0); + const int jsize = U.extent(1); + const int ksize = U.extent(2); + const int nbvar = U.extent(3); const int gw = ghostWidth; int i,j,k; @@ -272,11 +272,11 @@ class CopyDataArray_To_BorderBuf { */ int offset = ghostWidth; if (boundaryLoc == XMAX) - offset = U.dimension_0()-2*ghostWidth; + offset = U.extent(0)-2*ghostWidth; if (boundaryLoc == YMAX) - offset = U.dimension_1()-2*ghostWidth; + offset = U.extent(1)-2*ghostWidth; if (boundaryLoc == ZMAX) - offset = U.dimension_2()-2*ghostWidth; + offset = U.extent(2)-2*ghostWidth; /* diff --git a/src/utils/io/IO_HDF5.h b/src/utils/io/IO_HDF5.h index b7be03b..367bb9c 100644 --- a/src/utils/io/IO_HDF5.h +++ b/src/utils/io/IO_HDF5.h @@ -102,7 +102,7 @@ class Save_HDF5 } } } else { - data = Uhost.ptr_on_device() + isize*jsize*nvar; + data = Uhost.data() + isize*jsize*nvar; } } // copy_buffer @@ -125,7 +125,7 @@ class Save_HDF5 } } else { - data = Uhost.ptr_on_device() + isize*jsize*ksize*nvar; + data = Uhost.data() + isize*jsize*ksize*nvar; } } // copy_buffer / 3D @@ -527,7 +527,7 @@ class Save_HDF5_mpi } } } else { - data = Uhost.ptr_on_device() + isize*jsize*nvar; + data = Uhost.data() + isize*jsize*nvar; } } // copy_buffer @@ -550,7 +550,7 @@ class Save_HDF5_mpi } } else { - data = Uhost.ptr_on_device() + isize*jsize*ksize*nvar; + data = Uhost.data() + isize*jsize*ksize*nvar; } } // copy_buffer / 3D @@ -1448,7 +1448,7 @@ class Load_HDF5 } } else { // simple copy - real_t* tmp = Uhost.ptr_on_device() + isize*jsize*nvar; + real_t* tmp = Uhost.data() + isize*jsize*nvar; memcpy(tmp,data,isize*jsize*sizeof(real_t)); } } @@ -1538,7 +1538,7 @@ class Load_HDF5 } else { // simple copy - real_t* tmp = Uhost.ptr_on_device() + isize*jsize*ksize*nvar; + real_t* tmp = Uhost.data() + isize*jsize*ksize*nvar; memcpy(tmp,data,isize*jsize*ksize*sizeof(real_t)); } diff --git a/src/utils/io/IO_PNETCDF.h b/src/utils/io/IO_PNETCDF.h index beeed6b..0a59c6c 100644 --- a/src/utils/io/IO_PNETCDF.h +++ b/src/utils/io/IO_PNETCDF.h @@ -71,7 +71,7 @@ class Save_PNETCDF } } } else { - //data = Uhost.ptr_on_device() + isize*jsize*nvar; + //data = Uhost.data() + isize*jsize*nvar; int dI=0; for(int i = 0; i < iStop; i++) { for (int j= 0; j < jStop; j++) { @@ -97,7 +97,7 @@ class Save_PNETCDF dI++; } } else { - //data = Uhost.ptr_on_device() + isize*jsize*ksize*nvar; + //data = Uhost.data() + isize*jsize*ksize*nvar; int dI=0; for(int i = 0; i < iStop; i++) for (int j= 0; j < jStop; j++) diff --git a/src/utils/io/IO_VTK_SDM.h b/src/utils/io/IO_VTK_SDM.h index 9dd5fe7..a4b4588 100644 --- a/src/utils/io/IO_VTK_SDM.h +++ b/src/utils/io/IO_VTK_SDM.h @@ -1168,14 +1168,14 @@ void write_appended_binary_data(std::ostream& outFile, * rather than cells. * */ -void write_pvtu_header(std::string headerFilename, - std::string outputPrefix, - HydroParams& params, - ConfigMap& configMap, - int nbvar, - const std::map& varNames, - int iStep, - bool is_flux_data_array = false); +// void write_pvtu_header(std::string headerFilename, +// std::string outputPrefix, +// HydroParams& params, +// ConfigMap& configMap, +// int nbvar, +// const std::map& varNames, +// int iStep, +// bool is_flux_data_array = false); #endif // USE_MPI // ================================================================ diff --git a/src/utils/io/IO_VTK_SDM_shared.cpp b/src/utils/io/IO_VTK_SDM_shared.cpp index 54dfb53..88dd334 100644 --- a/src/utils/io/IO_VTK_SDM_shared.cpp +++ b/src/utils/io/IO_VTK_SDM_shared.cpp @@ -95,7 +95,7 @@ void write_pvtu_header(std::string headerFilename, int nbvar, const std::map& varNames, int iStep, - bool is_flux_data_array = false) + bool is_flux_data_array /*= false */) { // file handler std::fstream outHeader; diff --git a/src/utils/io/IO_VTK_SDM_shared.h b/src/utils/io/IO_VTK_SDM_shared.h index 00358cc..7e5e729 100644 --- a/src/utils/io/IO_VTK_SDM_shared.h +++ b/src/utils/io/IO_VTK_SDM_shared.h @@ -26,6 +26,16 @@ void write_vtk_metadata(std::ostream& outFile, */ void write_vtu_footer(std::ostream& outFile); +void write_pvtu_header(std::string headerFilename, + std::string outputPrefix, + HydroParams& params, + ConfigMap& configMap, + int nbvar, + const std::map& varNames, + int iStep, + bool is_flux_data_array = false); + + } // namespace io } // namespace ppkMHD diff --git a/test/io/test_io_hdf5.cpp b/test/io/test_io_hdf5.cpp index d9cba62..82ed5d8 100644 --- a/test/io/test_io_hdf5.cpp +++ b/test/io/test_io_hdf5.cpp @@ -41,7 +41,7 @@ class InitData //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = params.isize; const int jsize = params.jsize; @@ -79,7 +79,7 @@ class InitData //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = params.isize; const int jsize = params.jsize; diff --git a/test/io/test_io_pnetcdf.cpp b/test/io/test_io_pnetcdf.cpp index b096109..5581c86 100644 --- a/test/io/test_io_pnetcdf.cpp +++ b/test/io/test_io_pnetcdf.cpp @@ -39,7 +39,7 @@ class InitData //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = params.isize; const int jsize = params.jsize; @@ -72,7 +72,7 @@ class InitData //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = params.isize; const int jsize = params.jsize; diff --git a/test/mood/test_mood_functor.cpp b/test/mood/test_mood_functor.cpp index e978cc8..1442a0d 100644 --- a/test/mood/test_mood_functor.cpp +++ b/test/mood/test_mood_functor.cpp @@ -64,7 +64,7 @@ class TestMoodFunctor : public mood::MoodBaseFunctor //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& i) const + void operator()(const typename std::enable_if::type& i) const { #ifndef CUDA printf("2D functor\n"); @@ -74,7 +74,7 @@ class TestMoodFunctor : public mood::MoodBaseFunctor //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& i) const + void operator()(const typename std::enable_if::type& i) const { #ifndef CUDA printf("3D functor\n"); diff --git a/test/mood/test_mood_functor_flux.cpp b/test/mood/test_mood_functor_flux.cpp index 38182f1..98224ae 100644 --- a/test/mood/test_mood_functor_flux.cpp +++ b/test/mood/test_mood_functor_flux.cpp @@ -85,7 +85,7 @@ class TestFunctor : public MoodBaseFunctor //! functor for 2d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; @@ -122,9 +122,9 @@ class TestFunctor : public MoodBaseFunctor // retrieve reconstruction polynomial coefficients in current cell coefs_t coefs_c; coefs_c[0] = Udata(i,j,ID); - for (int icoef=0; icoef //! functor for 3d template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& index) const + void operator()(const typename std::enable_if::type& index) const { const int isize = this->params.isize; const int jsize = this->params.jsize; @@ -183,9 +183,9 @@ class TestFunctor : public MoodBaseFunctor // retrieve reconstruction polynomial coefficients in current cell coefs_t coefs_c; coefs_c[0] = Udata(i,j,k,ID); - for (int icoef=0; icoef KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& i) const + void operator()(const typename std::enable_if::type& i) const { coefs_t coefs; @@ -99,7 +99,7 @@ class TestPolynomialFunctor { template KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::Impl::enable_if::type& i) const + void operator()(const typename std::enable_if::type& i) const { coefs_t coefs; diff --git a/test/mood/test_print_monomial_map.cpp b/test/mood/test_print_monomial_map.cpp index 4dc5e67..b200f1c 100644 --- a/test/mood/test_print_monomial_map.cpp +++ b/test/mood/test_print_monomial_map.cpp @@ -35,7 +35,7 @@ class TestMonomialMapFunctor { void operator()(const int& i) const { - for (int icoef = 0; icoef < monomialMap.dimension_0(); ++icoef) { + for (int icoef = 0; icoef < monomialMap.extent(0); ++icoef) { results(icoef, 0) = monomialMap(icoef,0); results(icoef, 1) = monomialMap(icoef,1); results(icoef, 2) = monomialMap(icoef,2); diff --git a/test/mood/test_reconstruct_2d.cpp b/test/mood/test_reconstruct_2d.cpp index 9baa010..dd4a934 100644 --- a/test/mood/test_reconstruct_2d.cpp +++ b/test/mood/test_reconstruct_2d.cpp @@ -162,9 +162,9 @@ class TestReconstructFunctor : public mood::PolynomialEvaluator { // we will obtain the least-square polynomial solution. coefs_t coefs; coefs[0] = this->test_function_2d_(0,0); - for (int ii=0; ii { // we will obtain the least-square polynomial solution. coefs_t coefs; coefs[0] = this->test_function_3d_(0,0,0); - for (int ii=0; ii