Skip to content

Commit

Permalink
#1659: lb: improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Dec 13, 2022
1 parent 484a4c4 commit 52d4808
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
8 changes: 4 additions & 4 deletions scripts/JSON_data_files_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def _get_valid_schema(self) -> Schema:
"sum": float,
"var": float
},
Optional("Object_work_modeled"): {
Optional("Object_strategy_specific_load_modeled"): {
"avg": float,
"car": float,
"imb": float,
Expand Down Expand Up @@ -198,7 +198,7 @@ def _get_valid_schema(self) -> Schema:
"sum": float,
"var": float
},
Optional("Rank_work_modeled"): {
Optional("Rank_strategy_specific_load_modeled"): {
"avg": float,
"car": float,
"imb": float,
Expand Down Expand Up @@ -252,7 +252,7 @@ def _get_valid_schema(self) -> Schema:
"sum": float,
"var": float
},
Optional("Object_work_modeled"): {
Optional("Object_strategy_specific_load_modeled"): {
"avg": float,
"car": float,
"imb": float,
Expand Down Expand Up @@ -304,7 +304,7 @@ def _get_valid_schema(self) -> Schema:
"sum": float,
"var": float
},
Optional("Rank_work_modeled"): {
Optional("Rank_strategy_specific_load_modeled"): {
"avg": float,
"car": float,
"imb": float,
Expand Down
4 changes: 2 additions & 2 deletions src/vt/vrt/collection/balance/lb_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ enum struct StatisticQuantity : int8_t {
};

enum struct Statistic : int8_t {
Rank_load_modeled, Rank_load_raw, Rank_comm, Rank_work_modeled,
Object_load_modeled, Object_load_raw, Object_comm, Object_work_modeled,
Rank_load_modeled, Rank_load_raw, Rank_comm, Rank_strategy_specific_load_modeled,
Object_load_modeled, Object_load_raw, Object_comm, Object_strategy_specific_load_modeled,
// W_l_min, W_l_max, W_l_avg, W_l_std, W_l_var, W_l_skewness, W_l_kurtosis,
// W_c_min, W_c_max, W_c_avg, W_c_std, W_c_var, W_c_skewness, W_c_kurtosis,
// W_t_min, W_t_max, W_t_avg, W_t_std, W_t_var, W_t_skewness, W_t_kurtosis,
Expand Down
16 changes: 9 additions & 7 deletions src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -665,21 +665,23 @@ void LBManager::computeStatistics(
));

if (strategy_specific_model_) {
auto rank_work_modeled = 0.;
std::vector<balance::LoadData> obj_work_modeled;
auto rank_strat_specific_load = 0.;
std::vector<balance::LoadData> obj_strat_specific_load;
for (auto elm : *strategy_specific_model_) {
auto work = strategy_specific_model_->getModeledLoad(elm, when);
obj_work_modeled.emplace_back(
LoadData{lb::Statistic::Object_work_modeled, work}
obj_strat_specific_load.emplace_back(
LoadData{lb::Statistic::Object_strategy_specific_load_modeled, work}
);
rank_work_modeled += work;
rank_strat_specific_load += work;
}

lstats.emplace_back(
LoadData{lb::Statistic::Rank_work_modeled, rank_work_modeled}
LoadData{lb::Statistic::Rank_strategy_specific_load_modeled,
rank_strat_specific_load}
);
lstats.emplace_back(reduceVec(
lb::Statistic::Object_work_modeled, std::move(obj_work_modeled)
lb::Statistic::Object_strategy_specific_load_modeled,
std::move(obj_strat_specific_load)
));
}

Expand Down
6 changes: 4 additions & 2 deletions src/vt/vrt/collection/balance/lb_type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ static std::unordered_map<Statistic,std::string> lb_stat_names_ = {
{Statistic::Rank_load_modeled, std::string{"Rank_load_modeled"}},
{Statistic::Rank_load_raw, std::string{"Rank_load_raw"}},
{Statistic::Rank_comm, std::string{"Rank_comm"}},
{Statistic::Rank_work_modeled, std::string{"Rank_work_modeled"}},
{Statistic::Rank_strategy_specific_load_modeled,
std::string{"Rank_strategy_specific_load_modeled"}},
{Statistic::Object_load_modeled, std::string{"Object_load_modeled"}},
{Statistic::Object_load_raw, std::string{"Object_load_raw"}},
{Statistic::Object_comm, std::string{"Object_comm"}},
{Statistic::Object_work_modeled, std::string{"Object_work_modeled"}},
{Statistic::Object_strategy_specific_load_modeled,
std::string{"Object_strategy_specific_load_modeled"}},
{Statistic::ObjectRatio, std::string{"ObjectRatio"}},
{Statistic::EdgeRatio, std::string{"EdgeRatio"}}
};
Expand Down

0 comments on commit 52d4808

Please sign in to comment.