Skip to content

Commit

Permalink
Merge branch 'develop' into bprather/fix-output-4GB-per-rank
Browse files Browse the repository at this point in the history
  • Loading branch information
lroberts36 authored Aug 1, 2024
2 parents c4c1431 + 1d483e9 commit eaa203c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

### Fixed (not changing behavior/API/variables/...)
- [[PR 1146]](https://github.com/parthenon-hpc-lab/parthenon/pull/1146) Fix an issue outputting >4GB single variables per rank
- [[PR 1144]](https://github.com/parthenon-hpc-lab/parthenon/pull/1144) Fix some restarts w/non-CC fields
- [[PR 1132]](https://github.com/parthenon-hpc-lab/parthenon/pull/1132) Fix regional dependencies for iterative task lists and make solvers work for arbirtrary MeshData partitioning
- [[PR 1139]](https://github.com/parthenon-hpc-lab/parthenon/pull/1139) only add --expt-relaxed-constexpr for COMPILE_LANGUAGE:CXX
- [[PR 1131]](https://github.com/parthenon-hpc-lab/parthenon/pull/1131) Make deallocation of fine and sparse fields work
Expand Down
22 changes: 7 additions & 15 deletions src/parthenon_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,8 @@ void ParthenonManager::RestartPackages(Mesh &rm, RestartReader &resfile) {
}

// Allocate space based on largest vector
int max_vlen = 1;
int num_sparse = 0;
size_t nCells = 1;
size_t max_fillsize = 1;
for (const auto &v_info : all_vars_info) {
const auto &label = v_info.label;

Expand All @@ -306,27 +305,20 @@ void ParthenonManager::RestartPackages(Mesh &rm, RestartReader &resfile) {
"Dense field " + label +
" is marked as sparse in restart file");
}
max_vlen = std::max(max_vlen, v_info.num_components);
IndexRange out_ib = v_info.cellbounds.GetBoundsI(theDomain);
IndexRange out_jb = v_info.cellbounds.GetBoundsJ(theDomain);
IndexRange out_kb = v_info.cellbounds.GetBoundsK(theDomain);

std::vector<size_t> bsize;
bsize.push_back(out_ib.e - out_ib.s + 1);
bsize.push_back(out_jb.e - out_jb.s + 1);
bsize.push_back(out_kb.e - out_kb.s + 1);

nCells = std::max(nCells, bsize[0] * bsize[1] * bsize[2]);
max_fillsize =
std::max(max_fillsize, static_cast<size_t>(v_info.FillSize(theDomain)));
}

// make sure we have all sparse variables that are in the restart file
PARTHENON_REQUIRE_THROWS(
num_sparse == sparse_info.num_sparse,
"Mismatch between sparse fields in simulation and restart file");

std::vector<Real> tmp(static_cast<size_t>(nb) * nCells * max_vlen);
std::vector<Real> tmp(static_cast<size_t>(nb) * max_fillsize);
for (const auto &v_info : all_vars_info) {
const auto vlen = v_info.num_components;
const auto vlen = v_info.num_components * v_info.ntop_elems;
const auto fill_size = v_info.FillSize(theDomain);
const auto &label = v_info.label;

if (Globals::my_rank == 0) {
Expand Down Expand Up @@ -354,7 +346,7 @@ void ParthenonManager::RestartPackages(Mesh &rm, RestartReader &resfile) {
pmb->meshblock_data.Get()->GetVarPtr(label)->dealloc_count = dealloc_count;
} else {
// nothing to read for this block, advance reading index
index += nCells * vlen;
index += fill_size;
continue;
}
}
Expand Down

0 comments on commit eaa203c

Please sign in to comment.