Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Gillgamesh committed Dec 22, 2024
1 parent 106f2de commit 07cd7dd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions include/bucket_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ class BucketBuffer {
~BucketBuffer() {
}

BucketBuffer(size_t capacity): _capacity(capacity) {
entries = std::vector<BufferEntry>();
entries.reserve(_capacity);
}

bool over_capacity() const {
return entries.size() >= _capacity / 2;
}
Expand Down
5 changes: 4 additions & 1 deletion include/cc_sketch_alg.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,11 @@ class CCSketchAlg {
num_delta_sketches = num_workers;
delta_sketches = new Sketch *[num_delta_sketches];
for (size_t i = 0; i < num_delta_sketches; i++) {
// delta_sketches[i] =
// new Sketch(Sketch::calc_vector_length(num_vertices), seed,
// Sketch::calc_cc_samples(num_vertices, config.get_sketches_factor()));
delta_sketches[i] =
new Sketch(Sketch::calc_vector_length(num_vertices), seed,
new Sketch(5, seed,
Sketch::calc_cc_samples(num_vertices, config.get_sketches_factor()));
}
}
Expand Down
8 changes: 4 additions & 4 deletions include/sketch.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ class Sketch {
* @return The length of the vector to sketch
*/
static vec_t calc_vector_length(node_id_t num_vertices) {
// return ceil(double(num_vertices) * (num_vertices - 1) / 2);
return ceil(double(num_vertices) * (num_vertices - 1) / 2);
// return num_vertices * 4;
// return 50; // round to something thats approx 2^6
return 3;
// return 3;
// return 15;
// return 1 + num_vertices / 16 ;
}
Expand Down Expand Up @@ -304,8 +304,8 @@ class Sketch {
inline size_t get_buckets() const { return num_buckets; }
inline size_t get_num_samples() const { return num_samples; }

// static size_t calc_bkt_per_col(size_t n) { return ceil(log2(n)) + 4;}
static size_t calc_bkt_per_col(size_t n) { return 1;}
static size_t calc_bkt_per_col(size_t n) { return ceil(log2(n)) + 4;}
// static size_t calc_bkt_per_col(size_t n) { return 1;}

#ifdef L0_SAMPLING
static constexpr size_t default_cols_per_sample = 7;
Expand Down
1 change: 1 addition & 0 deletions src/cc_sketch_alg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ void CCSketchAlg::apply_update_batch(int thr_id, node_id_t src_vertex,

for (const auto &dst : dst_vertices) {
delta_sketch.update(static_cast<vec_t>(concat_pairing_fn(src_vertex, dst)));
// std::cout << delta_sketch.bkt_per_col << std::endl;
// #ifdef EAGER_BUCKET_CHECK
// delta_sketch.unsafe_update(static_cast<vec_t>(concat_pairing_fn(src_vertex, dst)));
// }
Expand Down
2 changes: 1 addition & 1 deletion src/sketch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void Sketch::zero_contents() {
}
reset_sample_state();
// TODO - dont do this. Or figure out a way to make it configurable
reallocate(5);
// reallocate(5);
bucket_buffer.clear();
}

Expand Down

0 comments on commit 07cd7dd

Please sign in to comment.