kahypar / mt-kahypar

Mt-KaHyPar (Multi-Threaded Karlsruhe Hypergraph Partitioner) is a shared-memory multilevel graph and hypergraph partitioner equipped with parallel implementations of techniques used in the best sequential partitioning algorithms. Mt-KaHyPar can partition extremely large hypergraphs very fast and with high quality.
MIT License
126 stars 26 forks source link

Deterministic 2 #162

Closed larsgottesbueren closed 1 year ago

larsgottesbueren commented 1 year ago

This PR contains

1) some non-determinism fixes in the coarsener 2) a parallelization of the block-pair-wise move approval algorithm 3) adds fixed vertex support for the deterministic code 4) adds the new gain types to the deterministic code

codecov[bot] commented 1 year ago

Codecov Report

Merging #162 (6187644) into master (e0a5aed) will decrease coverage by 0.35%. Report is 3 commits behind head on master. The diff coverage is 64.90%.

:exclamation: Current head 6187644 differs from pull request most recent head beaac7f. Consider uploading reports for the commit beaac7f to get more accurate results

@@            Coverage Diff             @@
##           master     #162      +/-   ##
==========================================
- Coverage   78.66%   78.32%   -0.35%     
==========================================
  Files         202      201       -1     
  Lines       19626    19530      -96     
  Branches     8015     7995      -20     
==========================================
- Hits        15439    15297     -142     
- Misses       4187     4233      +46     
Files Coverage Δ
mt-kahypar/datastructures/concurrent_bucket_map.h 94.11% <100.00%> (ø)
mt-kahypar/datastructures/pin_count_snapshot.h 82.75% <100.00%> (ø)
mt-kahypar/datastructures/static_graph.cpp 79.31% <100.00%> (ø)
mt-kahypar/datastructures/static_graph.h 84.77% <ø> (ø)
mt-kahypar/datastructures/static_hypergraph.h 78.91% <ø> (ø)
mt-kahypar/io/sql_plottools_serializer.cpp 92.56% <100.00%> (-0.05%) :arrow_down:
...-kahypar/partition/coarsening/coarsening_commons.h 100.00% <100.00%> (ø)
.../coarsening/deterministic_multilevel_coarsener.cpp 100.00% <100.00%> (ø)
...ahypar/partition/coarsening/multilevel_coarsener.h 87.27% <100.00%> (ø)
mt-kahypar/partition/partitioner.cpp 0.00% <ø> (ø)
... and 9 more

... and 5 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

larsgottesbueren commented 1 year ago

Looks good overall.

Thanks

The test coverage for deterministic_label_propagation is rather low, perhaps you could extend determinism_test a bit? (e.g., a test where sync-lp-recalculate-gains-on-second-apply is true)

I will remove this particular option since it didn't give any benefit back then.

larsgottesbueren commented 1 year ago

LGTM, only some nitpicks.

Currently, using fixed vertices in deterministic mode will lead to a NonSupportedOperationException. Remove the corresponding restriction in partitioner.cpp. Also make sure that using another gain function in deterministic mode will not silently switch to km1. I have not found the corresponding part in the code where this is enforced. If this is already possible ignore this comment.

There is no silent switch to km1. There is a silent switch to the deterministic refiner, but the refiner names don't pertain to an objective function (as in sequential kahypar).