Skip to content

Commit 86c50d3

Browse files
committed
Revert "only start fallback at actual deadlock"
This reverts commit 00e103d.
1 parent 8fcad10 commit 86c50d3

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

mt-kahypar/partition/refinement/rebalancing/advanced_rebalancer.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,7 @@ namespace impl {
684684
const HypernodeWeightArray& reduced_part_weights,
685685
size_t& global_move_id,
686686
const uint8_t* is_locked,
687-
bool is_fallback,
688-
bool& is_deadlocked) {
687+
bool is_fallback) {
689688
auto& phg = utils::cast<PartitionedHypergraph>(hypergraph);
690689
const bool is_top_level = phg.initialNumNodes() == _top_level_num_nodes;
691690
auto& max_part_weights = _context.refinement.rebalancing.reduced_rollback ? reduced_part_weights : _context.partition.max_part_weights;
@@ -734,9 +733,7 @@ namespace impl {
734733
&& new_overweight < old_overweight
735734
&& global_move_id < phg.initialNumNodes()
736735
&& (max_rounds == 0 || round < max_rounds));
737-
738736
DBG << V(old_overweight) << V(new_overweight) << V(global_move_id) << V(moved_nodes);
739-
is_deadlocked = (max_rounds == 0 || round == max_rounds);
740737
return {attributed_gain, num_overloaded_blocks, num_moves_first_round};
741738
}
742739

@@ -757,11 +754,10 @@ namespace impl {
757754
auto& phg = utils::cast<PartitionedHypergraph>(hypergraph);
758755
const bool is_top_level = phg.initialNumNodes() == _top_level_num_nodes;
759756

760-
bool is_deadlocked = false;
761757
auto [attributed_gain, num_overloaded_blocks, num_moves_first_round] =
762-
runGreedyAlgorithm(hypergraph, reduced_part_weights, global_move_id, is_locked, false, is_deadlocked);
758+
runGreedyAlgorithm(hypergraph, reduced_part_weights, global_move_id, is_locked, false);
763759

764-
if (is_deadlocked && _context.refinement.rebalancing.use_deadlock_fallback && num_overloaded_blocks > 0
760+
if (_context.refinement.rebalancing.use_deadlock_fallback && num_overloaded_blocks > 0
765761
&& (!_context.refinement.rebalancing.deadlock_fallback_only_toplevel || is_top_level)) {
766762
DBG << YELLOW << "Starting deadlock fallback..." << END;
767763
auto& stats = utils::Utilities::instance().getStats(_context.utility_id);
@@ -782,7 +778,7 @@ namespace impl {
782778

783779
attributed_gain += added_gain;
784780
const auto locks = _context.refinement.rebalancing.fallback_use_locking ? _node_is_locked.data() : nullptr;
785-
auto [attr_gain, n_overloaded, _] = runGreedyAlgorithm(hypergraph, reduced_part_weights, global_move_id, locks, true, is_deadlocked);
781+
auto [attr_gain, n_overloaded, _] = runGreedyAlgorithm(hypergraph, reduced_part_weights, global_move_id, locks, true);
786782
attributed_gain += attr_gain;
787783
num_overloaded_blocks = n_overloaded;
788784
}

mt-kahypar/partition/refinement/rebalancing/advanced_rebalancer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ class AdvancedRebalancer final : public IRebalancer {
149149
const HypernodeWeightArray& reduced_part_weights,
150150
size_t& global_move_id,
151151
const uint8_t* is_locked,
152-
bool is_fallback,
153-
bool& is_deadlocked);
152+
bool is_fallback);
154153

155154
std::pair<int64_t, size_t> runDeadlockFallback(mt_kahypar_partitioned_hypergraph_t& hypergraph, size_t& global_move_id);
156155

0 commit comments

Comments
 (0)