diff --git a/scripts/JSON_data_files_validator.py b/scripts/JSON_data_files_validator.py index d3e3a30ef1..1f6301592f 100644 --- a/scripts/JSON_data_files_validator.py +++ b/scripts/JSON_data_files_validator.py @@ -54,7 +54,7 @@ def _get_valid_schema(self) -> Schema: 'num_nodes': int, }, Optional('phases'): { - 'count': int, + Optional('count'): int, 'skipped': { 'list': [int], 'range': [[int]], diff --git a/src/vt/vrt/collection/balance/lb_data_holder.cc b/src/vt/vrt/collection/balance/lb_data_holder.cc index 43b1e61802..15ffd34827 100644 --- a/src/vt/vrt/collection/balance/lb_data_holder.cc +++ b/src/vt/vrt/collection/balance/lb_data_holder.cc @@ -88,7 +88,6 @@ std::unique_ptr LBDataHolder::metadataToJson() const { }; nlohmann::json j; - j["count"] = count_; // Generate list and ranges of skipped phases std::set skipped_list; @@ -264,7 +263,6 @@ std::unique_ptr LBDataHolder::toJson(PhaseType phase) const { } LBDataHolder::LBDataHolder(nlohmann::json const& j) - : count_(0) { auto this_node = theContext()->getNode(); @@ -438,10 +436,6 @@ LBDataHolder::LBDataHolder(nlohmann::json const& j) } } - if (!count_) { - count_ = node_data_.size(); - } - // @todo: implement subphase communication de-serialization, no use for it // right now, so it will be ignored } @@ -451,9 +445,6 @@ void LBDataHolder::readMetadata(nlohmann::json const& j) { auto metadata = j["metadata"]; if (metadata.find("phases") != metadata.end()) { auto phases = metadata["phases"]; - // load count - vtAssertExpr(phases["count"].is_number()); - count_ = phases["count"]; // load all skipped phases auto sl = phases["skipped"]["list"]; if(sl.is_array()) { @@ -507,7 +498,6 @@ void LBDataHolder::clear() { node_data_.clear(); node_subphase_comm_.clear(); node_idx_.clear(); - count_ = 0; skipped_phases_.clear(); identical_phases_.clear(); } diff --git a/src/vt/vrt/collection/balance/lb_data_holder.h b/src/vt/vrt/collection/balance/lb_data_holder.h index caeb4e4cea..39af9eded7 100644 --- a/src/vt/vrt/collection/balance/lb_data_holder.h +++ b/src/vt/vrt/collection/balance/lb_data_holder.h @@ -81,7 +81,6 @@ struct LBDataHolder { s | user_defined_json_; s | user_per_phase_json_; s | node_idx_; - s | count_; s | skipped_phases_; s | identical_phases_; s | user_defined_lb_info_; @@ -156,8 +155,6 @@ struct LBDataHolder { std::unordered_map>> node_idx_; /// Map from id to objgroup proxy std::unordered_map node_objgroup_; - // Number of all phases including skipped and identical - PhaseType count_; // Set of phases that are skipped std::set skipped_phases_; // Set of phases which are identical to previous diff --git a/tests/unit/collection/test_lb_data_holder.cc b/tests/unit/collection/test_lb_data_holder.cc index af95937b92..8bee8042cb 100644 --- a/tests/unit/collection/test_lb_data_holder.cc +++ b/tests/unit/collection/test_lb_data_holder.cc @@ -97,7 +97,6 @@ TEST_F(TestLBDataHolder, test_no_metadata) { addPhasesDataToJson(json, num_phases, {}); LBDataHolder testObj(json); - EXPECT_EQ(testObj.count_, num_phases); std::set expectedSkipped = {}; EXPECT_EQ(testObj.skipped_phases_, expectedSkipped); std::set expectedIdentical = {}; @@ -106,7 +105,6 @@ TEST_F(TestLBDataHolder, test_no_metadata) { auto outJsonPtr = testObj.metadataToJson(); ASSERT_TRUE(outJsonPtr != nullptr); - EXPECT_EQ((*outJsonPtr)["count"], num_phases); std::vector expectedSkippedList = {}; EXPECT_EQ((*outJsonPtr)["skipped"]["list"], expectedSkippedList); std::vector> expectedSkippedRanges = {}; @@ -126,7 +124,6 @@ TEST_F(TestLBDataHolder, test_no_lb_phases_metadata) { addPhasesDataToJson(json, num_phases, {}); LBDataHolder testObj(json); - EXPECT_EQ(testObj.count_, num_phases); std::set expectedSkipped = {}; EXPECT_EQ(testObj.skipped_phases_, expectedSkipped); std::set expectedIdentical = {}; @@ -135,7 +132,6 @@ TEST_F(TestLBDataHolder, test_no_lb_phases_metadata) { auto outJsonPtr = testObj.metadataToJson(); ASSERT_TRUE(outJsonPtr != nullptr); - EXPECT_EQ((*outJsonPtr)["count"], num_phases); std::vector expectedSkippedList = {}; EXPECT_EQ((*outJsonPtr)["skipped"]["list"], expectedSkippedList); std::vector> expectedSkippedRanges = {}; @@ -150,7 +146,6 @@ TEST_F(TestLBDataHolder, test_lb_phases_metadata_empty) { using LBDataHolder = vt::vrt::collection::balance::LBDataHolder; nlohmann::json metadata, phasesMetadata, json; - phasesMetadata["count"] = num_phases; phasesMetadata["skipped"]["list"] = {}; phasesMetadata["skipped"]["range"] = {}; phasesMetadata["identical_to_previous"]["list"] = {}; @@ -162,7 +157,6 @@ TEST_F(TestLBDataHolder, test_lb_phases_metadata_empty) { addPhasesDataToJson(json, num_phases, {}); LBDataHolder testObj(json); - EXPECT_EQ(testObj.count_, num_phases); std::set expectedSkipped = {}; EXPECT_EQ(testObj.skipped_phases_, expectedSkipped); std::set expectedIdentical = {}; @@ -171,7 +165,6 @@ TEST_F(TestLBDataHolder, test_lb_phases_metadata_empty) { auto outJsonPtr = testObj.metadataToJson(); ASSERT_TRUE(outJsonPtr != nullptr); - EXPECT_EQ((*outJsonPtr)["count"], num_phases); std::vector expectedSkippedList = {}; EXPECT_EQ((*outJsonPtr)["skipped"]["list"], expectedSkippedList); std::vector> expectedSkippedRanges = {}; @@ -186,7 +179,6 @@ TEST_F(TestLBDataHolder, test_lb_phases_metadata_filled) { using LBDataHolder = vt::vrt::collection::balance::LBDataHolder; nlohmann::json metadata, phasesMetadata, json; - phasesMetadata["count"] = num_phases; phasesMetadata["skipped"]["list"] = {2}; phasesMetadata["skipped"]["range"] = {{3,4}}; phasesMetadata["identical_to_previous"]["list"] = {1}; @@ -198,7 +190,6 @@ TEST_F(TestLBDataHolder, test_lb_phases_metadata_filled) { addPhasesDataToJson(json, num_phases, {1,2,3,4,8,9}); LBDataHolder testObj(json); - EXPECT_EQ(testObj.count_, num_phases); std::set expectedSkipped = {2, 3, 4}; EXPECT_EQ(testObj.skipped_phases_, expectedSkipped); std::set expectedIdentical = {1, 8, 9}; @@ -207,7 +198,6 @@ TEST_F(TestLBDataHolder, test_lb_phases_metadata_filled) { auto outJsonPtr = testObj.metadataToJson(); ASSERT_TRUE(outJsonPtr != nullptr); - EXPECT_EQ((*outJsonPtr)["count"], num_phases); std::vector expectedSkippedList = {}; EXPECT_EQ((*outJsonPtr)["skipped"]["list"], expectedSkippedList); std::vector> expectedSkippedRanges = {{2,4}};