From 89f135f9c6116f3a882f433d9e1320b7317c69b4 Mon Sep 17 00:00:00 2001 From: Meyer Zinn Date: Fri, 12 Apr 2024 01:56:07 +0000 Subject: [PATCH] fixup! Use parallel hashmap in LS_CSR for edge data --- libgalois/include/galois/graphs/LS_LC_CSR_Graph.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/libgalois/include/galois/graphs/LS_LC_CSR_Graph.h b/libgalois/include/galois/graphs/LS_LC_CSR_Graph.h index 0db914745..866c32a05 100644 --- a/libgalois/include/galois/graphs/LS_LC_CSR_Graph.h +++ b/libgalois/include/galois/graphs/LS_LC_CSR_Graph.h @@ -70,10 +70,9 @@ class LS_LC_CSR_Graph : private boost::noncopyable { std::conditional_t, typename std::tuple<>>; - using EdgeDataMap = phmap::parallel_flat_hash_map_m< - EdgeHandle, EdgeData, boost::hash, std::equal_to>; - // todo: should we use a galois spinlock here instead of a mutex? + using EdgeDataMap = phmap::parallel_flat_hash_map_m; + using EdgeDataStore = std::conditional_t>; @@ -156,12 +155,10 @@ class LS_LC_CSR_Graph : private boost::noncopyable { } template > - 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 {