Skip to content
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

Merged
merged 52 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
788ff6b
replace quotation marks with <> in tbb includes
larsgottesbueren Sep 13, 2024
b7a58ce
remove double //
larsgottesbueren Sep 13, 2024
65edb91
include
larsgottesbueren Sep 16, 2024
0926870
missing include in bit_ops
larsgottesbueren Sep 16, 2024
72ee5c6
missing macros include
larsgottesbueren Sep 16, 2024
20c22e0
typo
larsgottesbueren Sep 16, 2024
14ba091
missing include
larsgottesbueren Sep 16, 2024
bea38e1
remove duplicate HEAVY_ASSERT definition
larsgottesbueren Sep 16, 2024
eafc1dd
includes
larsgottesbueren Sep 16, 2024
3577a16
remove duplicate defines
larsgottesbueren Sep 16, 2024
705b404
use int64_t instead of HyperedgeWeight in progress bar
larsgottesbueren Sep 16, 2024
2e4f4c4
remove unused variable in global rollback
larsgottesbueren Sep 16, 2024
eb68f72
fix includes in hwloc_topology
larsgottesbueren Sep 16, 2024
1b7f34e
fix include in bitset.h
larsgottesbueren Sep 16, 2024
52d7aa6
fix constructor of concurrent_bucket_map
larsgottesbueren Sep 16, 2024
2982d77
fix include in multilevel_uncoarsener.h
larsgottesbueren Sep 16, 2024
324e9d2
include fixes in fm
larsgottesbueren Sep 16, 2024
8c1462f
fix include in sparse_pin_counts
larsgottesbueren Sep 17, 2024
df7b07c
remove unused variable in delta_partitioned_graph
larsgottesbueren Sep 17, 2024
371a34c
include in priority_queue
larsgottesbueren Sep 17, 2024
c88c5fd
context includes
larsgottesbueren Sep 17, 2024
153a4ec
context includes
larsgottesbueren Sep 17, 2024
d064b48
missing include for HighResClockTimepoint...
larsgottesbueren Sep 17, 2024
d1a4923
missing include in i_fm_strategy
larsgottesbueren Sep 17, 2024
3582512
unused variable
larsgottesbueren Sep 17, 2024
a35e788
missing include
larsgottesbueren Sep 17, 2024
e343a47
includes
larsgottesbueren Sep 17, 2024
ca97f5d
remove usage of deprecated FRIEND_TEST macro
larsgottesbueren Sep 17, 2024
c9a6c4e
add missing dummy functions to TargetGraph
larsgottesbueren Sep 19, 2024
48f532b
missing include in steiner tree gain cache for graphs
larsgottesbueren Sep 19, 2024
16d072c
more dummy methods in target graph
larsgottesbueren Sep 19, 2024
edfd4cd
upgrade kahypar shared resources submodule
larsgottesbueren Sep 20, 2024
a744972
fix include in do_nothing_refiner
larsgottesbueren Sep 20, 2024
6c7da50
missing include in flow_hypergraph_builder.h
larsgottesbueren Sep 20, 2024
afd13e3
upgrade WHFC
larsgottesbueren Sep 20, 2024
fbe1c8f
swap out pcg rng for mt19937
larsgottesbueren Sep 20, 2024
5ac87c1
fix include
larsgottesbueren Sep 20, 2024
774471e
dont rely on template argument deduction...some people turn this warn…
larsgottesbueren Sep 20, 2024
0fce448
another one
larsgottesbueren Sep 20, 2024
671bb46
upgrade WHFC again
larsgottesbueren Sep 20, 2024
6f8bcef
fix UB in partitioning_output.cpp for below avg community sizes
larsgottesbueren Sep 20, 2024
b9737ed
fix out of bounds access when running refinement on the coarsest graph
larsgottesbueren Sep 20, 2024
63e49a9
fix out of bounds access in priority queue
larsgottesbueren Sep 20, 2024
99b8afb
upgrade WHFC
larsgottesbueren Sep 20, 2024
40736fc
fix unused parameter warnings
larsgottesbueren Sep 20, 2024
8feb236
try to debug failing windows test
larsgottesbueren Sep 20, 2024
afcf4b4
atomics not so atomic on windows maybe? try again...
larsgottesbueren Sep 20, 2024
70424b0
Prevent an out-of-bounds load in connectivity sets
larsgottesbueren Sep 22, 2024
620a362
fix signed vs unsigned char issue in 2way fm refiner
larsgottesbueren Sep 23, 2024
37972e8
remove PCG
larsgottesbueren Sep 23, 2024
c7c362b
style fixes
larsgottesbueren Sep 23, 2024
36745c7
fix(priority_queue) don't sift down if the last element was removed
larsgottesbueren Sep 23, 2024
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
6 changes: 3 additions & 3 deletions mt-kahypar/datastructures/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#include <memory>
#include <iterator>

