Skip to content

Commit f14dab7

Browse files
committed
Add simulated perfect timing vcycle
1 parent 307d902 commit f14dab7

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

mt-kahypar/dynamic/strategies/localFM_rebalance_vcycle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ namespace mt_kahypar::dyn {
468468
local_fm(local_fm_nodes, gain_cache_nodes, change, empty_blocks);
469469
ASSERT(context.dynamic.incremental_km1 == metrics::quality(partitioned_hypergraph_m, Objective::km1), context.dynamic.incremental_km1 << " vs. " << metrics::quality(partitioned_hypergraph_m, Objective::km1));
470470

471-
if (changed_weight > context.dynamic.vcycle_step_size_pct * prior_total_weight && change_count <= changes_size * (static_cast<float>(context.dynamic.stop_vcycle_at_pct) / 100)) {
471+
if ((changed_weight > context.dynamic.vcycle_step_size_pct * prior_total_weight && change_count <= changes_size * (static_cast<float>(context.dynamic.stop_vcycle_at_pct) / 100)) || context.dynamic.simulate_opt_vcycle && change_count == changes_size) {
472472
std::cout << "Starting v-cycle " << change_count << "/" << changes_size << " after processing " << changed_weight << " weight changes (" << (100.0 * changed_weight / prior_total_weight) << "% of total weight)" << std::endl;
473473

474474
HighResClockTimepoint vcycle_start = std::chrono::high_resolution_clock::now();

mt-kahypar/io/command_line_options.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,10 @@ namespace mt_kahypar {
887887
("d-stream-changes",
888888
po::value<bool>(&context.dynamic.stream_changes)->value_name("<bool>"),
889889
"If true, then the partitioner is started in streaming mode, which means that it processes changes one by one and does not store them in memory.");
890+
dynamic_options.add_options()
891+
("d-simulate-opt-vcycle",
892+
po::value<bool>(&context.dynamic.simulate_opt_vcycle)->value_name("<bool>"),
893+
"If true, then the partitioner simulates an optimal v-cycle by triggering a vcycle at the very last change.");
890894
return dynamic_options;
891895
}
892896

mt-kahypar/partition/context.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ struct DynamicParameters {
317317
size_t small_blocks_threshold = 5;
318318
bool stream_changes = false; // if true, changes are read and processed one by one, otherwise all changes are read in memory and then processed
319319
bool lazy_pull_updates = true; // ignore updates for the rebalancer that decrement gain
320+
bool simulate_opt_vcycle = false;
320321

321322
// not a parameter
322323
std::string output_path = "";

0 commit comments

Comments
 (0)