Skip to content

Commit

Permalink
Fix Repartition Segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
T3C42 committed Dec 13, 2024
1 parent 773b5dc commit f1e197a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mt-kahypar/dynamic/dynamic_partitioner.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace mt_kahypar::dyn {

strategy->init(hypergraph_s, context);

size_t log_step_size = max_changes * 0.001;
size_t log_step_size = max_changes * context.dynamic.logging_step_size_pct;

std::cout << log_step_size << std::endl;

Expand All @@ -74,7 +74,7 @@ namespace mt_kahypar::dyn {
HighResClockTimepoint start = std::chrono::high_resolution_clock::now();
strategy->partition(hypergraph_s, context, change, max_changes);
auto duration = std::chrono::high_resolution_clock::now() - start;
if (i % log_step_size != 0) {
if (log_step_size != 0 && i % log_step_size != 0) {
continue;
}
strategy->compute_km1_and_imbalance(hypergraph_s, context, change, strategy->history.back());
Expand Down
3 changes: 3 additions & 0 deletions mt-kahypar/dynamic/strategies/repartition.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ namespace mt_kahypar::dyn {
}

void compute_km1_and_imbalance(ds::StaticHypergraph& hypergraph, Context &context, Change change, PartitionResult& partition_result) override {
if (!partition_result.valid) {
return;
}
partition_result.km1 = mt_kahypar::metrics::quality(partitioned_hypergraph_s, Objective::km1);
partition_result.imbalance = mt_kahypar::metrics::imbalance(partitioned_hypergraph_s, context);
}
Expand Down

0 comments on commit f1e197a

Please sign in to comment.