Skip to content

Commit

Permalink
Fixed failed benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickSteil committed Jan 15, 2025
1 parent c1b5b63 commit 2b6d1a1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 87 deletions.
9 changes: 0 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ else()
message(FATAL_ERROR "OpenMP requested but not found")
endif()

add_executable(bench bench.cpp)
target_include_directories(bench PUBLIC datastructures)

target_link_libraries(bench PRIVATE ips4o)

if(OpenMP_CXX_FOUND)
target_link_libraries(bench PUBLIC OpenMP::OpenMP_CXX)
endif()

enable_testing()

add_executable(unit_test
Expand Down
67 changes: 0 additions & 67 deletions bench.cpp

This file was deleted.

22 changes: 13 additions & 9 deletions datastructures/hldag.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ struct HLDAG {
};

parallel_iota(ordering, Vertex(0));
/* ips4o::parallel::sort(ordering.begin(), ordering.end(),
* degreeCompRandom); */
std::sort(ordering.begin(), ordering.end(), degreeCompRandom);
ips4o::parallel::sort(ordering.begin(), ordering.end(), degreeCompRandom);
assert(
std::is_sorted(ordering.begin(), ordering.end(), degreeCompRandom));
} else {
std::ifstream file(fileName);
if (!file.is_open()) {
Expand Down Expand Up @@ -307,12 +307,16 @@ struct HLDAG {
}
}

/* ips4o::parallel::sort(edges.begin(), edges.end(), */
std::sort(edges.begin(), edges.end(),
[&](const auto &left, const auto &right) {
return std::tie(rank[left.from], rank[left.to]) <
std::tie(rank[right.from], rank[right.to]);
});
ips4o::parallel::sort(edges.begin(), edges.end(),
[&](const auto &left, const auto &right) {
return std::tie(rank[left.from], rank[left.to]) <
std::tie(rank[right.from], rank[right.to]);
});
assert(std::is_sorted(edges.begin(), edges.end(),
[&](const auto &left, const auto &right) {
return std::tie(rank[left.from], rank[left.to]) <
std::tie(rank[right.from], rank[right.to]);
}));
}

void resetReachability() {
Expand Down
2 changes: 0 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ int main(int argc, char *argv[]) {
g.showStats();
}

bfs::BFSParallelFrontier bfs(g, numThreads);

Graph rev = g.reverseGraph();

HLDAG<K, LabelThreadSafe> hl(g, rev, numThreads);
Expand Down

0 comments on commit 2b6d1a1

Please sign in to comment.