Skip to content

Commit

Permalink
fixup! Use parallel hashmap in LS_CSR for edge data
Browse files Browse the repository at this point in the history
  • Loading branch information
meyerzinn committed Apr 12, 2024
1 parent f64773d commit 89f135f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions libgalois/include/galois/graphs/LS_LC_CSR_Graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,9 @@ class LS_LC_CSR_Graph : private boost::noncopyable {
std::conditional_t<HasVertexData, typename std::vector<VertexData>,
typename std::tuple<>>;

using EdgeDataMap = phmap::parallel_flat_hash_map_m<
EdgeHandle, EdgeData, boost::hash<EdgeHandle>, std::equal_to<EdgeHandle>>;

// todo: should we use a galois spinlock here instead of a mutex?
using EdgeDataMap = phmap::parallel_flat_hash_map_m<EdgeHandle, EdgeData>;

using EdgeDataStore =
std::conditional_t<HasEdgeData, EdgeDataMap, std::tuple<>>;

Expand Down Expand Up @@ -156,12 +155,10 @@ class LS_LC_CSR_Graph : private boost::noncopyable {
}

template <typename E = EdgeData, typename = std::enable_if<HasEdgeData>>
inline void setEdgeData(EdgeHandle&& handle, E&& data) {
inline void setEdgeData(EdgeHandle handle, E data) {
m_edge_data.lazy_emplace_l(
handle, [&data](EdgeData& v) { v = std::move(data); },
[&handle, &data](auto& cons) {
cons(std::move(handle), std::move(data));
});
handle, [&data](EdgeData& v) { v = data; },
[&handle, &data](auto& cons) { cons(handle, data); });
}

inline VertexTopologyID begin() const noexcept {
Expand Down

0 comments on commit 89f135f

Please sign in to comment.