Skip to content

Commit

Permalink
[Trivial] Fix type used for array init (#1170)
Browse files Browse the repository at this point in the history
* Fix type used for array init

* init array with constexpr expression

* CC

---------

Co-authored-by: Jonah Miller <jonahm@lanl.gov>
  • Loading branch information
pgrete and jonahm-LANL authored Nov 4, 2024
1 parent b5364b7 commit ddc6500
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- [[PR 1172]](https://github.com/parthenon-hpc-lab/parthenon/pull/1172) Make parthenon manager robust against external MPI init and finalize calls

### 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
- [[PR 1189]](https://github.com/parthenon-hpc-lab/parthenon/pull/1189) Address CUDA MPI/ICP issue with Kokkos <=4.4.1
- [[PR 1178]](https://github.com/parthenon-hpc-lab/parthenon/pull/1178) Fix issue with mesh pointer when using relative residual tolerance in BiCGSTAB solver.
- [[PR 1173]](https://github.com/parthenon-hpc-lab/parthenon/pull/1173) Make debugging easier by making parthenon throw an error if ParameterInput is different on multiple MPI ranks.
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 @@ -50,7 +50,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;
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 @@ -213,7 +213,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

0 comments on commit ddc6500

Please sign in to comment.