Skip to content

Commit

Permalink
#1183: reset the phase when restoring from file
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Dec 16, 2020
1 parent 8acd899 commit 2340c2a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vt/vrt/collection/balance/elm_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ void ElementStats::updatePhase(PhaseType const& inc) {
subphase_comm_[cur_phase_];
}

void ElementStats::resetPhase() {
cur_phase_ = fst_lb_phase;
}

PhaseType ElementStats::getPhase() const {
return cur_phase_;
}
Expand Down
1 change: 1 addition & 0 deletions src/vt/vrt/collection/balance/elm_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ struct ElementStats {
double bytes, bool bcast
);
void updatePhase(PhaseType const& inc = 1);
void resetPhase();
PhaseType getPhase() const;
TimeType getLoad(PhaseType const& phase) const;
TimeType getLoad(PhaseType phase, SubphaseType subphase) const;
Expand Down
2 changes: 2 additions & 0 deletions src/vt/vrt/collection/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -1836,6 +1836,8 @@ struct CollectionManager
/**
* \brief Restore the collection (collective) from file.
*
* \note Resets the phase to 0 for every element.
*
* \param[in] range the range of the collection to restart
* \param[in] file_base the base file name for the files to read
*
Expand Down
1 change: 1 addition & 0 deletions src/vt/vrt/collection/manager.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3223,6 +3223,7 @@ CollectionManager::restoreFromFile(
// @todo: error check the file read with bytes in directory

auto col_ptr = checkpoint::deserializeFromFile<ColT>(file_name);
col_ptr->stats_.resetPhase();
token[idx].insertPtr(std::move(col_ptr));
}

Expand Down

0 comments on commit 2340c2a

Please sign in to comment.