#include "tbb/parallel_for.h"
#include "tbb/scalable_allocator.h"
#include "tbb//parallel_invoke.h"
#include <tbb/parallel_for.h>
#include <tbb/scalable_allocator.h>
#include <tbb/parallel_invoke.h>

#include "mt-kahypar/macros.h"
#include "mt-kahypar/parallel/memory_pool.h"
Expand Down
1 change: 1 addition & 0 deletions mt-kahypar/datastructures/bitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include "mt-kahypar/macros.h"
#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/utils/bit_ops.h"

namespace mt_kahypar {
namespace ds {
Expand Down
6 changes: 3 additions & 3 deletions mt-kahypar/datastructures/concurrent_bucket_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include <thread>
#include <cmath>

#include "tbb/task_arena.h"
#include "tbb/task_group.h"
#include <tbb/task_arena.h>
#include <tbb/task_group.h>

#include "kahypar-resources/meta/mandatory.h"

Expand Down Expand Up @@ -81,7 +81,7 @@ class ConcurrentBucketMap {
_num_buckets(other._num_buckets),
_mod_mask(_num_buckets - 1),
_spin_locks(_num_buckets),
_buckets(std::move(other._buffer)) { }
_buckets(std::move(other._buckets)) { }

template<typename F>
void doParallelForAllBuckets(const F& f) {
Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/connectivity_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#pragma once

#include "tbb/parallel_invoke.h"
#include <tbb/parallel_invoke.h>

#include "mt-kahypar/datastructures/pin_count_in_part.h"
#include "mt-kahypar/datastructures/connectivity_set.h"
Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/connectivity_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <limits>
#include <cassert>

#include "tbb/enumerable_thread_specific.h"
#include <tbb/enumerable_thread_specific.h>

#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/datastructures/array.h"
Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/delta_connectivity_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <limits>
#include <cassert>

#include "tbb/enumerable_thread_specific.h"
#include <tbb/enumerable_thread_specific.h>

#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/datastructures/array.h"
Expand Down
1 change: 0 additions & 1 deletion mt-kahypar/datastructures/delta_partitioned_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class DeltaPartitionedGraph {
_part_weights_delta(context.partition.k, 0),
_part_ids_delta(),
_dummy_connectivity_set() {
const bool top_level = context.type == ContextType::main;
_part_ids_delta.initialize(MAP_SIZE_SMALL);
}

Expand Down
1 change: 0 additions & 1 deletion mt-kahypar/datastructures/delta_partitioned_hypergraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class DeltaPartitionedHypergraph {
_part_ids_delta(),
_pins_in_part_delta(),
_connectivity_set_delta(context.partition.k) {
const bool top_level = context.type == ContextType::main;
_part_ids_delta.initialize(MAP_SIZE_SMALL);
_pins_in_part_delta.initialize(MAP_SIZE_LARGE);
}
Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/dynamic_adjacency_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include <cstddef>

#include "tbb/enumerable_thread_specific.h"
#include <tbb/enumerable_thread_specific.h>

#include "kahypar-resources/datastructure/fast_reset_flag_array.h"

Expand Down
10 changes: 5 additions & 5 deletions mt-kahypar/datastructures/dynamic_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

#include "mt-kahypar/datastructures/dynamic_graph.h"

#include "tbb/blocked_range.h"
#include "tbb/parallel_scan.h"
#include "tbb/parallel_sort.h"
#include "tbb/parallel_reduce.h"
#include "tbb/concurrent_queue.h"
#include <tbb/blocked_range.h>
#include <tbb/parallel_scan.h>
#include <tbb/parallel_sort.h>
#include <tbb/parallel_reduce.h>
#include <tbb/concurrent_queue.h>

#include "mt-kahypar/parallel/stl/scalable_queue.h"
#include "mt-kahypar/datastructures/concurrent_bucket_map.h"
Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/dynamic_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <mutex>
#include <queue>

#include "tbb/parallel_for.h"
#include <tbb/parallel_for.h>

#include "include/libmtkahypartypes.h"

Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/dynamic_graph_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#pragma once

#include "tbb/enumerable_thread_specific.h"
#include <tbb/enumerable_thread_specific.h>

#include "mt-kahypar/datastructures/dynamic_graph.h"
#include "mt-kahypar/parallel/atomic_wrapper.h"
Expand Down
10 changes: 5 additions & 5 deletions mt-kahypar/datastructures/dynamic_hypergraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@

#include "mt-kahypar/datastructures/dynamic_hypergraph.h"

#include "tbb/blocked_range.h"
#include "tbb/parallel_scan.h"
#include "tbb/parallel_sort.h"
#include "tbb/parallel_reduce.h"
#include "tbb/concurrent_queue.h"
#include <tbb/blocked_range.h>
#include <tbb/parallel_scan.h>
#include <tbb/parallel_sort.h>
#include <tbb/parallel_reduce.h>
#include <tbb/concurrent_queue.h>

#include "mt-kahypar/parallel/stl/scalable_queue.h"
#include "mt-kahypar/datastructures/concurrent_bucket_map.h"
Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/dynamic_hypergraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <mutex>
#include <queue>

#include "tbb/parallel_for.h"
#include <tbb/parallel_for.h>

#include "include/libmtkahypartypes.h"

Expand Down
6 changes: 3 additions & 3 deletions mt-kahypar/datastructures/dynamic_hypergraph_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

#include "mt-kahypar/datastructures/dynamic_hypergraph_factory.h"

#include "tbb/parallel_for.h"
#include "tbb/parallel_invoke.h"
#include "tbb/parallel_scan.h"
#include <tbb/parallel_for.h>
#include <tbb/parallel_invoke.h>
#include <tbb/parallel_scan.h>

#include "kahypar-resources/utils/math.h"

Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/dynamic_hypergraph_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#pragma once

#include "tbb/enumerable_thread_specific.h"
#include <tbb/enumerable_thread_specific.h>


#include "mt-kahypar/datastructures/dynamic_hypergraph.h"
Expand Down
6 changes: 3 additions & 3 deletions mt-kahypar/datastructures/incident_net_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

#include <cstddef>

#include "tbb/enumerable_thread_specific.h"
#include "tbb/parallel_invoke.h"
#include "tbb/parallel_scan.h"
#include <tbb/enumerable_thread_specific.h>
#include <tbb/parallel_invoke.h>
#include <tbb/parallel_scan.h>

#include "kahypar-resources/datastructure/fast_reset_flag_array.h"

Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/partitioned_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <type_traits>
#include <mutex>

#include "tbb/parallel_invoke.h"
#include <tbb/parallel_invoke.h>

#include "kahypar-resources/meta/mandatory.h"

Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/partitioned_hypergraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <type_traits>
#include <mutex>

#include "tbb/parallel_invoke.h"
#include <tbb/parallel_invoke.h>

#include "kahypar-resources/meta/mandatory.h"

Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/pin_count_in_part.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include <cmath>

#include "tbb/enumerable_thread_specific.h"
#include <tbb/enumerable_thread_specific.h>

#include "mt-kahypar/macros.h"
#include "mt-kahypar/datastructures/hypergraph_common.h"
Expand Down
9 changes: 7 additions & 2 deletions mt-kahypar/datastructures/priority_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <algorithm>
#include <cassert>

#include <mt-kahypar/parallel/stl/scalable_vector.h>
#include "mt-kahypar/parallel/stl/scalable_vector.h"

namespace mt_kahypar {

Expand Down Expand Up @@ -67,7 +67,9 @@ static constexpr bool enable_heavy_assert = false;
positions[heap.back().id] = 0;
heap[0] = heap.back();
heap.pop_back();
siftDown(0);
if (!empty()) {
siftDown(0);
}
}

void insert(const IdT e, const KeyT k) {
Expand All @@ -87,6 +89,9 @@ static constexpr bool enable_heavy_assert = false;
positions[heap.back().id] = pos;
positions[e] = invalid_position;
heap.pop_back();
if (empty()) {
return;
}
if (comp(removedKey, lastKey)) {
siftUp(pos);
} else {
Expand Down
2 changes: 2 additions & 0 deletions mt-kahypar/datastructures/sparse_pin_counts.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
#include "mt-kahypar/macros.h"
#include "mt-kahypar/datastructures/hypergraph_common.h"
#include "mt-kahypar/datastructures/array.h"
#include "mt-kahypar/datastructures/static_bitset.h"
#include "mt-kahypar/datastructures/pin_count_snapshot.h"
#include "mt-kahypar/parallel/atomic_wrapper.h"
#include "mt-kahypar/parallel/stl/scalable_vector.h"
#include "mt-kahypar/utils/range.h"


namespace mt_kahypar {
Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/static_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include <boost/range/irange.hpp>

#include "tbb/parallel_for.h"
#include <tbb/parallel_for.h>

#include "include/libmtkahypartypes.h"

Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/static_graph_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#pragma once

#include "tbb/enumerable_thread_specific.h"
#include <tbb/enumerable_thread_specific.h>

#include "mt-kahypar/datastructures/static_graph.h"
#include "mt-kahypar/parallel/atomic_wrapper.h"
Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/static_hypergraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#pragma once


#include "tbb/parallel_for.h"
#include <tbb/parallel_for.h>

#include "include/libmtkahypartypes.h"

Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/datastructures/static_hypergraph_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#pragma once

#include "tbb/enumerable_thread_specific.h"
#include <tbb/enumerable_thread_specific.h>

#include "mt-kahypar/datastructures/static_hypergraph.h"
#include "mt-kahypar/parallel/atomic_wrapper.h"
Expand Down
4 changes: 2 additions & 2 deletions mt-kahypar/datastructures/streaming_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include <thread>
#include <type_traits>

#include "tbb/task_arena.h"
#include "tbb/task_group.h"
#include <tbb/task_arena.h>
#include <tbb/task_group.h>

#include "kahypar-resources/meta/mandatory.h"

Expand Down
2 changes: 1 addition & 1 deletion mt-kahypar/io/hypergraph_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#endif


#include "tbb/parallel_for.h"
#include <tbb/parallel_for.h>

#include "mt-kahypar/definitions.h"
#include "mt-kahypar/partition/context_enum_classes.h"
Expand Down
12 changes: 6 additions & 6 deletions mt-kahypar/io/partitioning_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@

#include <vector>

#include "tbb/blocked_range.h"
#include "tbb/parallel_invoke.h"
#include "tbb/parallel_sort.h"
#include "tbb/parallel_reduce.h"
#include "tbb/enumerable_thread_specific.h"
#include <tbb/blocked_range.h>
#include <tbb/parallel_invoke.h>
#include <tbb/parallel_sort.h>
#include <tbb/parallel_reduce.h>
#include <tbb/enumerable_thread_specific.h>

#include "mt-kahypar/definitions.h"
#include "mt-kahypar/parallel/memory_pool.h"
Expand Down Expand Up @@ -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; };
Copy link
Collaborator

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^^


auto avg_and_std_dev = [&](const std::vector<size_t>& v) {
const double avg = std::accumulate(v.begin(), v.end(), 0.0) / static_cast<double>(v.size());
Expand Down
10 changes: 1 addition & 9 deletions mt-kahypar/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#if defined(MT_KAHYPAR_LIBRARY_MODE) || \
!defined(KAHYPAR_ENABLE_THREAD_PINNING) || defined(__APPLE__)
#include "tbb/task_arena.h"
#include <tbb/task_arena.h>
// If we use the C or Python interface or thread pinning is disabled, the cpu ID
// to which the current thread is assigned to is not unique. We therefore use
// the slot index of the current task arena as unique thread ID. Note that the
Expand Down Expand Up @@ -63,11 +63,6 @@
#define MT_KAHYPAR_ATTRIBUTE_ALWAYS_INLINE
#endif

#define HEAVY_ASSERT0(cond) \
!(enable_heavy_assert) ? (void)0 : [&]() { ASSERT(cond); }()
#define HEAVY_ASSERT1(cond, msg) \
!(enable_heavy_assert) ? (void)0 : [&]() { ASSERT(cond, msg); }()

#ifdef KAHYPAR_ENABLE_HEAVY_PREPROCESSING_ASSERTIONS
#define HEAVY_PREPROCESSING_ASSERT_1(cond) ASSERT(cond)
#define HEAVY_PREPROCESSING_ASSERT_2(cond, msg) ASSERT(cond, msg)
Expand Down Expand Up @@ -100,9 +95,6 @@
#define HEAVY_REFINEMENT_ASSERT_2(cond, msg) HEAVY_ASSERT1(cond, msg)
#endif

#define HEAVY_ASSERT_(TYPE, N) HEAVY_##TYPE##_ASSERT_##N
#define HEAVY_ASSERT_EVAL(TYPE, N) HEAVY_ASSERT_(TYPE, N)

// Heavy assertions are assertions which increase the complexity of the scope
// which they are executed in by an polynomial factor. In debug mode you are
// often only interested in certain phase of the multilevel paradigm. However,
Expand Down
2 changes: 2 additions & 0 deletions mt-kahypar/parallel/atomic_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include <atomic>
#include <type_traits>

#include "mt-kahypar/macros.h"

template<typename T>
class CAtomic : public std::__atomic_base<T> {
public:
Expand Down
4 changes: 4 additions & 0 deletions mt-kahypar/parallel/hwloc_topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@

#pragma once

#include <vector>

#include <hwloc.h>

#include "kahypar-resources/macros.h"

namespace mt_kahypar {
namespace parallel {
/**
Expand Down
Loading
Loading