From e6f601b17e7dd35b6fd883843a09178b1bce3536 Mon Sep 17 00:00:00 2001 From: Daniel Salwasser Date: Tue, 23 Apr 2024 11:28:54 +0200 Subject: [PATCH] fix(label-propagation): share all structs on the heap between implementations --- kaminpar-shm/label_propagation.h | 41 ++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/kaminpar-shm/label_propagation.h b/kaminpar-shm/label_propagation.h index ae0b193e..c5298024 100644 --- a/kaminpar-shm/label_propagation.h +++ b/kaminpar-shm/label_propagation.h @@ -1275,6 +1275,16 @@ class InOrderLabelPropagation : public LabelPropagation using Base::_rating_map_ets; }; +template struct AbstractChunk { + NodeID start; + NodeID end; +}; + +struct Bucket { + std::size_t start; + std::size_t end; +}; + /*! * Parallel label propagation template that iterates over nodes in chunk random * order. @@ -1308,14 +1318,18 @@ class ChunkRandomLabelPropagation : public LabelPropagation; + using Chunk = AbstractChunk; public: //! The data strucutres that are stored on the heap and used by label propagation. using DataStructures = std::tuple< tbb::enumerable_thread_specific, StaticArray, + StaticArray, StaticArray, tbb::concurrent_vector, + std::vector, + std::vector, ConcurrentFastResetArray>; /*! @@ -1325,12 +1339,22 @@ class ChunkRandomLabelPropagation : public LabelPropagation