Skip to content

Commit

Permalink
#941: Fixes to datatypes
Browse files Browse the repository at this point in the history
  • Loading branch information
Braden Mailloux committed Oct 7, 2020
1 parent 2cdab78 commit 1a54e1e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/vt/vrt/collection/balance/elm_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ ElementStats::getComm(PhaseType const& phase, SubphaseType const& subphase) {

CommMapType const& ElementStats::getSubphaseComm(PhaseType phase) {
subphase_comm_.resize(phase + 1);
auto const& subphase_comm = subphase_comm_[phase];
auto const& subphase_comm = subphase_comm_[phase][phase];

vt_debug_print(
lb, node,
Expand Down
12 changes: 8 additions & 4 deletions src/vt/vrt/collection/balance/node_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ std::unordered_map<PhaseType, CommMapType> const* NodeStats::getNodeComm() const
return &node_comm_;
}

std::unordered_map<PhaseType, std::unordered_map<SubphaseType, CommMapType>> const* NodeStats::getNodeSubphaseComm() const {
return &node_subphase_comm_;
}

void NodeStats::clearStats() {
NodeStats::node_comm_.clear();
NodeStats::node_data_.clear();
Expand Down Expand Up @@ -295,8 +299,8 @@ void NodeStats::outputStatsForPhase(PhaseType phase) {

ElementIDType NodeStats::addNodeStats(
Migratable* col_elm,
PhaseType const& phase, TimeType const& time,
std::vector<TimeType> const& subphase_time,
PhaseType const& phase, SubphaseType const& subphase,
TimeType const& time, std::vector<TimeType> const& subphase_time,
CommMapType const& comm, std::vector<CommMapType> const& subphase_comm
) {
// A new temp ID gets assigned when a object is migrated into a node
Expand Down Expand Up @@ -334,10 +338,10 @@ ElementIDType NodeStats::addNodeStats(
}

// subphase node comm vector per phase of commmaptypes
auto subphase_comm_data = subphase_node_comm_[phase];
auto subphase_comm_data = node_subphase_comm_[phase];
for (auto&& spc : subphase_comm) {
for (auto&& sp : spc) {
subphase_comm_date[sp.first] += sp.second
subphase_comm_data[sp.first] += sp.second
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/vt/vrt/collection/balance/node_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ struct NodeStats : runtime::component::Component<NodeStats> {
*/
ElementIDType addNodeStats(
Migratable* col_elm,
PhaseType const& phase, TimeType const& time,
std::vector<TimeType> const& subphase_time,
PhaseType const& phase, SubphaseType const& subphase,
TimeType const& time, std::vector<TimeType> const& subphase_time,
CommMapType const& comm, std::vector<CommMapType> const& subphase_comm
);

Expand Down Expand Up @@ -272,7 +272,7 @@ struct NodeStats : runtime::component::Component<NodeStats> {
/// Node communication graph for each local object
std::unordered_map<PhaseType, CommMapType> node_comm_;
/// Node communication graph for each subphase
std::unordered_map<PhaseType, std::unordered_map<SubphaseType, CommMapType>> node_comm_s_;
std::unordered_map<PhaseType, std::unordered_map<SubphaseType, CommMapType>> node_subphase_comm_;
/// The current element ID
ElementIDType next_elm_;
/// The stats file name for outputting instrumentation
Expand Down

0 comments on commit 1a54e1e

Please sign in to comment.