Skip to content

Commit

Permalink
#769: gossiplb: fix improperly built CMF
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander committed Apr 18, 2020
1 parent ffdaba8 commit 21b4b11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions src/vt/vrt/collection/balance/gossiplb/gossiplb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ bool GossipLB::isUnderloaded(LoadType load) const {
return load < avg * gossip_threshold;
}

bool GossipLB::isUnderloadedRelaxed(LoadType over, LoadType under) const {
return under < over;
}

bool GossipLB::isOverloaded(LoadType load) const {
auto const avg = stats.at(lb::Statistic::P_l).at(lb::StatisticQuantity::avg);
return load > avg * gossip_threshold;
Expand Down Expand Up @@ -338,10 +334,10 @@ NodeType GossipLB::sampleFromCMF(
return selected_node;
}

std::vector<NodeType> GossipLB::makeUnderloadedRelaxed() const {
std::vector<NodeType> GossipLB::makeUnderloaded() const {
std::vector<NodeType> under = {};
for (auto&& elm : load_info_) {
if (isUnderloadedRelaxed(this_new_load_, elm.first)) {
if (isUnderloaded(elm.first)) {
under.push_back(elm.first);
}
}
Expand Down Expand Up @@ -374,14 +370,14 @@ void GossipLB::decide() {
theTerm()->addAction(lazy_epoch, [&decide_done] { decide_done = true; });

if (is_overloaded_) {
std::vector<NodeType> under = makeUnderloadedRelaxed();
std::vector<NodeType> under = makeUnderloaded();
std::unordered_map<NodeType, ObjsType> migrate_objs;

if (under.size() > 0) {
// Iterate through all the objects
for (auto iter = cur_objs_.begin(); iter != cur_objs_.end(); ) {
// Rebuild the relaxed underloaded set based on updated load of this node
under = makeUnderloadedRelaxed();
under = makeUnderloaded();
if (under.size() == 0) {
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/vt/vrt/collection/balance/gossiplb/gossiplb.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct GossipLB : BaseLB {

std::vector<double> createCMF(NodeSetType const& under);
NodeType sampleFromCMF(NodeSetType const& under, std::vector<double> const& cmf);
std::vector<NodeType> makeUnderloadedRelaxed() const;
std::vector<NodeType> makeUnderloaded() const;
ElementLoadType::iterator selectObject(
LoadType size, ElementLoadType& load, std::set<ObjIDType> const& available
);
Expand Down

0 comments on commit 21b4b11

Please sign in to comment.