-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix loads of things #185
Fix loads of things #185
Conversation
…ing into an error...
Should we pull those into KaHyPar as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There is no immediate need. The changes affect bulk piercing and push-relabel, both of which are not used in KaHyPar at the moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, except for cleaning up external_tools (see comment)
@@ -763,7 +763,7 @@ namespace mt_kahypar::io { | |||
std::sort(internal_pins.begin(), internal_pins.end()); | |||
std::sort(internal_degree.begin(), internal_degree.end()); | |||
|
|||
auto square = [&](size_t x) { return x * x; }; | |||
auto square = [&](double x) { return x * x; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually no UB since unsigned overflow is well defined, but of course produces wrong results^^
|
||
#include "mt-kahypar/partition/refinement/gains/gain_definitions.h" | ||
#include "mt-kahypar/utils/cast.h" | ||
#include "mt-kahypar/partition/context.h" | ||
|
||
#include "pcg_random.hpp" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means we can also remove pcg from external_tools
, right? It would be good to also include this in the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only some docu and style nitpicks
@@ -87,7 +87,9 @@ class ConnectivitySets { | |||
_shallow_copy_bitset() { | |||
if ( num_hyperedges > 0 ) { | |||
_bits.resize("Refinement", "connectivity_set", | |||
static_cast<size_t>(num_hyperedges) * _num_blocks_per_hyperedge, true, assign_parallel); | |||
static_cast<size_t>(num_hyperedges) * _num_blocks_per_hyperedge | |||
+ 1 // The nextBlockID() implementation performs a (masked out) load past the end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or this way or remove the comment:
+ 1 // The nextBlockID() implementation performs a (masked out) load past the end | |
+ 1 /* The nextBlockID() implementation performs a (masked out) load past the end */ |
@@ -195,7 +194,10 @@ namespace mt_kahypar { | |||
template<typename TypeTraits> | |||
void MultilevelUncoarsener<TypeTraits>::refineImpl() { | |||
PartitionedHypergraph& partitioned_hypergraph = *_uncoarseningData.partitioned_hg; | |||
const double time_limit = Base::refinementTimeLimit(_context, (_uncoarseningData.hierarchy)[_current_level].coarseningTime()); | |||
double time_limit = std::numeric_limits<double>::max(); | |||
if (_current_level >= 0 && _current_level != _num_levels) { // there is a refinement run on the coarsest graph before projection, there is no value stored for this run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put comment into next line
return 0; | ||
} | ||
|
||
HyperedgeWeight distance(const PartitionID , const PartitionID ) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting (also apply to other functions)
HyperedgeWeight distance(const PartitionID , const PartitionID ) const { | |
HyperedgeWeight distance(const PartitionID, const PartitionID) const { |
Make includes compatible with some non-standard build systems 😔
Some UB and ASAN fixes in uncoarsening and priority queue
Some WHFC assertion fixes + underflow