Skip to content

Commit f668060

Browse files
authored
Merge pull request #2752 from SGSSGene/fix/bgzf_thread_count_variable
[FIX] make a bgzf_thread_count a single variable
2 parents 0f5fb9d + 1ec1bba commit f668060

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ If possible, provide tooling that performs the changes, e.g. a shell-script.
5151
#### I/O
5252
* Changed default of `output_options::fasta_blank_before_id` to `false`
5353
([\#2769](https://github.com/seqan/seqan3/pull/2769)).
54+
* Changed default of `bgzf_thread_count` to `4` instead of determining the numbers of cores of the
55+
machine it is running on ([\#2911](https://github.com/seqan/seqan3/pull/2911)).
56+
* `bgzf_thread_count` is now a single global variable instead of having an instance per translation unit
57+
([\#2752](https://github.com/seqan/seqan3/pull/2752)).
5458

5559
# 3.1.0
5660

doc/cookbook/compression_threads.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22
//![example]
33
#include <seqan3/io/all.hpp>
44

5+
6+
// The `bgzf_thread_count` is a variable that can only be changed during run time of the program.
57
// This does not work, the value must be overwritten within a function.
6-
// seqan3::contrib::bgzf_thread_count = 1u;
8+
// seqan3::contrib::bgzf_thread_count = 1u; // Doesn't work
79

810
int main()
911
{
10-
// Use one thread for (de-)compression.
12+
// Here we change the number of threads to `1`. This is a global
13+
// change and will effect the every future bgzf decompression call
14+
// which doesn't specify an explicit thread count parameter.
15+
// Already running decompression calls are unaffected by this
1116
seqan3::contrib::bgzf_thread_count = 1u;
1217

1318
// Read/Write compressed files.

include/seqan3/contrib/stream/bgzf_stream_util.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace seqan3::contrib
3737

3838
/*!\brief A static variable indicating the number of threads to use for the bgzf-streams. Defaults to 4.
3939
*/
40-
[[maybe_unused]] inline static uint64_t bgzf_thread_count = 4;
40+
[[maybe_unused]] inline uint64_t bgzf_thread_count = 4;
4141

4242
// ============================================================================
4343
// Forwards

0 commit comments

Comments
 (0)