Skip to content

Commit

Permalink
Add initial MIBloomFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
schutzekatze committed Feb 24, 2021
1 parent e1cee8f commit 386531c
Show file tree
Hide file tree
Showing 60 changed files with 2,571 additions and 98 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "external/sdsl-lite"]
path = external/sdsl-lite
url = https://github.com/simongog/sdsl-lite
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Documentation
---
[Docs page](https://bcgsc.github.io/btllib/)

Download
---
The recommended way is to download the latest release, but if you want the latest master branch, ensure to download submodules: `git clone https://github.com/bcgsc/btllib --recurse-submodules`.

C++
---
- Dependencies
Expand Down Expand Up @@ -40,6 +44,7 @@ If you want to contribute code to this repo, before making a pull request, make
- Run `ninja complete` in the `build` directory to generate wrappers, docs, format the code, check for any errors, etc.

`ninja complete` does the following steps, in order:
- `ninja build-sdsl` builds the sdsl-lite dependency library
- `ninja format` formats the whitespace in code (requires clang-format 8+)
- `ninja wrap` wraps C++ code for Python and Java (requires SWIG 4.0+)
- `ninja tidycheck` runs clang-tidy on C++ code and makes sure it passes (requires clang-tidy 8+)
Expand All @@ -50,9 +55,13 @@ If you want to contribute code to this repo, before making a pull request, make

Any of these can be run individually within `build` directory.

In order to build tests and wrappers, you need to run `ninja build-sdsl` once to build the sdsl dependency library.

Credits
---
- Author: [Vladimir Nikolic](https://github.com/schutzekatze)
- Components:
- [Hamid Mohamadi](https://github.com/mohamadi) for [ntHash](https://github.com/bcgsc/ntHash)
- [Justin Chu](https://github.com/JustinChu) for [MIBloomFilter](https://github.com/bcgsc/btl_bloomfilter)
- [Chase Geigle](https://github.com/skystrife) for [cpptoml](https://github.com/skystrife/cpptoml)
- Simon Gog, Timo Beller, Alistair Moffat, and Matthias Petri for [sdsl-lite](https://github.com/simongog/sdsl-lite)
12 changes: 8 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ jobs:
sudo pip3 install ninja meson
displayName: 'Install required software'
- script: |
meson setup build && cd build && ninja
- script: meson setup build && cd build && ninja build-sdsl
displayName: 'Build sdsl dependency'

- script: cd build && ninja
displayName: 'Build the project'

- script: cd build && ninja formatcheck
Expand Down Expand Up @@ -66,8 +68,10 @@ jobs:
sudo pip3 install ninja meson
displayName: 'Install required software'
- script: |
meson setup build && cd build && ninja
- script: meson setup build && cd build && ninja build-sdsl
displayName: 'Build sdsl dependency'

- script: cd build && ninja
displayName: 'Build the project'

- script: cd build && ninja formatcheck
Expand Down
11 changes: 7 additions & 4 deletions compile
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,13 @@ if [[ ! $(which meson) || ! $(which ninja) ]]; then
in_venv=true
fi

rm -rf build
if [[ ! -d build || ! -d python || ! -d java ]]; then
meson setup --buildtype release --prefix=$SCRIPTPATH build
fi
cd external/sdsl-lite
sed -i 's~^\(.*\) -DCMAKE_POSITION_INDEPENDENT_CODE=ON \(.*\)$~\1 \2~' install.sh
sed -i 's~^cmake\(.*\) \.\.~cmake\1 -DCMAKE_POSITION_INDEPENDENT_CODE=ON ..~' install.sh
./install.sh installdir

rm -rf build python java
meson setup --buildtype release --prefix=$SCRIPTPATH build
cd build
ninja install
cd ..
Expand Down
20 changes: 11 additions & 9 deletions docs/annotated.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,17 @@
<tr id="row_0_5_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structbtllib_1_1Indexlr_1_1Flag.html" target="_self">Flag</a></td><td class="desc"></td></tr>
<tr id="row_0_5_1_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structbtllib_1_1Indexlr_1_1Minimizer.html" target="_self">Minimizer</a></td><td class="desc"></td></tr>
<tr id="row_0_5_2_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structbtllib_1_1Indexlr_1_1Record.html" target="_self">Record</a></td><td class="desc"></td></tr>
<tr id="row_0_6_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbtllib_1_1NtHash.html" target="_self">NtHash</a></td><td class="desc"></td></tr>
<tr id="row_0_7_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbtllib_1_1SeedNtHash.html" target="_self">SeedNtHash</a></td><td class="desc"></td></tr>
<tr id="row_0_8_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_8_" class="arrow" onclick="toggleFolder('0_8_')">&#9660;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbtllib_1_1OrderQueue.html" target="_self">OrderQueue</a></td><td class="desc"></td></tr>
<tr id="row_0_8_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structbtllib_1_1OrderQueue_1_1Block.html" target="_self">Block</a></td><td class="desc"></td></tr>
<tr id="row_0_8_1_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structbtllib_1_1OrderQueue_1_1Slot.html" target="_self">Slot</a></td><td class="desc"></td></tr>
<tr id="row_0_9_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_9_" class="arrow" onclick="toggleFolder('0_9_')">&#9660;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbtllib_1_1SeqReader.html" target="_self">SeqReader</a></td><td class="desc"></td></tr>
<tr id="row_0_9_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structbtllib_1_1SeqReader_1_1Flag.html" target="_self">Flag</a></td><td class="desc"></td></tr>
<tr id="row_0_9_1_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structbtllib_1_1SeqReader_1_1Record.html" target="_self">Record</a></td><td class="desc"></td></tr>
<tr id="row_0_10_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbtllib_1_1SeqWriter.html" target="_self">SeqWriter</a></td><td class="desc"></td></tr>
<tr id="row_0_6_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_6_" class="arrow" onclick="toggleFolder('0_6_')">&#9660;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbtllib_1_1MIBloomFilter.html" target="_self">MIBloomFilter</a></td><td class="desc"></td></tr>
<tr id="row_0_6_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structbtllib_1_1MIBloomFilter_1_1FileHeader.html" target="_self">FileHeader</a></td><td class="desc"></td></tr>
<tr id="row_0_7_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbtllib_1_1NtHash.html" target="_self">NtHash</a></td><td class="desc"></td></tr>
<tr id="row_0_8_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbtllib_1_1SeedNtHash.html" target="_self">SeedNtHash</a></td><td class="desc"></td></tr>
<tr id="row_0_9_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_9_" class="arrow" onclick="toggleFolder('0_9_')">&#9660;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbtllib_1_1OrderQueue.html" target="_self">OrderQueue</a></td><td class="desc"></td></tr>
<tr id="row_0_9_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structbtllib_1_1OrderQueue_1_1Block.html" target="_self">Block</a></td><td class="desc"></td></tr>
<tr id="row_0_9_1_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structbtllib_1_1OrderQueue_1_1Slot.html" target="_self">Slot</a></td><td class="desc"></td></tr>
<tr id="row_0_10_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_10_" class="arrow" onclick="toggleFolder('0_10_')">&#9660;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbtllib_1_1SeqReader.html" target="_self">SeqReader</a></td><td class="desc"></td></tr>
<tr id="row_0_10_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structbtllib_1_1SeqReader_1_1Flag.html" target="_self">Flag</a></td><td class="desc"></td></tr>
<tr id="row_0_10_1_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structbtllib_1_1SeqReader_1_1Record.html" target="_self">Record</a></td><td class="desc"></td></tr>
<tr id="row_0_11_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classbtllib_1_1SeqWriter.html" target="_self">SeqWriter</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
Expand Down
4 changes: 2 additions & 2 deletions docs/bloom__filter_8hpp_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="preprocessor">#include &quot;nthash.hpp&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="preprocessor">#include &quot;status.hpp&quot;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="preprocessor">#include &quot;../vendor/cpptoml.hpp&quot;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="preprocessor">#include &quot;../external/cpptoml.hpp&quot;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160; </div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="preprocessor">#include &lt;atomic&gt;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="preprocessor">#include &lt;climits&gt;</span></div>
Expand Down Expand Up @@ -319,7 +319,7 @@
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160;BloomFilter::get_pop_cnt()<span class="keyword"> const</span></div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; uint64_t pop_cnt = 0;</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160;<span class="preprocessor">#pragma omp parallel for reduction(+ : pop_cnt)</span></div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160;<span class="preprocessor">#pragma omp parallel for default(none) reduction(+ : pop_cnt)</span></div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; array_size; ++i) {</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; pop_cnt += pop_cnt_byte(array[i]);</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; }</div>
Expand Down
Loading

0 comments on commit 386531c

Please sign in to comment.