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 Dec 11, 2023
1 parent d0a4f72 commit 5aefbe3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 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
10 changes: 9 additions & 1 deletion src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,16 @@ void LBManager::setLoadModel(std::shared_ptr<LoadModel> model) {

model_ = model;
model_->setLoads(nlb_data->getNodeLoad(),
nlb_data->getNodeComm(),
nlb_data->getUserData());
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 5aefbe3

Please sign in to comment.