Skip to content

Commit

Permalink
feat(presets): add esa21-strong preset
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSeemaier committed Feb 4, 2025
1 parent 7375cba commit 8b10800
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions kaminpar-shm/kaminpar.h
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ Context create_vcycle_context(bool restrict_refinement = false);

Context create_esa21_smallk_context();
Context create_esa21_largek_context();
Context create_esa21_strong_context();

} // namespace kaminpar::shm
#endif // __cplusplus
Expand Down
22 changes: 19 additions & 3 deletions kaminpar-shm/presets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ Context create_context_by_preset_name(const std::string &name) {
return create_vcycle_context(true);
}

if (name == "esa21" || name == "esa21-smallk") {
if (name == "esa21" || name == "esa21-smallk" || name == "diss" || name == "diss-smallk") {
return create_esa21_smallk_context();
} else if (name == "esa21-largek") {
} else if (name == "esa21-largek" || name == "diss-largek") {
return create_esa21_largek_context();
} else if (name == "esa21-strong" || name == "diss-strong") {
return create_esa21_strong_context();
}

throw std::runtime_error("invalid preset name");
Expand All @@ -81,7 +83,8 @@ std::unordered_set<std::string> get_preset_names() {
"vcycle",
"restricted-vcycle",
"esa21-smallk",
"esa21-largek"
"esa21-largek",
"esa21-strong"
};
}

Expand Down Expand Up @@ -422,4 +425,17 @@ Context create_esa21_largek_context() {
return ctx;
}

Context create_esa21_strong_context() {
Context ctx = create_esa21_smallk_context();

ctx.refinement.algorithms = {
RefinementAlgorithm::GREEDY_BALANCER,
RefinementAlgorithm::LABEL_PROPAGATION,
RefinementAlgorithm::KWAY_FM,
RefinementAlgorithm::GREEDY_BALANCER,
};

return ctx;
}

} // namespace kaminpar::shm

0 comments on commit 8b10800

Please sign in to comment.