Skip to content

Commit fe8a977

Browse files
cwschillycz4rs
authored andcommitted
#2201: fix remaining review comments; loosen collection_id requirement in schema
1 parent 8fe91ca commit fe8a977

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

scripts/LBDatafile_schema.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def validate_ids(field):
88
if 'seq_id' not in field and 'id' not in field:
99
raise ValueError('Either id (bit-encoded) or seq_id must be provided.')
1010

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

1414
return field

src/vt/vrt/collection/balance/temperedlb/temperedlb.cc

-8
Original file line numberDiff line numberDiff line change
@@ -2222,14 +2222,6 @@ auto TemperedLB::removeClusterToSend(
22222222
);
22232223
}
22242224

2225-
bool TemperedLB::memoryTransferCriterion(double try_total_bytes, double src_bytes) {
2226-
// FIXME: incomplete implementation that ignores memory regrouping
2227-
auto const src_after_mem = this->current_memory_usage_;
2228-
auto const try_after_mem = try_total_bytes + src_bytes;
2229-
2230-
return not (src_after_mem > this->mem_thresh_ or try_after_mem > this->mem_thresh_);
2231-
}
2232-
22332225
double TemperedLB::loadTransferCriterion(
22342226
double before_w_src, double before_w_dst, double after_w_src,
22352227
double after_w_dst

tests/unit/collection/test_lb.extended.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ TEST_P(TestLoadBalancerOther, test_load_balancer_other_keep_last_elm) {
152152

153153
TEST_P(TestLoadBalancerOther, test_load_balancer_other_run_lb_first_phase) {
154154
vt::theConfig()->vt_lb_run_lb_first_phase = true;
155-
runTest(GetParam(), "test_load_balancer_other_keep_last_elm");
155+
runTest(GetParam(), "test_load_balancer_other_run_lb_first_phase");
156156
}
157157

158158
TEST_P(TestLoadBalancerGreedy, test_load_balancer_greedy_2) {
@@ -166,7 +166,7 @@ TEST_P(TestLoadBalancerGreedy, test_load_balancer_greedy_keep_last_elm) {
166166

167167
TEST_P(TestLoadBalancerGreedy, test_load_balancer_greedy_run_lb_first_phase) {
168168
vt::theConfig()->vt_lb_run_lb_first_phase = true;
169-
runTest(GetParam(), "test_load_balancer_greedy_keep_last_elm");
169+
runTest(GetParam(), "test_load_balancer_greedy_run_lb_first_phase");
170170
}
171171

172172
TEST_F(TestLoadBalancerOther, test_make_graph_symmetric) {

tests/unit/lb/test_temperedlb.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ std::string writeTemperedLBConfig(
1919
auto config_file = getUniqueFilename();
2020
if (this_node == 0) {
2121
std::ofstream cfg_file_{config_file.c_str(), std::ofstream::out | std::ofstream::trunc};
22-
cfg_file_ << "0 TemperedLB transfer=" << transfer_strategy <<
22+
cfg_file_ << "0 TemperedLB iters=10 transfer=" << transfer_strategy <<
2323
" alpha=" << alpha <<
2424
" beta=" << beta <<
2525
" gamma=" << gamma <<
@@ -30,7 +30,7 @@ std::string writeTemperedLBConfig(
3030
} else {
3131
cfg_file_ << " memory_threshold=1e8";
3232
}
33-
}
33+
}
3434
cfg_file_.close();
3535
}
3636
return config_file;
@@ -64,7 +64,7 @@ void runTemperedLBTest(std::string config_file, double expected_imb = 0.0) {
6464

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

67-
TEST_F(TestTemperedLB, test_load_only_original_transfer) {
67+
TEST_F(TestTemperedLB, test_load_only_original) {
6868
SET_NUM_NODES_CONSTRAINT(4);
6969
auto cfg = writeTemperedLBConfig("Original", false);
7070
runTemperedLBTest(cfg);

0 commit comments

Comments
 (0)