@@ -74,7 +74,7 @@ size_t hierarchical_build(hierarchical_interleaved_bloom_filter & hibf,
7474 // initialize lower level IBF
7575 size_t const max_bin_tbs = initialise_max_bin_kmers ();
7676 auto && ibf = construct_ibf (parent_kmers, kmers, max_bin_tbs, current_node, data, is_root);
77- kmers. clear () ; // reduce memory peak
77+ kmers = robin_hood::unordered_flat_set< uint64_t >{} ; // reduce memory peak
7878
7979 // parse all other children (merged bins) of the current ibf
8080 auto loop_over_children = [&]()
@@ -112,16 +112,16 @@ size_t hierarchical_build(hierarchical_interleaved_bloom_filter & hibf,
112112 {
113113 auto & child = children[index];
114114
115- robin_hood::unordered_flat_set<uint64_t > kmers {};
116- size_t const ibf_pos = hierarchical_build (hibf, kmers , child, data, false );
115+ robin_hood::unordered_flat_set<uint64_t > local_kmers {};
116+ size_t const ibf_pos = hierarchical_build (hibf, local_kmers , child, data, false );
117117 auto parent_bin_index = child.parent_bin_index ;
118118 {
119119 size_t const mutex_id{parent_bin_index / 64 };
120120 std::lock_guard<std::mutex> guard{local_ibf_mutex[mutex_id]};
121121 ibf_positions[parent_bin_index] = ibf_pos;
122- build::insert_into_ibf (kmers , 1 , parent_bin_index, ibf, data.fill_ibf_timer );
122+ build::insert_into_ibf (local_kmers , 1 , parent_bin_index, ibf, data.fill_ibf_timer );
123123 if (!is_root)
124- build::update_parent_kmers (parent_kmers, kmers , data.merge_kmers_timer );
124+ build::update_parent_kmers (parent_kmers, local_kmers , data.merge_kmers_timer );
125125 }
126126 }
127127 };
0 commit comments