Skip to content

Commit

Permalink
Merge pull request #1762 from DARMA-tasking/1761-num-subphases-is-inc…
Browse files Browse the repository at this point in the history
…onsistent

1761 workaround for mismatched subphase counts
  • Loading branch information
lifflander authored May 4, 2022
2 parents 3030d38 + 28e1855 commit 393085f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/vt/vrt/collection/balance/model/raw_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,16 @@ unsigned int RawData::getNumCompletedPhases() {

int RawData::getNumSubphases() {
const auto& last_phase = proc_load_->at(last_completed_phase_);
const auto& an_object = *last_phase.begin();
const auto& subphases = an_object.second.subphase_loads;
return subphases.size();

// @todo: this workaround is O(#objects) and should be removed when we finish
// the new subphase API
int subphases = 0;
for (auto &obj : last_phase) {
if (obj.second.subphase_loads.size() > static_cast<size_t>(subphases)) {
subphases = obj.second.subphase_loads.size();
}
}
return subphases;
}

TimeType RawData::getWork(ElementIDStruct object, PhaseOffset offset)
Expand Down

0 comments on commit 393085f

Please sign in to comment.