Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Alternatively, one can specify the maximum weight for each block explicitly thro
* `-b <w0> ... <wk-1>`: Same as `-B`, but specifies the maximum weights as fractions of the total node weight, i.e., the weight of the i-th block should be bounded by `wi * total node weight`.

> [!TIP]
> KaMinPar recently added support for balanced minimum block weights.
> KaMinPar recently added support for balanced minimum block weights (**currently only supported by LP refinement**, i.e., `-P default`).
> These can be configured analogously to the maximum block weights via the following options:
>
> * `--min-epsilon=<e.g., 0.03 for 3%>`: mirrors `-e`
Expand Down
20 changes: 10 additions & 10 deletions kaminpar-shm/presets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,10 @@ Context create_eco_context() {

ctx.refinement.algorithms = {
RefinementAlgorithm::OVERLOAD_BALANCER,
RefinementAlgorithm::UNDERLOAD_BALANCER,
// RefinementAlgorithm::UNDERLOAD_BALANCER, // FM does not support min block weights
RefinementAlgorithm::LABEL_PROPAGATION,
RefinementAlgorithm::KWAY_FM,
RefinementAlgorithm::OVERLOAD_BALANCER,
// RefinementAlgorithm::OVERLOAD_BALANCER,
RefinementAlgorithm::UNDERLOAD_BALANCER,
};

Expand All @@ -477,13 +477,13 @@ Context create_strong_context() {

ctx.refinement.algorithms = {
RefinementAlgorithm::OVERLOAD_BALANCER,
RefinementAlgorithm::UNDERLOAD_BALANCER,
// RefinementAlgorithm::UNDERLOAD_BALANCER, // Flows and FM do not support min block weights
RefinementAlgorithm::LABEL_PROPAGATION,
RefinementAlgorithm::KWAY_FM,
RefinementAlgorithm::OVERLOAD_BALANCER,
RefinementAlgorithm::UNDERLOAD_BALANCER,
// RefinementAlgorithm::UNDERLOAD_BALANCER,
RefinementAlgorithm::TWOWAY_FLOW,
RefinementAlgorithm::OVERLOAD_BALANCER,
// RefinementAlgorithm::OVERLOAD_BALANCER,
RefinementAlgorithm::UNDERLOAD_BALANCER,
};

Expand Down Expand Up @@ -523,11 +523,11 @@ Context create_largek_eco_context() {

ctx.refinement.algorithms = {
RefinementAlgorithm::OVERLOAD_BALANCER,
RefinementAlgorithm::UNDERLOAD_BALANCER,
// RefinementAlgorithm::UNDERLOAD_BALANCER, // FM does not support min block weights
RefinementAlgorithm::LABEL_PROPAGATION,
RefinementAlgorithm::KWAY_FM,
RefinementAlgorithm::OVERLOAD_BALANCER,
RefinementAlgorithm::UNDERLOAD_BALANCER,
// RefinementAlgorithm::UNDERLOAD_BALANCER,
};

ctx.refinement.kway_fm.gain_cache_strategy = GainCacheStrategy::COMPACT_HASHING_LARGE_K;
Expand All @@ -540,14 +540,14 @@ Context create_largek_strong_context() {

ctx.refinement.algorithms = {
RefinementAlgorithm::OVERLOAD_BALANCER,
RefinementAlgorithm::UNDERLOAD_BALANCER,
// RefinementAlgorithm::UNDERLOAD_BALANCER, // Flows and FM do not support min block weights
RefinementAlgorithm::LABEL_PROPAGATION,
RefinementAlgorithm::KWAY_FM,
RefinementAlgorithm::OVERLOAD_BALANCER,
RefinementAlgorithm::UNDERLOAD_BALANCER,
// RefinementAlgorithm::UNDERLOAD_BALANCER,
RefinementAlgorithm::TWOWAY_FLOW,
RefinementAlgorithm::OVERLOAD_BALANCER,
RefinementAlgorithm::UNDERLOAD_BALANCER,
// RefinementAlgorithm::UNDERLOAD_BALANCER,
};

ctx.refinement.kway_fm.gain_cache_strategy = GainCacheStrategy::COMPACT_HASHING_LARGE_K;
Expand Down
5 changes: 5 additions & 0 deletions kaminpar-shm/refinement/flow/twoway_flow_refiner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ void TwowayFlowRefiner::initialize([[maybe_unused]] const PartitionedGraph &p_gr
bool TwowayFlowRefiner::refine(
PartitionedGraph &p_graph, [[maybe_unused]] const PartitionContext &p_ctx
) {
if (p_ctx.has_min_block_weights()) {
LOG_WARNING
<< "Two-way flow refinement does not support min block weights. They will be ignored.";
}

return reified(
p_graph,
[&](const auto &csr_graph) {
Expand Down
28 changes: 14 additions & 14 deletions kaminpar-shm/refinement/fm/fm_refiner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,11 @@ template <typename Graph, typename GainCache> class LocalizedFMRefiner {
// Thus, users of the _applied_moves vector may only depend on the order of moves that
// found an improvement.
if (_record_applied_moves) {
_applied_moves.push_back(
fm::AppliedMove{
.node = moved_node,
.from = moved_from,
.improvement = false,
}
);
_applied_moves.push_back(fm::AppliedMove{
.node = moved_node,
.from = moved_from,
.improvement = false,
});
}

_shared.gain_cache.move(moved_node, moved_from, moved_to);
Expand All @@ -200,13 +198,11 @@ template <typename Graph, typename GainCache> class LocalizedFMRefiner {
});

if (_record_applied_moves) {
_applied_moves.push_back(
fm::AppliedMove{
.node = node,
.from = block_from,
.improvement = true,
}
);
_applied_moves.push_back(fm::AppliedMove{
.node = node,
.from = block_from,
.improvement = true,
});
}

// Flush local delta
Expand Down Expand Up @@ -656,6 +652,10 @@ void FMRefiner::initialize(const PartitionedGraph &p_graph) {
}

bool FMRefiner::refine(PartitionedGraph &p_graph, const PartitionContext &p_ctx) {
if (p_ctx.has_min_block_weights()) {
LOG_WARNING << "FM refinement does not support min block weights. They will be ignored.";
}

return _core->refine(p_graph, p_ctx);
}

Expand Down
Loading