Skip to content

Commit

Permalink
improve compaction performance by reducing lock contention (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
meyerzinn authored Mar 21, 2024
1 parent 0db6557 commit 8e25f1d
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions libgalois/include/galois/graphs/LS_LC_CSR_Graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,25 +234,7 @@ class LS_LC_CSR_Graph : private boost::noncopyable {
VertexMetadata& vertex_meta = m_vertices[vertex_id];

if (vertex_meta.buffer == 0) {
uint64_t new_begin;
m_edges_lock.lock();
{
new_begin = m_edges[1].size();
m_edges[1].resize(new_begin + vertex_meta.degree);
}
m_edges_lock.unlock();

uint64_t new_end = new_begin + vertex_meta.degree;

std::copy_if(&getEdgeMetadata(0, vertex_meta.begin),
&getEdgeMetadata(0, vertex_meta.end),
&getEdgeMetadata(1, new_begin),
[](EdgeMetadata& edge_meta) {
return !edge_meta.is_tomb();
});

vertex_meta.begin = new_begin;
vertex_meta.end = new_end;
this->addEdgesTopologyOnly(vertex_id, {});
}

// we are about to swap the buffers, so all vertices will
Expand Down

0 comments on commit 8e25f1d

Please sign in to comment.