Skip to content

Commit

Permalink
#2033: LB: fix case where phase map is sparse
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander committed Jan 18, 2023
1 parent d550e43 commit d88fedd
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/vt/vrt/collection/balance/lb_data_restart_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,17 @@ void LBDataRestartReader::startup() {

void LBDataRestartReader::readHistory(LBDataHolder const& lbdh) {
num_phases_ = lbdh.node_data_.size();
PhaseType prev_known_phase = 0;
for (PhaseType phase = 0; phase < num_phases_; phase++) {
for (auto const& obj : lbdh.node_data_.at(phase)) {
if (obj.first.isMigratable()) {
history_[phase].insert(obj.first);
auto iter = lbdh.node_data_.find(phase);
if (iter == lbdh.node_data_.end()) {
history_[phase] = history_[prev_known_phase];
} else {
prev_known_phase = phase;
for (auto const& obj : iter->second) {
if (obj.first.isMigratable()) {
history_[phase].insert(obj.first);
}
}
}
}
Expand Down

0 comments on commit d88fedd

Please sign in to comment.