Skip to content

Commit

Permalink
#1934: Adjust buffers size in objs of the collection
Browse files Browse the repository at this point in the history
  • Loading branch information
thearusable committed Nov 28, 2023
1 parent 771beb9 commit f23d8e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/vt/elm/elm_lb_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,13 @@ struct ElementLBData {
static const constexpr SubphaseType no_subphase =
std::numeric_limits<SubphaseType>::max();

protected:
/**
* \internal \brief Resize internal buffers
* \brief Resize internal buffers
*
* \param[in] hist_lb_data_count the requested buffers capacity
*/
void setHistoryCapacity(unsigned int hist_lb_data_count);

friend struct vrt::collection::balance::NodeLBData;

protected:
bool cur_time_started_ = false;
TimeType cur_time_ = TimeType{0.0};
Expand Down
8 changes: 8 additions & 0 deletions src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@ void LBManager::setLoadModel(std::shared_ptr<LoadModel> model) {
model_ = model;
model_->setLoads(nlb_data->getNodeLoad(),
nlb_data->getNodeComm());

// Adjust buffers size on the objs in collection
runInEpochCollective("LBManager: setLoadModel", [=] {
auto& objs = vt::objgroup::getObjs();
for (auto& obj : objs) {
obj.second->getLBData().setHistoryCapacity(min_hist_lb_data_);
}
});
}

template <typename LB>
Expand Down

0 comments on commit f23d8e9

Please sign in to comment.