Skip to content

Commit

Permalink
#1122: collection: expire unneeded stats
Browse files Browse the repository at this point in the history
  • Loading branch information
nlslatt committed Nov 18, 2020
1 parent 92c5e4b commit f49a2af
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/vt/vrt/collection/balance/elm_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ SubphaseType ElementStats::getSubPhase() const {
return cur_subphase_;
}

void ElementStats::startIterCleanup(PhaseType phase, unsigned int look_back) {
if (phase >= look_back) {
phase_timings_.erase(phase - look_back);
subphase_timings_.erase(phase - look_back);
comm_.erase(phase - look_back);
subphase_comm_.erase(phase - look_back);
}
}

std::size_t ElementStats::getLoadPhaseCount() const {
return phase_timings_.size();
}
Expand Down
5 changes: 5 additions & 0 deletions src/vt/vrt/collection/balance/elm_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ struct ElementStats {
void setSubPhase(SubphaseType subphase);
SubphaseType getSubPhase() const;

/**
* \internal \brief Cleanup after LB runs
*/
void startIterCleanup(PhaseType phase, unsigned int look_back);

// these are just for unit testing
std::size_t getLoadPhaseCount() const;
std::size_t getCommPhaseCount() const;
Expand Down
3 changes: 3 additions & 0 deletions src/vt/vrt/collection/balance/elm_stats.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ void ElementStats::syncNextPhase(CollectStatsMsg<ColT>* msg, ColT* col) {
theNodeStats()->addNodeStats(
col, cur_phase, total_load, subphase_loads, comm, subphase_comm
);

auto model = theLBManager()->getLoadModel();
stats.startIterCleanup(cur_phase, model->getNumPastPhasesNeeded());
}

}}}} /* end namespace vt::vrt::collection::balance */
Expand Down

0 comments on commit f49a2af

Please sign in to comment.