diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5adbbe4a2e..68350af8de 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -99,7 +99,7 @@ set( serialization/messaging serialization/traits serialization/auto_dispatch serialization/sizing utils/demangle utils/container utils/bits utils/mutex utils/file_spec - utils/hash utils/atomic utils/static_checks utils/string + utils/hash utils/atomic utils/static_checks utils/string utils/kokkos utils/memory utils/mpi_limits utils/compress utils/json utils/strong registry/auto registry/auto/functor registry/auto/map registry/auto/collection diff --git a/src/vt/collective/reduce/allreduce/allreduce_holder.cc b/src/vt/collective/reduce/allreduce/allreduce_holder.cc index 3da7b688ef..38cf2a71b4 100644 --- a/src/vt/collective/reduce/allreduce/allreduce_holder.cc +++ b/src/vt/collective/reduce/allreduce/allreduce_holder.cc @@ -1,3 +1,45 @@ +/* +//@HEADER +// ***************************************************************************** +// +// allreduce_holder.cc +// DARMA/vt => Virtual Transport +// +// Copyright 2019-2021 National Technology & Engineering Solutions of Sandia, LLC +// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. +// Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact darma@sandia.gov +// +// ***************************************************************************** +//@HEADER +*/ #include "allreduce_holder.h" #include "vt/objgroup/manager.h" diff --git a/src/vt/collective/reduce/allreduce/helpers.h b/src/vt/collective/reduce/allreduce/helpers.h index abb7dbeb2b..3c418fbc71 100644 --- a/src/vt/collective/reduce/allreduce/helpers.h +++ b/src/vt/collective/reduce/allreduce/helpers.h @@ -47,6 +47,8 @@ #include "data_handler.h" #include "rabenseifner_msg.h" #include "vt/messaging/message/shared_message.h" +#include "vt/utils/kokkos/exec_space.h" + #include namespace vt::collective::reduce::allreduce { @@ -61,6 +63,7 @@ template struct ShouldUseView> { static constexpr bool Value = true; }; + #endif // MAGISTRATE_KOKKOS_ENABLED template @@ -116,9 +119,10 @@ struct DataHelper { #if MAGISTRATE_KOKKOS_ENABLED -template -struct DataHelper> { - using DataT = Kokkos::View; +template +struct DataHelper> { + using DataT = Kokkos::View; + using ExecSpace = typename utils::kokkos::AssociatedExecSpace::type; using DataType = DataHandler; template @@ -136,8 +140,10 @@ struct DataHelper> { static void copy(DataT& dest, size_t start_idx, RabenseifnerMsg* msg) { + + Kokkos::RangePolicy policy(0, msg->val_.extent(0)); Kokkos::parallel_for( - "Rabenseifner::copy", msg->val_.extent(0), + "Rabenseifner::copy", policy, KOKKOS_LAMBDA(const int i) { dest(start_idx + i) = msg->val_(i); } ); } @@ -145,8 +151,10 @@ struct DataHelper> { template