@@ -12,7 +12,8 @@ constexpr int log2_constexpr(size_t num) {
1212 return power;
1313}
1414
15- class PipelineHyperTree {
15+
16+ class PipelineHyperTree : public GutteringSystem {
1617 private:
1718 const size_t inserters;
1819 const node_id_t num_nodes;
@@ -252,16 +253,14 @@ class PipelineHyperTree {
252253 friend class InsertThread ;
253254
254255 std::vector<InsertThread> insert_threads; // vector of InsertThreads
255- VertexBatchQueue &wq;
256256 public:
257257 /* *
258258 * Constructs a new guttering systems using a tree like structure for cache efficiency.
259259 * @param nodes number of nodes in the graph.
260260 * @param workers the number of workers which will be removing batches
261261 * @param inserters the number of inserter buffers
262262 */
263- PipelineHyperTree (node_id_t nodes, size_t inserters, GutteringConfiguration &conf,
264- VertexBatchQueue &wq);
263+ PipelineHyperTree (node_id_t num_gutters, size_t num_consumers, size_t num_inserters, GutteringConfiguration conf);
265264
266265 ~PipelineHyperTree ();
267266
@@ -313,59 +312,4 @@ class PipelineHyperTree {
313312 */
314313 void print_r_to_l (node_id_t src);
315314 void print_fanouts ();
316-
317- // number of batches per work queue element
318- const size_t wq_batch_per_elm;
319- const size_t leaf_gutter_size;
320- };
321-
322- // The CacheGuttering class adds the GutteringSystem base class to the PipelineHyperTree
323- class CacheGuttering : public GutteringSystem {
324- private:
325- PipelineHyperTree pht;
326- public:
327- CacheGuttering (node_id_t nodes, size_t workers, size_t inserters, GutteringConfiguration conf)
328- : GutteringSystem(nodes, workers, conf), pht(nodes, inserters, conf, wq){};
329-
330-
331- /* *
332- * Puts an update into the data structure.
333- * @param upd the edge update.
334- * @param which, which thread is inserting this update
335- * @return nothing.
336- */
337- insert_ret_t insert (const update_t &upd, size_t which) override {
338- pht.insert (upd, which);
339- }
340-
341- insert_ret_t batch_insert (const update_t *batch, size_t num_updates, size_t which) override {
342- pht.batch_insert (batch, num_updates, which);
343- }
344-
345- insert_ret_t process_stream_upd_batch (const GraphStreamUpdate *batch, size_t num_updates,
346- size_t which) override {
347- pht.process_stream_upd_batch (batch, num_updates, which);
348- }
349-
350- // pure virtual functions don't like default params, so default to 'which' of 0
351- insert_ret_t insert (const update_t &upd) { pht.insert (upd); }
352-
353- /* *
354- * Flushes all pending buffers. When this function returns there are no more updates in the
355- * guttering system
356- * @return nothing.
357- */
358- flush_ret_t force_flush () {
359- pht.force_flush ();
360- }
361-
362- /* *
363- * Set the "offset" for incoming edges. That is, if we set an offset of x, an incoming edge
364- * {i,j} will be stored internally as an edge {i - x, j}. Use only for integration with
365- * distributed guttering. If you don't know what that means, don't use this function!
366- *
367- * @param offset
368- * @return a reference to the parent PipelineHyperTree object.
369- */
370- void set_offset (node_id_t offset) { pht.set_offset (offset); }
371315};
0 commit comments