Skip to content

Commit

Permalink
#1830: extract TemperedLB::clearDataStructures
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Jun 22, 2022
1 parent 7cfc5ec commit afa4669
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/vt/vrt/collection/balance/temperedlb/temperedlb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,13 @@ void TemperedLB::runLB(TimeType total_load) {
}
}

void TemperedLB::clearDataStructures() {
selected_.clear();
underloaded_.clear();
load_info_.clear();
is_overloaded_ = is_underloaded_ = false;
}

void TemperedLB::doLBStages(TimeType start_imb) {
decltype(this->cur_objs_) best_objs;
LoadType best_load = 0;
Expand All @@ -483,11 +490,7 @@ void TemperedLB::doLBStages(TimeType start_imb) {
auto this_node = theContext()->getNode();

for (trial_ = 0; trial_ < num_trials_; ++trial_) {
// Clear out data structures
selected_.clear();
underloaded_.clear();
load_info_.clear();
is_overloaded_ = is_underloaded_ = false;
clearDataStructures();

TimeType best_imb_this_trial = start_imb + 10;

Expand All @@ -504,11 +507,7 @@ void TemperedLB::doLBStages(TimeType start_imb) {
}
this_new_load_ = this_load;
} else {
// Clear out data structures from previous iteration
selected_.clear();
underloaded_.clear();
load_info_.clear();
is_overloaded_ = is_underloaded_ = false;
clearDataStructures();
}

vt_debug_print(
Expand Down
1 change: 1 addition & 0 deletions src/vt/vrt/collection/balance/temperedlb/temperedlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ struct TemperedLB : BaseLB {
void informSync();
void decide();
void migrate();
void clearDataStructures();

void propagateRound(uint8_t k_cur_async, bool sync, EpochType epoch = no_epoch);
void propagateIncomingAsync(LoadMsgAsync* msg);
Expand Down

0 comments on commit afa4669

Please sign in to comment.