Skip to content

Commit

Permalink
Issue/444/partition bm fix (#445)
Browse files Browse the repository at this point in the history
* benchmark works but gives seg fault

* fixed partition BM as per issue
  • Loading branch information
Ajay-26 authored Jun 20, 2024
1 parent 393d027 commit fe6758a
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions benchmark/Partition_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ static void PartitionHDRF_X(benchmark::State &state) {
g.addEdge(&(*e.second));
}
for (auto _ : state) {
auto result = g.partitionGraph(
CXXGraph::Partitioning::PartitionAlgorithm::HDRF_ALG, 4, 1, 0.001);
auto result = CXXGraph::Partitioning::Partitioner<int>::partitionGraph(
g, CXXGraph::Partitioning::PartitionAlgorithm::HDRF_ALG, 4, 1, 0.001);
}
}
BENCHMARK(PartitionHDRF_X)
Expand All @@ -24,8 +24,9 @@ BENCHMARK(PartitionHDRF_X)
static void PartitionHDRF_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
for (auto _ : state) {
auto result = cit_graph_ptr->partitionGraph(
CXXGraph::Partitioning::PartitionAlgorithm::HDRF_ALG, 4, 1, 0.001);
auto result = CXXGraph::Partitioning::Partitioner<int>::partitionGraph(
*cit_graph_ptr, CXXGraph::Partitioning::PartitionAlgorithm::HDRF_ALG, 4,
1, 0.001);
}
}

Expand All @@ -41,8 +42,8 @@ static void PartitionEBVC_X(benchmark::State &state) {
g.addEdge(&(*e.second));
}
for (auto _ : state) {
auto result = g.partitionGraph(
CXXGraph::Partitioning::PartitionAlgorithm::EDGEBALANCED_VC_ALG, 4);
auto result = CXXGraph::Partitioning::Partitioner<int>::partitionGraph(
g, CXXGraph::Partitioning::PartitionAlgorithm::EDGEBALANCED_VC_ALG, 4);
}
}
BENCHMARK(PartitionEBVC_X)
Expand All @@ -52,7 +53,8 @@ BENCHMARK(PartitionEBVC_X)
static void PartitionEBVC_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
for (auto _ : state) {
auto result = cit_graph_ptr->partitionGraph(
auto result = CXXGraph::Partitioning::Partitioner<int>::partitionGraph(
*cit_graph_ptr,
CXXGraph::Partitioning::PartitionAlgorithm::EDGEBALANCED_VC_ALG, 4);
}
}
Expand All @@ -69,8 +71,8 @@ static void PartitionGVC_X(benchmark::State &state) {
g.addEdge(&(*e.second));
}
for (auto _ : state) {
auto result = g.partitionGraph(
CXXGraph::Partitioning::PartitionAlgorithm::GREEDY_VC_ALG, 4);
auto result = CXXGraph::Partitioning::Partitioner<int>::partitionGraph(
g, CXXGraph::Partitioning::PartitionAlgorithm::GREEDY_VC_ALG, 4);
}
}
BENCHMARK(PartitionGVC_X)
Expand All @@ -80,7 +82,8 @@ BENCHMARK(PartitionGVC_X)
static void PartitionGVC_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
for (auto _ : state) {
auto result = cit_graph_ptr->partitionGraph(
auto result = CXXGraph::Partitioning::Partitioner<int>::partitionGraph(
*cit_graph_ptr,
CXXGraph::Partitioning::PartitionAlgorithm::GREEDY_VC_ALG, 4);
}
}
Expand All @@ -97,8 +100,8 @@ static void PartitionEBV_X(benchmark::State &state) {
g.addEdge(&(*e.second));
}
for (auto _ : state) {
auto result = g.partitionGraph(
CXXGraph::Partitioning::PartitionAlgorithm::EBV_ALG, 4, 1, 1);
auto result = CXXGraph::Partitioning::Partitioner<int>::partitionGraph(
g, CXXGraph::Partitioning::PartitionAlgorithm::EBV_ALG, 4, 1, 1);
}
}
BENCHMARK(PartitionEBV_X)
Expand All @@ -108,8 +111,9 @@ BENCHMARK(PartitionEBV_X)
static void PartitionEBV_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
for (auto _ : state) {
auto result = cit_graph_ptr->partitionGraph(
CXXGraph::Partitioning::PartitionAlgorithm::EBV_ALG, 4, 1, 1);
auto result = CXXGraph::Partitioning::Partitioner<int>::partitionGraph(
*cit_graph_ptr, CXXGraph::Partitioning::PartitionAlgorithm::EBV_ALG, 4,
1, 1);
}
}

Expand Down

0 comments on commit fe6758a

Please sign in to comment.