Skip to content

Commit

Permalink
#2201: fix remaining review comments; loosen collection_id requiremen…
Browse files Browse the repository at this point in the history
…t in schema
  • Loading branch information
cwschilly authored and cz4rs committed Sep 20, 2024
1 parent 8fe91ca commit fe8a977
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion scripts/LBDatafile_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def validate_ids(field):
if 'seq_id' not in field and 'id' not in field:
raise ValueError('Either id (bit-encoded) or seq_id must be provided.')

if field['migratable'] and 'collection_id' not in field:
if field['migratable'] and 'seq_id' in field and 'collection_id' not in field:
raise ValueError('If an entity is migratable, it must have a collection_id')

return field
Expand Down
8 changes: 0 additions & 8 deletions src/vt/vrt/collection/balance/temperedlb/temperedlb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2222,14 +2222,6 @@ auto TemperedLB::removeClusterToSend(
);
}

bool TemperedLB::memoryTransferCriterion(double try_total_bytes, double src_bytes) {
// FIXME: incomplete implementation that ignores memory regrouping
auto const src_after_mem = this->current_memory_usage_;
auto const try_after_mem = try_total_bytes + src_bytes;

return not (src_after_mem > this->mem_thresh_ or try_after_mem > this->mem_thresh_);
}

double TemperedLB::loadTransferCriterion(
double before_w_src, double before_w_dst, double after_w_src,
double after_w_dst
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/collection/test_lb.extended.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ TEST_P(TestLoadBalancerOther, test_load_balancer_other_keep_last_elm) {

TEST_P(TestLoadBalancerOther, test_load_balancer_other_run_lb_first_phase) {
vt::theConfig()->vt_lb_run_lb_first_phase = true;
runTest(GetParam(), "test_load_balancer_other_keep_last_elm");
runTest(GetParam(), "test_load_balancer_other_run_lb_first_phase");
}

TEST_P(TestLoadBalancerGreedy, test_load_balancer_greedy_2) {
Expand All @@ -166,7 +166,7 @@ TEST_P(TestLoadBalancerGreedy, test_load_balancer_greedy_keep_last_elm) {

TEST_P(TestLoadBalancerGreedy, test_load_balancer_greedy_run_lb_first_phase) {
vt::theConfig()->vt_lb_run_lb_first_phase = true;
runTest(GetParam(), "test_load_balancer_greedy_keep_last_elm");
runTest(GetParam(), "test_load_balancer_greedy_run_lb_first_phase");
}

TEST_F(TestLoadBalancerOther, test_make_graph_symmetric) {
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/lb/test_temperedlb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ std::string writeTemperedLBConfig(
auto config_file = getUniqueFilename();
if (this_node == 0) {
std::ofstream cfg_file_{config_file.c_str(), std::ofstream::out | std::ofstream::trunc};
cfg_file_ << "0 TemperedLB transfer=" << transfer_strategy <<
cfg_file_ << "0 TemperedLB iters=10 transfer=" << transfer_strategy <<
" alpha=" << alpha <<
" beta=" << beta <<
" gamma=" << gamma <<
Expand All @@ -30,7 +30,7 @@ std::string writeTemperedLBConfig(
} else {
cfg_file_ << " memory_threshold=1e8";
}
}
}
cfg_file_.close();
}
return config_file;
Expand Down Expand Up @@ -64,7 +64,7 @@ void runTemperedLBTest(std::string config_file, double expected_imb = 0.0) {

// The following tests use expected values found by the MILP

TEST_F(TestTemperedLB, test_load_only_original_transfer) {
TEST_F(TestTemperedLB, test_load_only_original) {
SET_NUM_NODES_CONSTRAINT(4);
auto cfg = writeTemperedLBConfig("Original", false);
runTemperedLBTest(cfg);
Expand Down

0 comments on commit fe8a977

Please sign in to comment.