Skip to content

Commit 0b435d8

Browse files
authored
use work stealing in compaction (#34)
1 parent 2785392 commit 0b435d8

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

libgalois/include/galois/graphs/LS_LC_CSR_Graph.h

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -337,18 +337,20 @@ class LS_LC_CSR_Graph : private boost::noncopyable {
337337
using std::swap;
338338

339339
// move from buffer 0 to buffer 1
340-
galois::do_all(galois::iterate(vertices().begin(), vertices().end()),
341-
[&](VertexTopologyID vertex_id) {
342-
VertexMetadata& vertex_meta = m_vertices[vertex_id];
343-
344-
if (vertex_meta.buffer == 0) {
345-
this->addEdgesTopologyOnly<false>(vertex_id, {});
346-
}
347-
348-
// we are about to swap the buffers, so all vertices will
349-
// be in buffer 0
350-
vertex_meta.buffer = 0;
351-
});
340+
galois::do_all(
341+
galois::iterate(vertices().begin(), vertices().end()),
342+
[&](VertexTopologyID vertex_id) {
343+
VertexMetadata& vertex_meta = m_vertices[vertex_id];
344+
345+
if (vertex_meta.buffer == 0) {
346+
this->addEdgesTopologyOnly<false>(vertex_id, {});
347+
}
348+
349+
// we are about to swap the buffers, so all vertices will
350+
// be in buffer 0
351+
vertex_meta.buffer = 0;
352+
},
353+
galois::steal());
352354

353355
// At this point, there are no more live edges in buffer 0.
354356
m_edges_lock.lock();

0 commit comments

Comments
 (0)