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

[Trivial] Fix type used for array init #1170

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
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 @@ -6,6 +6,7 @@


### Fixed (not changing behavior/API/variables/...)
- [[PR 1170]](https://github.com/parthenon-hpc-lab/parthenon/pull/1170) Fixed incorrect initialization of array by a const not constexpr


### Infrastructure (changes irrelevant to downstream codes)
Expand Down
2 changes: 1 addition & 1 deletion src/outputs/output_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace OutputUtils {
// Helper struct containing some information about a variable
struct VarInfo {
public:
static constexpr int VNDIM = MAX_VARIABLE_DIMENSION;
static constexpr const int VNDIM = MAX_VARIABLE_DIMENSION;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the extra const here redundant given that it is already constexpr?

std::string label;
int num_components;
int tensor_rank; // 0- to 3-D for cell-centered variables, 0- to 6-D for arbitrary shape
Expand Down
4 changes: 2 additions & 2 deletions src/outputs/restart_hdf5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright(C) 2020-2024 The Parthenon collaboration
// Licensed under the 3-clause BSD License, see LICENSE file for details
//========================================================================================
// (C) (or copyright) 2020-2021. Triad National Security, LLC. All rights reserved.
// (C) (or copyright) 2020-2024. Triad National Security, LLC. All rights reserved.
//
// This program was produced under U.S. Government contract 89233218CNA000001 for Los
// Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC
Expand Down Expand Up @@ -214,7 +214,7 @@ void RestartReaderHDF5::ReadBlocks(const std::string &name, IndexRange range,
#else // HDF5 enabled
auto hdl = OpenDataset<Real>(name);

const int VNDIM = info.VNDIM;
constexpr int VNDIM = OutputUtils::VarInfo::VNDIM;

/** Select hyperslab in dataset **/
int total_dim = 0;
Expand Down
Loading