Skip to content

Commit

Permalink
reduce vertex metadata size
Browse files Browse the repository at this point in the history
  • Loading branch information
meyerzinn committed Mar 19, 2024
1 parent 15f203f commit 12f1e97
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libgalois/include/galois/graphs/LS_LC_CSR_Graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ class LS_LC_CSR_Graph : private boost::noncopyable {
}

private:
struct VertexMetadata : public SpinLock {
struct VertexMetadata {
std::atomic_uint8_t spinlock = ATOMIC_VAR_INIT(0);
uint8_t buffer : 1;
uint64_t begin : 48; // inclusive
uint64_t end : 48; // exclusive
Expand All @@ -266,6 +267,13 @@ class LS_LC_CSR_Graph : private boost::noncopyable {
VertexMetadata(VertexMetadata&& other)
: buffer(std::move(other.buffer)), begin(std::move(other.begin)),
end(std::move(other.end)), degree(std::move(other.degree)) {}

inline void lock() {
while (spinlock.exchange(1, std::memory_order_acquire))
;
}

inline void unlock() { spinlock.store(0, std::memory_order_release); }
};

struct EdgeMetadata {
Expand Down

0 comments on commit 12f1e97

Please sign in to comment.