Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [[PR 1162]](https://github.com/parthenon-hpc-lab/parthenon/pull/1162) Add dev container (e.g., GitHub Codepsacer or VSCode)

### Changed (changing behavior/API/variables/...)
- [[PR 1351]](https://github.com/parthenon-hpc-lab/parthenon/pull/1351) Bump Kokkos 5 & C++20
- [[PR 1323]](https://github.com/parthenon-hpc-lab/parthenon/pull/1323) Added per-block `sparse_dealloc` functionality outside of tasking to new `sparse/sparse_management` header.
- [[PR 1311]](https://github.com/parthenon-hpc-lab/parthenon/pull/1311) Refinement criteria no longer need to be a contiguous index range in the input deck
- [[PR 1305]](https://github.com/parthenon-hpc-lab/parthenon/pull/1305) Minor tweaks and quality of life improvements to python package and some debugging output options
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ if (ENABLE_COMPILER_WARNINGS)
endif()

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)

if (NOT TARGET Kokkos::kokkos)
if (PARTHENON_IMPORT_KOKKOS)
Expand Down
4 changes: 2 additions & 2 deletions example/poisson_gmg/poisson_equation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class PoissonEquation {

template <parthenon::CoordinateDirection dir, class coords_t>
KOKKOS_INLINE_FUNCTION auto GetEffectiveInverseDx2(const coords_t &coords, const int k,
const int j, const int i) {
const int j, const int i) const {
using TE = parthenon::TopologicalElement;
constexpr TE te = dir == X1DIR ? TE::F1 : (dir == X2DIR ? TE::F2 : TE::F3);
constexpr int ioff = (dir == X1DIR);
Expand Down Expand Up @@ -117,7 +117,7 @@ class PoissonEquation {
using TE = parthenon::TopologicalElement;
parthenon::par_for(
"StoreDiagonal", 0, pack_mat.GetNBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e,
KOKKOS_LAMBDA(const int b, const int k, const int j, const int i) {
KOKKOS_CLASS_LAMBDA(const int b, const int k, const int j, const int i) {
const auto &coords = pack_mat.GetCoordinates(b);
// Build the unigrid diagonal of the matrix
Real diag_elem = -alpha;
Expand Down
2 changes: 1 addition & 1 deletion external/Kokkos
Submodule Kokkos updated 1443 files
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ add_library(Parthenon::parthenon ALIAS parthenon)

set_target_properties(parthenon PROPERTIES SOVERSION ${parthenon_VERSION})

target_compile_features(parthenon PUBLIC cxx_std_17)
target_compile_features(parthenon PUBLIC cxx_std_20)

# This will automatically link any extra libraries (or no extra libraries)
# depending on the compiler, so it doesn't require an if() statement
Expand Down
4 changes: 2 additions & 2 deletions src/bvals/comms/bnd_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ int GetBufferSize(const MeshBlock *const pmb, const NeighborBlock &nb,
std::shared_ptr<Variable<Real>> v);

using BndInfoArr_t = ParArray1DRaw<BndInfo>;
using BndInfoArrHost_t = typename BndInfoArr_t::HostMirror;
using BndInfoArrHost_t = typename BndInfoArr_t::host_mirror_type;

using ProResInfoArr_t = ParArray1DRaw<ProResInfo>;
using ProResInfoArrHost_t = typename ProResInfoArr_t::HostMirror;
using ProResInfoArrHost_t = typename ProResInfoArr_t::host_mirror_type;
class StateDescriptor;
struct ProResCache_t {
ProResInfoArr_t prores_info{};
Expand Down
2 changes: 1 addition & 1 deletion src/interface/meshblock_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void MeshBlockData<T>::Add(std::shared_ptr<Variable<T>> var) noexcept {
}

template <typename T>
bool MeshBlockData<T>::operator==(const MeshBlockData<T> &cmp) {
bool MeshBlockData<T>::operator==(const MeshBlockData<T> &cmp) const {
// do some kind of check of equality
// do the two containers contain the same named fields?
std::vector<std::string> my_keys;
Expand Down
6 changes: 3 additions & 3 deletions src/interface/meshblock_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class MeshBlockData {
// Public Methods
//-----------------
/// Constructor
MeshBlockData<T>() = default;
MeshBlockData() = default;
explicit MeshBlockData<T>(const std::string &name) : stage_name_(name) {}

std::shared_ptr<MeshBlock> GetBlockSharedPointer() const {
Expand Down Expand Up @@ -164,7 +164,7 @@ class MeshBlockData {
coarseVarPackMap_.clear();
varFluxPackMap_.clear();

[[maybe_unused]] auto add_var = [=](auto var) {
[[maybe_unused]] auto add_var = [=, this](auto var) {
if (shallow_copy || var->IsSet(Metadata::OneCopy)) {
Add(var);
} else {
Expand Down Expand Up @@ -538,7 +538,7 @@ class MeshBlockData {
// return number of stored arrays
int Size() noexcept { return varVector_.size(); }

bool operator==(const MeshBlockData<T> &cmp);
bool operator==(const MeshBlockData<T> &cmp) const;

bool Contains(const std::string &name) const noexcept { return varMap_.count(name); }
bool Contains(const Uid_t &uid) const noexcept { return varUidMap_.count(uid); }
Expand Down
4 changes: 2 additions & 2 deletions src/interface/variable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class Variable {
friend class MeshBlockData<T>;

public:
Variable<T>(const std::string &base_name, const Metadata &metadata, int sparse_id,
std::weak_ptr<MeshBlock> wpmb);
Variable(const std::string &base_name, const Metadata &metadata, int sparse_id,
std::weak_ptr<MeshBlock> wpmb);

Variable() = default;
~Variable() {}
Expand Down
2 changes: 1 addition & 1 deletion src/interface/variable_pack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ using UidVecPair = std::pair<std::vector<Uid_t>, std::vector<Uid_t>>;
template <typename T>
class VarListWithKeys {
public:
VarListWithKeys<T>() = default;
VarListWithKeys() = default;

// Adds a variable to the list if one of the following is true:
// a) The variable is not sparse
Expand Down
20 changes: 10 additions & 10 deletions src/kokkos_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,21 @@ using ParArray8D = ParArrayGeneric<ParArray8DRaw<T>, State>;

// Host mirrors
template <typename T>
using HostArray0D = typename ParArray0D<T>::HostMirror;
using HostArray0D = typename ParArray0D<T>::host_mirror_type;
template <typename T>
using HostArray1D = typename ParArray1D<T>::HostMirror;
using HostArray1D = typename ParArray1D<T>::host_mirror_type;
template <typename T>
using HostArray2D = typename ParArray2D<T>::HostMirror;
using HostArray2D = typename ParArray2D<T>::host_mirror_type;
template <typename T>
using HostArray3D = typename ParArray3D<T>::HostMirror;
using HostArray3D = typename ParArray3D<T>::host_mirror_type;
template <typename T>
using HostArray4D = typename ParArray4D<T>::HostMirror;
using HostArray4D = typename ParArray4D<T>::host_mirror_type;
template <typename T>
using HostArray5D = typename ParArray5D<T>::HostMirror;
using HostArray5D = typename ParArray5D<T>::host_mirror_type;
template <typename T>
using HostArray6D = typename ParArray6D<T>::HostMirror;
using HostArray6D = typename ParArray6D<T>::host_mirror_type;
template <typename T>
using HostArray7D = typename ParArray7D<T>::HostMirror;
using HostArray7D = typename ParArray7D<T>::host_mirror_type;

using team_policy = Kokkos::TeamPolicy<>;
using team_mbr_t = Kokkos::TeamPolicy<>::member_type;
Expand All @@ -147,7 +147,7 @@ template <typename T, typename Layout = LayoutWrapper>
using device_view_t =
Kokkos::View<multi_pointer_t<T, MAX_VARIABLE_DIMENSION>, Layout, DevMemSpace>;
template <typename T, typename Layout = LayoutWrapper>
using host_view_t = typename device_view_t<T, Layout>::HostMirror;
using host_view_t = typename device_view_t<T, Layout>::host_mirror_type;

template <typename ND, typename State = empty_state_t>
struct ParArrayND_impl {
Expand All @@ -165,7 +165,7 @@ using ParArray = typename ParArrayND_impl<std::integral_constant<std::size_t, ND

template <std::size_t ND, typename T>
using HostArray = typename ParArrayND_impl<
std::integral_constant<std::size_t, ND>>::template type<T>::HostMirror;
std::integral_constant<std::size_t, ND>>::template type<T>::host_mirror_type;

template <std::size_t ND, typename T>
using ScratchPad =
Expand Down
2 changes: 1 addition & 1 deletion src/outputs/parthenon_hdf5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void PHDF5Output::WriteOutputFileImpl(Mesh *pm, ParameterInput *pin, SimTime *tm
// All blocks have the same list of variable metadata that exist in the entire
// simulation, but not all variables may be allocated on all blocks

auto get_vars = [=](const std::shared_ptr<MeshBlock> pmb) {
auto get_vars = [=, this](const std::shared_ptr<MeshBlock> pmb) {
const auto &data = pmb->meshblock_data.Get(output_params.meshdata_name);
const VariableVector<Real> &var_vec = data->GetVariableVector();
VariableVector<Real> coords_vars =
Expand Down
6 changes: 3 additions & 3 deletions src/pack/sparse_pack_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ class SparsePackBase {
using alloc_t = std::vector<int>;
using include_t = std::vector<bool>;
using pack_t = ParArray3DRaw<ParArray3D<Real, VariableState>>;
using pack_h_t = typename pack_t::HostMirror;
using pack_h_t = typename pack_t::host_mirror_type;
using bounds_t = ParArray3D<int>;
using bounds_h_t = typename bounds_t::HostMirror;
using bounds_h_t = typename bounds_t::host_mirror_type;
using block_props_t = ParArray2D<int>;
using block_props_h_t = typename block_props_t::HostMirror;
using block_props_h_t = typename block_props_t::host_mirror_type;
using coords_t = ParArray1DRaw<ParArray0D<Coordinates_t>>;

static constexpr int physical_bnd_flag = -2000;
Expand Down
2 changes: 1 addition & 1 deletion src/pack/swarm_pack_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SwarmPackBase {
using pack_t = ParArray3DRaw<ParArray1D<TYPE>>;
using bounds_t = ParArray3D<int>;
using contexts_t = ParArray1DRaw<SwarmDeviceContext>;
using contexts_h_t = typename contexts_t::HostMirror;
using contexts_h_t = typename contexts_t::host_mirror_type;
using max_active_indices_t = ParArray1D<int>;
using desc_t = impl::SwarmPackDescriptor<TYPE>;
using idx_map_t = std::unordered_map<std::string, std::size_t>;
Expand Down
2 changes: 1 addition & 1 deletion src/parthenon_array_generic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ParArrayGeneric : public State {
using index_pair_t = std::pair<size_t, size_t>;
using base_t = Data;
using state_t = State;
using HostMirror = ParArrayGeneric<typename Data::HostMirror, State>;
using HostMirror = ParArrayGeneric<typename Data::host_mirror_type, State>;
using host_mirror_type = HostMirror;
using value_type = typename Data::value_type; // To conform to vector and View types

Expand Down
2 changes: 1 addition & 1 deletion src/prolong_restrict/pr_loops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace loops {
// TODO(JMM) if LayoutLeft is ever relaxed, these might need to become
// template parameters
using Idx_t = ParArray1D<std::size_t>;
using IdxHost_t = typename ParArray1D<std::size_t>::HostMirror;
using IdxHost_t = typename ParArray1D<std::size_t>::host_mirror_type;

template <typename Info_t>
KOKKOS_FORCEINLINE_FUNCTION bool DoRefinementOp(const Info_t &info,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/concepts_lite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ struct integral_or_enum_or_pair {
struct kokkos_view {
template <class T>
auto requires_(T x) -> void_t<ENABLEIF(implements<contiguous_container(T)>::value),
typename T::HostMirror, typename T::execution_space,
typename T::host_mirror_type, typename T::execution_space,
typename T::memory_space, typename T::device_type,
typename T::memory_traits, typename T::host_mirror_space>;
};
Expand Down
Loading